feat: harden orchestrator execution runtime
This commit is contained in:
@@ -62,6 +62,39 @@ export async function getPageDataPolicyIndex(pool, pageId) {
|
||||
};
|
||||
}
|
||||
|
||||
export async function getPageDataPolicyIndexByWorkspacePath(
|
||||
pool,
|
||||
ownerUserId,
|
||||
workspaceRelativePath,
|
||||
) {
|
||||
if (!pool || !ownerUserId || !workspaceRelativePath) return null;
|
||||
const [rows] = await pool.query(
|
||||
`SELECT i.page_id, i.owner_user_id, i.access_mode, i.dataset_count,
|
||||
i.scope_hash, i.updated_at, p.current_publish_id
|
||||
FROM h5_page_data_policy_index i
|
||||
JOIN h5_page_records p
|
||||
ON p.id = i.page_id
|
||||
AND p.user_id = i.owner_user_id
|
||||
WHERE i.owner_user_id = ?
|
||||
AND p.workspace_relative_path = ?
|
||||
AND p.status <> 'deleted'
|
||||
ORDER BY i.updated_at DESC
|
||||
LIMIT 1`,
|
||||
[ownerUserId, workspaceRelativePath],
|
||||
);
|
||||
const row = rows[0];
|
||||
if (!row) return null;
|
||||
return {
|
||||
pageId: row.page_id,
|
||||
ownerUserId: row.owner_user_id,
|
||||
accessMode: row.access_mode,
|
||||
datasetCount: Number(row.dataset_count ?? 0),
|
||||
scopeHash: row.scope_hash,
|
||||
updatedAt: Number(row.updated_at ?? 0),
|
||||
publicationId: row.current_publish_id ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
export async function listPageDataPolicyIndexByOwner(pool, ownerUserId, { limit = 50 } = {}) {
|
||||
if (!pool) return [];
|
||||
const safeLimit = Math.min(Math.max(1, Number(limit ?? 50)), 200);
|
||||
|
||||
Reference in New Issue
Block a user