From 0310c0e860e565837cf3fecd26bb47e8af0175b3 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Fri, 26 Dec 2025 01:28:10 +0000 Subject: [PATCH] docs: hpp,dbal,cpp (3 files) --- .../src/entities/page/get_page_by_slug.hpp | 37 +++++++++++++++++++ dbal/cpp/src/entities/page/index.hpp | 1 + docs/permissions-levels.md | 1 + 3 files changed, 39 insertions(+) create mode 100644 dbal/cpp/src/entities/page/get_page_by_slug.hpp diff --git a/dbal/cpp/src/entities/page/get_page_by_slug.hpp b/dbal/cpp/src/entities/page/get_page_by_slug.hpp new file mode 100644 index 000000000..1b5dd8eb1 --- /dev/null +++ b/dbal/cpp/src/entities/page/get_page_by_slug.hpp @@ -0,0 +1,37 @@ +/** + * @file get_page_by_slug.hpp + * @brief Get page by slug operation + */ +#ifndef DBAL_GET_PAGE_BY_SLUG_HPP +#define DBAL_GET_PAGE_BY_SLUG_HPP + +#include "dbal/types.hpp" +#include "dbal/errors.hpp" +#include "../../store/in_memory_store.hpp" +#include "get_page.hpp" + +namespace dbal { +namespace entities { +namespace page { + +/** + * Get a page by slug + */ +inline Result getBySlug(InMemoryStore& store, const std::string& slug) { + if (slug.empty()) { + return Error::validationError("Slug cannot be empty"); + } + + auto it = store.page_slugs.find(slug); + if (it == store.page_slugs.end()) { + return Error::notFound("Page not found with slug: " + slug); + } + + return get(store, it->second); +} + +} // namespace page +} // namespace entities +} // namespace dbal + +#endif diff --git a/dbal/cpp/src/entities/page/index.hpp b/dbal/cpp/src/entities/page/index.hpp index 044d0433c..0250f842a 100644 --- a/dbal/cpp/src/entities/page/index.hpp +++ b/dbal/cpp/src/entities/page/index.hpp @@ -7,6 +7,7 @@ #include "create_page.hpp" #include "get_page.hpp" +#include "get_page_by_slug.hpp" #include "update_page.hpp" #include "delete_page.hpp" #include "list_pages.hpp" diff --git a/docs/permissions-levels.md b/docs/permissions-levels.md index ed6645919..a764f7251 100644 --- a/docs/permissions-levels.md +++ b/docs/permissions-levels.md @@ -28,6 +28,7 @@ Visit `/levels` to step through each tier. The page renders a grid of cards, hig ## Tooling - Run `tsx tools/list-permissions.ts` to dump the level definitions and capabilities into the console. This script ensures workflows or automation agents always align with the same data that powers the UI. +- Run `tsx tools/levels-csv-export.ts` to emit the permission catalog as comma-separated values for spreadsheets and data pipelines. - The CLI at `packages/codegen_studio/static_content/cli/main.cpp --levels` also prints this list so legacy tooling and C++ guardians share the same glossary. ## Testing