bopodev-db 0.1.15 → 0.1.17

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > bopodev-db@0.1.15 build /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopodev/packages/db
3
+ > bopodev-db@0.1.17 build /Users/danielkrusenstrahle/Documents/Projects/Monorepo/bopodev/packages/db
4
4
  > tsc -p tsconfig.json --emitDeclarationOnly
5
5
 
@@ -1,5 +1,5 @@
1
1
  import type { BopoDb } from "./client";
2
- import { heartbeatRunMessages } from "./schema";
2
+ import { heartbeatRunMessages, projectWorkspaces } from "./schema";
3
3
  export declare class RepositoryValidationError extends Error {
4
4
  constructor(message: string);
5
5
  }
@@ -28,16 +28,56 @@ export declare function updateCompany(db: BopoDb, input: {
28
28
  createdAt: Date;
29
29
  } | null>;
30
30
  export declare function deleteCompany(db: BopoDb, id: string): Promise<boolean>;
31
- export declare function listProjects(db: BopoDb, companyId: string): Promise<{
31
+ export declare function listProjects(db: BopoDb, companyId: string): Promise<({
32
32
  id: string;
33
- companyId: string;
34
33
  name: string;
34
+ createdAt: Date;
35
+ companyId: string;
35
36
  description: string | null;
36
37
  status: string;
37
38
  plannedStartAt: Date | null;
39
+ executionWorkspacePolicy: string | null;
40
+ updatedAt: Date;
41
+ } & {
42
+ executionWorkspacePolicy: Record<string, unknown> | null;
43
+ workspaces: Array<typeof projectWorkspaces.$inferSelect>;
44
+ primaryWorkspace: typeof projectWorkspaces.$inferSelect | null;
45
+ })[] | {
38
46
  workspaceLocalPath: string | null;
39
47
  workspaceGithubRepo: string | null;
48
+ executionWorkspacePolicy: Record<string, unknown> | null;
49
+ workspaces: {
50
+ id: string;
51
+ name: string;
52
+ createdAt: Date;
53
+ companyId: string;
54
+ updatedAt: Date;
55
+ projectId: string;
56
+ cwd: string | null;
57
+ repoUrl: string | null;
58
+ repoRef: string | null;
59
+ isPrimary: boolean;
60
+ }[];
61
+ primaryWorkspace: {
62
+ id: string;
63
+ name: string;
64
+ createdAt: Date;
65
+ companyId: string;
66
+ updatedAt: Date;
67
+ projectId: string;
68
+ cwd: string | null;
69
+ repoUrl: string | null;
70
+ repoRef: string | null;
71
+ isPrimary: boolean;
72
+ } | null;
73
+ id: string;
74
+ name: string;
40
75
  createdAt: Date;
76
+ companyId: string;
77
+ description: string | null;
78
+ status: string;
79
+ plannedStartAt: Date | null;
80
+ updatedAt: Date;
41
81
  }[]>;
42
82
  export declare function createProject(db: BopoDb, input: {
43
83
  id?: string;
@@ -46,18 +86,60 @@ export declare function createProject(db: BopoDb, input: {
46
86
  description?: string | null;
47
87
  status?: "planned" | "active" | "paused" | "blocked" | "completed" | "archived";
48
88
  plannedStartAt?: Date | null;
89
+ executionWorkspacePolicy?: Record<string, unknown> | null;
49
90
  workspaceLocalPath?: string | null;
50
91
  workspaceGithubRepo?: string | null;
51
- }): Promise<{
92
+ }): Promise<({
52
93
  id: string;
94
+ name: string;
95
+ createdAt: Date;
53
96
  companyId: string;
97
+ description: string | null;
98
+ status: string;
99
+ plannedStartAt: Date | null;
100
+ executionWorkspacePolicy: string | null;
101
+ updatedAt: Date;
102
+ } & {
103
+ executionWorkspacePolicy: Record<string, unknown> | null;
104
+ workspaces: Array<typeof projectWorkspaces.$inferSelect>;
105
+ primaryWorkspace: typeof projectWorkspaces.$inferSelect | null;
106
+ }) | {
107
+ workspaceLocalPath: string | null;
108
+ workspaceGithubRepo: string | null;
109
+ executionWorkspacePolicy: Record<string, unknown> | null;
110
+ workspaces: {
111
+ id: string;
112
+ name: string;
113
+ createdAt: Date;
114
+ companyId: string;
115
+ updatedAt: Date;
116
+ projectId: string;
117
+ cwd: string | null;
118
+ repoUrl: string | null;
119
+ repoRef: string | null;
120
+ isPrimary: boolean;
121
+ }[];
122
+ primaryWorkspace: {
123
+ id: string;
124
+ name: string;
125
+ createdAt: Date;
126
+ companyId: string;
127
+ updatedAt: Date;
128
+ projectId: string;
129
+ cwd: string | null;
130
+ repoUrl: string | null;
131
+ repoRef: string | null;
132
+ isPrimary: boolean;
133
+ } | null;
134
+ id: string;
54
135
  name: string;
55
- description?: string | null;
56
- status?: "planned" | "active" | "paused" | "blocked" | "completed" | "archived";
57
- plannedStartAt?: Date | null;
58
- workspaceLocalPath?: string | null;
59
- workspaceGithubRepo?: string | null;
60
- }>;
136
+ createdAt: Date;
137
+ companyId: string;
138
+ description: string | null;
139
+ status: string;
140
+ plannedStartAt: Date | null;
141
+ updatedAt: Date;
142
+ } | null>;
61
143
  export declare function updateProject(db: BopoDb, input: {
62
144
  companyId: string;
63
145
  id: string;
@@ -65,18 +147,128 @@ export declare function updateProject(db: BopoDb, input: {
65
147
  description?: string | null;
66
148
  status?: "planned" | "active" | "paused" | "blocked" | "completed" | "archived";
67
149
  plannedStartAt?: Date | null;
150
+ executionWorkspacePolicy?: Record<string, unknown> | null;
68
151
  workspaceLocalPath?: string | null;
69
152
  workspaceGithubRepo?: string | null;
70
- }): Promise<{
153
+ }): Promise<({
71
154
  id: string;
72
- companyId: string;
73
155
  name: string;
156
+ createdAt: Date;
157
+ companyId: string;
74
158
  description: string | null;
75
159
  status: string;
76
160
  plannedStartAt: Date | null;
161
+ executionWorkspacePolicy: string | null;
162
+ updatedAt: Date;
163
+ } & {
164
+ executionWorkspacePolicy: Record<string, unknown> | null;
165
+ workspaces: Array<typeof projectWorkspaces.$inferSelect>;
166
+ primaryWorkspace: typeof projectWorkspaces.$inferSelect | null;
167
+ }) | {
77
168
  workspaceLocalPath: string | null;
78
169
  workspaceGithubRepo: string | null;
170
+ executionWorkspacePolicy: Record<string, unknown> | null;
171
+ workspaces: {
172
+ id: string;
173
+ name: string;
174
+ createdAt: Date;
175
+ companyId: string;
176
+ updatedAt: Date;
177
+ projectId: string;
178
+ cwd: string | null;
179
+ repoUrl: string | null;
180
+ repoRef: string | null;
181
+ isPrimary: boolean;
182
+ }[];
183
+ primaryWorkspace: {
184
+ id: string;
185
+ name: string;
186
+ createdAt: Date;
187
+ companyId: string;
188
+ updatedAt: Date;
189
+ projectId: string;
190
+ cwd: string | null;
191
+ repoUrl: string | null;
192
+ repoRef: string | null;
193
+ isPrimary: boolean;
194
+ } | null;
195
+ id: string;
196
+ name: string;
197
+ createdAt: Date;
198
+ companyId: string;
199
+ description: string | null;
200
+ status: string;
201
+ plannedStartAt: Date | null;
202
+ updatedAt: Date;
203
+ } | null>;
204
+ export declare function listProjectWorkspaces(db: BopoDb, companyId: string, projectId: string): Promise<{
205
+ id: string;
206
+ companyId: string;
207
+ projectId: string;
208
+ name: string;
209
+ cwd: string | null;
210
+ repoUrl: string | null;
211
+ repoRef: string | null;
212
+ isPrimary: boolean;
213
+ createdAt: Date;
214
+ updatedAt: Date;
215
+ }[]>;
216
+ export declare function createProjectWorkspace(db: BopoDb, input: {
217
+ companyId: string;
218
+ projectId: string;
219
+ name: string;
220
+ cwd?: string | null;
221
+ repoUrl?: string | null;
222
+ repoRef?: string | null;
223
+ isPrimary?: boolean;
224
+ }): Promise<{
225
+ id: string;
226
+ name: string;
227
+ createdAt: Date;
228
+ companyId: string;
229
+ updatedAt: Date;
230
+ projectId: string;
231
+ cwd: string | null;
232
+ repoUrl: string | null;
233
+ repoRef: string | null;
234
+ isPrimary: boolean;
235
+ } | undefined>;
236
+ export declare function updateProjectWorkspace(db: BopoDb, input: {
237
+ companyId: string;
238
+ projectId: string;
239
+ id: string;
240
+ name?: string;
241
+ cwd?: string | null;
242
+ repoUrl?: string | null;
243
+ repoRef?: string | null;
244
+ isPrimary?: boolean;
245
+ }): Promise<{
246
+ id: string;
247
+ companyId: string;
248
+ projectId: string;
249
+ name: string;
250
+ cwd: string | null;
251
+ repoUrl: string | null;
252
+ repoRef: string | null;
253
+ isPrimary: boolean;
254
+ createdAt: Date;
255
+ updatedAt: Date;
256
+ } | null>;
257
+ export declare function deleteProjectWorkspace(db: BopoDb, input: {
258
+ companyId: string;
259
+ projectId: string;
260
+ id: string;
261
+ }): Promise<{
262
+ id: string;
263
+ name: string;
79
264
  createdAt: Date;
265
+ companyId: string;
266
+ updatedAt: Date;
267
+ projectId: string;
268
+ cwd: string | null;
269
+ repoUrl: string | null;
270
+ repoRef: string | null;
271
+ isPrimary: boolean;
80
272
  } | null>;
81
273
  export declare function syncProjectGoals(db: BopoDb, input: {
82
274
  companyId: string;
@@ -485,6 +677,7 @@ export declare function listApprovalRequests(db: BopoDb, companyId: string): Pro
485
677
  createdAt: Date;
486
678
  resolvedAt: Date | null;
487
679
  }[]>;
680
+ export declare function countPendingApprovalRequests(db: BopoDb, companyId: string): Promise<number>;
488
681
  export declare function listApprovalInboxStates(db: BopoDb, companyId: string, actorId: string): Promise<{
489
682
  companyId: string;
490
683
  actorId: string;
@@ -693,6 +886,163 @@ export declare function listPluginRuns(db: BopoDb, input: {
693
886
  diagnosticsJson: string;
694
887
  createdAt: Date;
695
888
  }[]>;
889
+ export declare function listTemplates(db: BopoDb, companyId: string): Promise<{
890
+ id: string;
891
+ companyId: string;
892
+ slug: string;
893
+ name: string;
894
+ description: string | null;
895
+ currentVersion: string;
896
+ status: string;
897
+ visibility: string;
898
+ variablesJson: string;
899
+ createdAt: Date;
900
+ updatedAt: Date;
901
+ }[]>;
902
+ export declare function getTemplate(db: BopoDb, companyId: string, templateId: string): Promise<{
903
+ id: string;
904
+ companyId: string;
905
+ slug: string;
906
+ name: string;
907
+ description: string | null;
908
+ currentVersion: string;
909
+ status: string;
910
+ visibility: string;
911
+ variablesJson: string;
912
+ createdAt: Date;
913
+ updatedAt: Date;
914
+ } | null>;
915
+ export declare function getTemplateBySlug(db: BopoDb, companyId: string, slug: string): Promise<{
916
+ id: string;
917
+ companyId: string;
918
+ slug: string;
919
+ name: string;
920
+ description: string | null;
921
+ currentVersion: string;
922
+ status: string;
923
+ visibility: string;
924
+ variablesJson: string;
925
+ createdAt: Date;
926
+ updatedAt: Date;
927
+ } | null>;
928
+ export declare function createTemplate(db: BopoDb, input: {
929
+ companyId: string;
930
+ slug: string;
931
+ name: string;
932
+ description?: string | null;
933
+ currentVersion?: string;
934
+ status?: "draft" | "published" | "archived";
935
+ visibility?: "company" | "private";
936
+ variablesJson?: string;
937
+ }): Promise<{
938
+ id: string;
939
+ name: string;
940
+ createdAt: Date;
941
+ companyId: string;
942
+ description: string | null;
943
+ status: string;
944
+ updatedAt: Date;
945
+ slug: string;
946
+ currentVersion: string;
947
+ visibility: string;
948
+ variablesJson: string;
949
+ } | null>;
950
+ export declare function updateTemplate(db: BopoDb, input: {
951
+ companyId: string;
952
+ id: string;
953
+ slug?: string;
954
+ name?: string;
955
+ description?: string | null;
956
+ currentVersion?: string;
957
+ status?: "draft" | "published" | "archived";
958
+ visibility?: "company" | "private";
959
+ variablesJson?: string;
960
+ }): Promise<{
961
+ id: string;
962
+ companyId: string;
963
+ slug: string;
964
+ name: string;
965
+ description: string | null;
966
+ currentVersion: string;
967
+ status: string;
968
+ visibility: string;
969
+ variablesJson: string;
970
+ createdAt: Date;
971
+ updatedAt: Date;
972
+ } | null>;
973
+ export declare function deleteTemplate(db: BopoDb, companyId: string, templateId: string): Promise<boolean>;
974
+ export declare function listTemplateVersions(db: BopoDb, companyId: string, templateId: string): Promise<{
975
+ id: string;
976
+ companyId: string;
977
+ templateId: string;
978
+ version: string;
979
+ manifestJson: string;
980
+ createdAt: Date;
981
+ }[]>;
982
+ export declare function getTemplateVersionByVersion(db: BopoDb, input: {
983
+ companyId: string;
984
+ templateId: string;
985
+ version: string;
986
+ }): Promise<{
987
+ id: string;
988
+ companyId: string;
989
+ templateId: string;
990
+ version: string;
991
+ manifestJson: string;
992
+ createdAt: Date;
993
+ } | null>;
994
+ export declare function getCurrentTemplateVersion(db: BopoDb, companyId: string, templateId: string): Promise<{
995
+ id: string;
996
+ companyId: string;
997
+ templateId: string;
998
+ version: string;
999
+ manifestJson: string;
1000
+ createdAt: Date;
1001
+ } | null>;
1002
+ export declare function createTemplateVersion(db: BopoDb, input: {
1003
+ companyId: string;
1004
+ templateId: string;
1005
+ version: string;
1006
+ manifestJson: string;
1007
+ }): Promise<{
1008
+ id: string;
1009
+ createdAt: Date;
1010
+ companyId: string;
1011
+ version: string;
1012
+ manifestJson: string;
1013
+ templateId: string;
1014
+ } | null>;
1015
+ export declare function listTemplateInstalls(db: BopoDb, input: {
1016
+ companyId: string;
1017
+ templateId?: string;
1018
+ limit?: number;
1019
+ }): Promise<{
1020
+ id: string;
1021
+ companyId: string;
1022
+ templateId: string | null;
1023
+ templateVersionId: string | null;
1024
+ status: string;
1025
+ summaryJson: string;
1026
+ variablesJson: string;
1027
+ createdAt: Date;
1028
+ }[]>;
1029
+ export declare function createTemplateInstall(db: BopoDb, input: {
1030
+ companyId: string;
1031
+ templateId?: string | null;
1032
+ templateVersionId?: string | null;
1033
+ status?: "applied" | "queued" | "failed";
1034
+ summaryJson?: string;
1035
+ variablesJson?: string;
1036
+ }): Promise<{
1037
+ id: string;
1038
+ createdAt: Date;
1039
+ companyId: string;
1040
+ status: string;
1041
+ variablesJson: string;
1042
+ templateId: string | null;
1043
+ templateVersionId: string | null;
1044
+ summaryJson: string;
1045
+ } | null>;
696
1046
  export declare function listModelPricing(db: BopoDb, companyId: string): Promise<{
697
1047
  companyId: string;
698
1048
  providerType: string;