()
| 281 | ) |
| 282 | |
| 283 | export const getConnectionStats = async () => sew(() => |
| 284 | withAuth(async ({ org, prisma }) => { |
| 285 | const [ |
| 286 | numberOfConnections, |
| 287 | numberOfConnectionsWithFirstTimeSyncJobsInProgress, |
| 288 | ] = await Promise.all([ |
| 289 | prisma.connection.count({ |
| 290 | where: { |
| 291 | orgId: org.id, |
| 292 | } |
| 293 | }), |
| 294 | prisma.connection.count({ |
| 295 | where: { |
| 296 | orgId: org.id, |
| 297 | syncedAt: null, |
| 298 | syncJobs: { |
| 299 | some: { |
| 300 | status: { |
| 301 | in: [ |
| 302 | ConnectionSyncJobStatus.PENDING, |
| 303 | ConnectionSyncJobStatus.IN_PROGRESS, |
| 304 | ] |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | }) |
| 310 | ]); |
| 311 | |
| 312 | return { |
| 313 | numberOfConnections, |
| 314 | numberOfConnectionsWithFirstTimeSyncJobsInProgress, |
| 315 | }; |
| 316 | }) |
| 317 | ); |
| 318 | |
| 319 | export const getRepoInfoByName = async (repoName: string) => sew(() => |
| 320 | withOptionalAuth(async ({ org, prisma }) => { |
no test coverage detected