chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:32:57 +08:00
commit cd420f9332
4811 changed files with 884702 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import type { TaskTriggerSource } from "@trigger.dev/database";
import type { PrismaClientOrTransaction } from "~/db.server";
import { sqlDatabaseSchema } from "~/db.server";
export { getTaskIdentifiers } from "~/services/taskIdentifierRegistry.server";
export type { TaskIdentifierEntry } from "~/services/taskIdentifierCache.server";
/**
*
* @param prisma An efficient query to get all task identifiers for a project.
* It has indexes for fast performance.
* It does NOT care about versions, so includes all tasks ever created.
*/
export function getAllTaskIdentifiers(prisma: PrismaClientOrTransaction, environmentId: string) {
return prisma.$queryRaw<
{
slug: string;
triggerSource: TaskTriggerSource;
}[]
>`
SELECT DISTINCT(slug), "triggerSource"
FROM ${sqlDatabaseSchema}."BackgroundWorkerTask"
WHERE "runtimeEnvironmentId" = ${environmentId}
ORDER BY slug ASC;`;
}