diff --git a/admin-api/endpoints/attributes/create-attributes-in-bulk.mdx b/admin-api/endpoints/attributes/create-attributes.mdx similarity index 100% rename from admin-api/endpoints/attributes/create-attributes-in-bulk.mdx rename to admin-api/endpoints/attributes/create-attributes.mdx diff --git a/admin-api/endpoints/attributes/delete-attributes-in-bulk.mdx b/admin-api/endpoints/attributes/delete-attributes.mdx similarity index 100% rename from admin-api/endpoints/attributes/delete-attributes-in-bulk.mdx rename to admin-api/endpoints/attributes/delete-attributes.mdx diff --git a/admin-api/endpoints/attributes/update-attributes-in-bulk.mdx b/admin-api/endpoints/attributes/update-attributes.mdx similarity index 100% rename from admin-api/endpoints/attributes/update-attributes-in-bulk.mdx rename to admin-api/endpoints/attributes/update-attributes.mdx diff --git a/admin-api/endpoints/leaderboards/create-leaderboards-in-bulk.mdx b/admin-api/endpoints/leaderboards/create-leaderboards.mdx similarity index 100% rename from admin-api/endpoints/leaderboards/create-leaderboards-in-bulk.mdx rename to admin-api/endpoints/leaderboards/create-leaderboards.mdx diff --git a/admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk.mdx b/admin-api/endpoints/leaderboards/delete-leaderboards.mdx similarity index 100% rename from admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk.mdx rename to admin-api/endpoints/leaderboards/delete-leaderboards.mdx diff --git a/admin-api/endpoints/leaderboards/update-leaderboards-in-bulk.mdx b/admin-api/endpoints/leaderboards/update-leaderboards.mdx similarity index 100% rename from admin-api/endpoints/leaderboards/update-leaderboards-in-bulk.mdx rename to admin-api/endpoints/leaderboards/update-leaderboards.mdx diff --git a/admin-api/endpoints/metrics/create-metrics-in-bulk.mdx b/admin-api/endpoints/metrics/create-metrics.mdx similarity index 100% rename from admin-api/endpoints/metrics/create-metrics-in-bulk.mdx rename to admin-api/endpoints/metrics/create-metrics.mdx diff --git a/admin-api/endpoints/metrics/delete-metrics-in-bulk.mdx b/admin-api/endpoints/metrics/delete-metrics.mdx similarity index 100% rename from admin-api/endpoints/metrics/delete-metrics-in-bulk.mdx rename to admin-api/endpoints/metrics/delete-metrics.mdx diff --git a/admin-api/endpoints/metrics/get-a-metric-by-id.mdx b/admin-api/endpoints/metrics/get-a-metric.mdx similarity index 87% rename from admin-api/endpoints/metrics/get-a-metric-by-id.mdx rename to admin-api/endpoints/metrics/get-a-metric.mdx index b45a150..69ea5ba 100644 --- a/admin-api/endpoints/metrics/get-a-metric-by-id.mdx +++ b/admin-api/endpoints/metrics/get-a-metric.mdx @@ -1,5 +1,5 @@ --- -title: Get a metric by ID +title: Get a metric openapi: openapi/admin.yml get /metrics/{id} --- diff --git a/admin-api/endpoints/metrics/update-metrics-in-bulk.mdx b/admin-api/endpoints/metrics/update-metrics.mdx similarity index 100% rename from admin-api/endpoints/metrics/update-metrics-in-bulk.mdx rename to admin-api/endpoints/metrics/update-metrics.mdx diff --git a/admin-api/endpoints/points/create-boosts.mdx b/admin-api/endpoints/points/create-boosts.mdx index 0c5be1d..6dc6682 100644 --- a/admin-api/endpoints/points/create-boosts.mdx +++ b/admin-api/endpoints/points/create-boosts.mdx @@ -1,6 +1,6 @@ --- -title: Create points boosts for multiple users -openapi: openapi/admin.yml post /points/boosts +title: Create points boosts +openapi: openapi/admin.yml post /points/{systemId}/boosts --- import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; diff --git a/admin-api/endpoints/points/archive-boosts-batch.mdx b/admin-api/endpoints/points/create-levels.mdx similarity index 60% rename from admin-api/endpoints/points/archive-boosts-batch.mdx rename to admin-api/endpoints/points/create-levels.mdx index 56e7c72..7a0e173 100644 --- a/admin-api/endpoints/points/archive-boosts-batch.mdx +++ b/admin-api/endpoints/points/create-levels.mdx @@ -1,6 +1,6 @@ --- -title: Delete multiple points boosts -openapi: openapi/admin.yml delete /points/boosts +title: Create points levels +openapi: openapi/admin.yml post /points/{systemId}/levels --- import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; diff --git a/admin-api/endpoints/points/create-points-systems.mdx b/admin-api/endpoints/points/create-points-systems.mdx new file mode 100644 index 0000000..e7f7348 --- /dev/null +++ b/admin-api/endpoints/points/create-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Create points systems +openapi: openapi/admin.yml post /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/create-points-triggers.mdx b/admin-api/endpoints/points/create-points-triggers.mdx new file mode 100644 index 0000000..660af30 --- /dev/null +++ b/admin-api/endpoints/points/create-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Create points triggers +openapi: openapi/admin.yml post /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/delete-boosts.mdx b/admin-api/endpoints/points/delete-boosts.mdx new file mode 100644 index 0000000..c0d254e --- /dev/null +++ b/admin-api/endpoints/points/delete-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: Delete points boosts +openapi: openapi/admin.yml delete /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/delete-levels.mdx b/admin-api/endpoints/points/delete-levels.mdx new file mode 100644 index 0000000..97da62a --- /dev/null +++ b/admin-api/endpoints/points/delete-levels.mdx @@ -0,0 +1,10 @@ +--- +title: Delete points levels +openapi: openapi/admin.yml delete /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/delete-points-systems.mdx b/admin-api/endpoints/points/delete-points-systems.mdx new file mode 100644 index 0000000..a863899 --- /dev/null +++ b/admin-api/endpoints/points/delete-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Delete points systems +openapi: openapi/admin.yml delete /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/delete-points-triggers.mdx b/admin-api/endpoints/points/delete-points-triggers.mdx new file mode 100644 index 0000000..0ddcc18 --- /dev/null +++ b/admin-api/endpoints/points/delete-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Delete points triggers +openapi: openapi/admin.yml delete /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/get-a-boost.mdx b/admin-api/endpoints/points/get-a-boost.mdx new file mode 100644 index 0000000..55927d3 --- /dev/null +++ b/admin-api/endpoints/points/get-a-boost.mdx @@ -0,0 +1,10 @@ +--- +title: Get a points boost +openapi: openapi/admin.yml get /points/{systemId}/boosts/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/get-a-level.mdx b/admin-api/endpoints/points/get-a-level.mdx new file mode 100644 index 0000000..04065fc --- /dev/null +++ b/admin-api/endpoints/points/get-a-level.mdx @@ -0,0 +1,10 @@ +--- +title: Get a points level +openapi: openapi/admin.yml get /points/{systemId}/levels/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/get-a-points-system.mdx b/admin-api/endpoints/points/get-a-points-system.mdx new file mode 100644 index 0000000..3d950d2 --- /dev/null +++ b/admin-api/endpoints/points/get-a-points-system.mdx @@ -0,0 +1,10 @@ +--- +title: Get a points system +openapi: openapi/admin.yml get /points/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/get-a-points-trigger.mdx b/admin-api/endpoints/points/get-a-points-trigger.mdx new file mode 100644 index 0000000..39443ad --- /dev/null +++ b/admin-api/endpoints/points/get-a-points-trigger.mdx @@ -0,0 +1,10 @@ +--- +title: Get a points trigger +openapi: openapi/admin.yml get /points/{systemId}/triggers/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/list-boosts.mdx b/admin-api/endpoints/points/list-boosts.mdx new file mode 100644 index 0000000..3528f3d --- /dev/null +++ b/admin-api/endpoints/points/list-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: List points boosts +openapi: openapi/admin.yml get /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/list-levels.mdx b/admin-api/endpoints/points/list-levels.mdx new file mode 100644 index 0000000..16e7819 --- /dev/null +++ b/admin-api/endpoints/points/list-levels.mdx @@ -0,0 +1,10 @@ +--- +title: List points levels +openapi: openapi/admin.yml get /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/list-points-systems.mdx b/admin-api/endpoints/points/list-points-systems.mdx new file mode 100644 index 0000000..ffad792 --- /dev/null +++ b/admin-api/endpoints/points/list-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: List points systems +openapi: openapi/admin.yml get /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/list-points-triggers.mdx b/admin-api/endpoints/points/list-points-triggers.mdx new file mode 100644 index 0000000..36e183c --- /dev/null +++ b/admin-api/endpoints/points/list-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: List points triggers +openapi: openapi/admin.yml get /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/update-boosts.mdx b/admin-api/endpoints/points/update-boosts.mdx new file mode 100644 index 0000000..6b23872 --- /dev/null +++ b/admin-api/endpoints/points/update-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: Update points boosts +openapi: openapi/admin.yml patch /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/update-levels.mdx b/admin-api/endpoints/points/update-levels.mdx new file mode 100644 index 0000000..1fddffa --- /dev/null +++ b/admin-api/endpoints/points/update-levels.mdx @@ -0,0 +1,10 @@ +--- +title: Update points levels +openapi: openapi/admin.yml patch /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/update-points-systems.mdx b/admin-api/endpoints/points/update-points-systems.mdx new file mode 100644 index 0000000..a3b3ceb --- /dev/null +++ b/admin-api/endpoints/points/update-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Update points systems +openapi: openapi/admin.yml patch /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/admin-api/endpoints/points/update-points-triggers.mdx b/admin-api/endpoints/points/update-points-triggers.mdx new file mode 100644 index 0000000..b7b298f --- /dev/null +++ b/admin-api/endpoints/points/update-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Update points triggers +openapi: openapi/admin.yml patch /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Rate Limits** + + diff --git a/docs.json b/docs.json index 92e70ca..635b314 100644 --- a/docs.json +++ b/docs.json @@ -209,10 +209,10 @@ "group": "Metrics", "pages": [ "admin-api/endpoints/metrics/list-metrics", - "admin-api/endpoints/metrics/get-a-metric-by-id", - "admin-api/endpoints/metrics/update-metrics-in-bulk", - "admin-api/endpoints/metrics/create-metrics-in-bulk", - "admin-api/endpoints/metrics/delete-metrics-in-bulk" + "admin-api/endpoints/metrics/get-a-metric", + "admin-api/endpoints/metrics/update-metrics", + "admin-api/endpoints/metrics/create-metrics", + "admin-api/endpoints/metrics/delete-metrics" ] }, { @@ -220,9 +220,9 @@ "pages": [ "admin-api/endpoints/attributes/list-attributes", "admin-api/endpoints/attributes/get-an-attribute", - "admin-api/endpoints/attributes/update-attributes-in-bulk", - "admin-api/endpoints/attributes/create-attributes-in-bulk", - "admin-api/endpoints/attributes/delete-attributes-in-bulk" + "admin-api/endpoints/attributes/update-attributes", + "admin-api/endpoints/attributes/create-attributes", + "admin-api/endpoints/attributes/delete-attributes" ] }, { @@ -235,8 +235,26 @@ { "group": "Points", "pages": [ + "admin-api/endpoints/points/list-points-systems", + "admin-api/endpoints/points/get-a-points-system", + "admin-api/endpoints/points/update-points-systems", + "admin-api/endpoints/points/create-points-systems", + "admin-api/endpoints/points/delete-points-systems", + "admin-api/endpoints/points/list-points-triggers", + "admin-api/endpoints/points/get-a-points-trigger", + "admin-api/endpoints/points/update-points-triggers", + "admin-api/endpoints/points/create-points-triggers", + "admin-api/endpoints/points/delete-points-triggers", + "admin-api/endpoints/points/list-levels", + "admin-api/endpoints/points/get-a-level", + "admin-api/endpoints/points/update-levels", + "admin-api/endpoints/points/create-levels", + "admin-api/endpoints/points/delete-levels", + "admin-api/endpoints/points/list-boosts", + "admin-api/endpoints/points/get-a-boost", + "admin-api/endpoints/points/update-boosts", "admin-api/endpoints/points/create-boosts", - "admin-api/endpoints/points/archive-boosts-batch" + "admin-api/endpoints/points/delete-boosts" ] }, { @@ -244,9 +262,9 @@ "pages": [ "admin-api/endpoints/leaderboards/list-leaderboards", "admin-api/endpoints/leaderboards/get-a-leaderboard", - "admin-api/endpoints/leaderboards/update-leaderboards-in-bulk", - "admin-api/endpoints/leaderboards/create-leaderboards-in-bulk", - "admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk" + "admin-api/endpoints/leaderboards/update-leaderboards", + "admin-api/endpoints/leaderboards/create-leaderboards", + "admin-api/endpoints/leaderboards/delete-leaderboards" ] } ] @@ -492,17 +510,20 @@ { "group": "Resumen", "pages": [ - "es/admin-api/introduction" + "es/admin-api/introduction", + "es/admin-api/authentication", + "es/admin-api/rate-limiting", + "es/admin-api/client-libraries" ] }, { "group": "Métricas", "pages": [ "es/admin-api/endpoints/metrics/list-metrics", - "es/admin-api/endpoints/metrics/get-a-metric-by-id", - "es/admin-api/endpoints/metrics/update-metrics-in-bulk", - "es/admin-api/endpoints/metrics/create-metrics-in-bulk", - "es/admin-api/endpoints/metrics/delete-metrics-in-bulk" + "es/admin-api/endpoints/metrics/get-a-metric", + "es/admin-api/endpoints/metrics/update-metrics", + "es/admin-api/endpoints/metrics/create-metrics", + "es/admin-api/endpoints/metrics/delete-metrics" ] }, { @@ -510,9 +531,9 @@ "pages": [ "es/admin-api/endpoints/attributes/list-attributes", "es/admin-api/endpoints/attributes/get-an-attribute", - "es/admin-api/endpoints/attributes/update-attributes-in-bulk", - "es/admin-api/endpoints/attributes/create-attributes-in-bulk", - "es/admin-api/endpoints/attributes/delete-attributes-in-bulk" + "es/admin-api/endpoints/attributes/update-attributes", + "es/admin-api/endpoints/attributes/create-attributes", + "es/admin-api/endpoints/attributes/delete-attributes" ] }, { @@ -525,8 +546,26 @@ { "group": "Puntos", "pages": [ + "es/admin-api/endpoints/points/list-points-systems", + "es/admin-api/endpoints/points/get-a-points-system", + "es/admin-api/endpoints/points/update-points-systems", + "es/admin-api/endpoints/points/create-points-systems", + "es/admin-api/endpoints/points/delete-points-systems", + "es/admin-api/endpoints/points/list-points-triggers", + "es/admin-api/endpoints/points/get-a-points-trigger", + "es/admin-api/endpoints/points/update-points-triggers", + "es/admin-api/endpoints/points/create-points-triggers", + "es/admin-api/endpoints/points/delete-points-triggers", + "es/admin-api/endpoints/points/list-levels", + "es/admin-api/endpoints/points/get-a-level", + "es/admin-api/endpoints/points/update-levels", + "es/admin-api/endpoints/points/create-levels", + "es/admin-api/endpoints/points/delete-levels", + "es/admin-api/endpoints/points/list-boosts", + "es/admin-api/endpoints/points/get-a-boost", + "es/admin-api/endpoints/points/update-boosts", "es/admin-api/endpoints/points/create-boosts", - "es/admin-api/endpoints/points/archive-boosts-batch" + "es/admin-api/endpoints/points/delete-boosts" ] }, { @@ -534,9 +573,9 @@ "pages": [ "es/admin-api/endpoints/leaderboards/list-leaderboards", "es/admin-api/endpoints/leaderboards/get-a-leaderboard", - "es/admin-api/endpoints/leaderboards/update-leaderboards-in-bulk", - "es/admin-api/endpoints/leaderboards/create-leaderboards-in-bulk", - "es/admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk" + "es/admin-api/endpoints/leaderboards/update-leaderboards", + "es/admin-api/endpoints/leaderboards/create-leaderboards", + "es/admin-api/endpoints/leaderboards/delete-leaderboards" ] } ] diff --git a/es/admin-api/authentication.mdx b/es/admin-api/authentication.mdx index e07c0e0..e8b3708 100644 --- a/es/admin-api/authentication.mdx +++ b/es/admin-api/authentication.mdx @@ -13,4 +13,4 @@ La API de administración de Trophy se autentica utilizando las mismas claves AP ## Obtener soporte {#get-support} -¿Desea ponerse en contacto con el equipo de Trophy? Comuníquese con nosotros por [correo electrónico](mailto:support@trophy.so). ¡Estamos aquí para ayudarle! +¿Quiere ponerse en contacto con el equipo de Trophy? Contáctenos por [correo electrónico](mailto:support@trophy.so). ¡Estamos aquí para ayudar! diff --git a/es/admin-api/endpoints/attributes/create-attributes-in-bulk.mdx b/es/admin-api/endpoints/attributes/create-attributes.mdx similarity index 100% rename from es/admin-api/endpoints/attributes/create-attributes-in-bulk.mdx rename to es/admin-api/endpoints/attributes/create-attributes.mdx diff --git a/es/admin-api/endpoints/attributes/delete-attributes-in-bulk.mdx b/es/admin-api/endpoints/attributes/delete-attributes.mdx similarity index 100% rename from es/admin-api/endpoints/attributes/delete-attributes-in-bulk.mdx rename to es/admin-api/endpoints/attributes/delete-attributes.mdx diff --git a/es/admin-api/endpoints/attributes/update-attributes-in-bulk.mdx b/es/admin-api/endpoints/attributes/update-attributes.mdx similarity index 100% rename from es/admin-api/endpoints/attributes/update-attributes-in-bulk.mdx rename to es/admin-api/endpoints/attributes/update-attributes.mdx diff --git a/es/admin-api/endpoints/leaderboards/create-leaderboards-in-bulk.mdx b/es/admin-api/endpoints/leaderboards/create-leaderboards.mdx similarity index 100% rename from es/admin-api/endpoints/leaderboards/create-leaderboards-in-bulk.mdx rename to es/admin-api/endpoints/leaderboards/create-leaderboards.mdx diff --git a/es/admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk.mdx b/es/admin-api/endpoints/leaderboards/delete-leaderboards.mdx similarity index 100% rename from es/admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk.mdx rename to es/admin-api/endpoints/leaderboards/delete-leaderboards.mdx diff --git a/es/admin-api/endpoints/leaderboards/update-leaderboards-in-bulk.mdx b/es/admin-api/endpoints/leaderboards/update-leaderboards.mdx similarity index 100% rename from es/admin-api/endpoints/leaderboards/update-leaderboards-in-bulk.mdx rename to es/admin-api/endpoints/leaderboards/update-leaderboards.mdx diff --git a/es/admin-api/endpoints/metrics/create-metrics-in-bulk.mdx b/es/admin-api/endpoints/metrics/create-metrics.mdx similarity index 100% rename from es/admin-api/endpoints/metrics/create-metrics-in-bulk.mdx rename to es/admin-api/endpoints/metrics/create-metrics.mdx diff --git a/es/admin-api/endpoints/metrics/delete-metrics-in-bulk.mdx b/es/admin-api/endpoints/metrics/delete-metrics.mdx similarity index 100% rename from es/admin-api/endpoints/metrics/delete-metrics-in-bulk.mdx rename to es/admin-api/endpoints/metrics/delete-metrics.mdx diff --git a/es/admin-api/endpoints/metrics/get-a-metric-by-id.mdx b/es/admin-api/endpoints/metrics/get-a-metric.mdx similarity index 84% rename from es/admin-api/endpoints/metrics/get-a-metric-by-id.mdx rename to es/admin-api/endpoints/metrics/get-a-metric.mdx index c7fd1fb..2374f8c 100644 --- a/es/admin-api/endpoints/metrics/get-a-metric-by-id.mdx +++ b/es/admin-api/endpoints/metrics/get-a-metric.mdx @@ -1,5 +1,5 @@ --- -title: Obtener una métrica por ID +title: Obtener una métrica openapi: openapi/admin.yml get /metrics/{id} --- diff --git a/es/admin-api/endpoints/metrics/update-metrics-in-bulk.mdx b/es/admin-api/endpoints/metrics/update-metrics.mdx similarity index 100% rename from es/admin-api/endpoints/metrics/update-metrics-in-bulk.mdx rename to es/admin-api/endpoints/metrics/update-metrics.mdx diff --git a/es/admin-api/endpoints/points/create-boosts.mdx b/es/admin-api/endpoints/points/create-boosts.mdx index 8fd9b2d..399ce87 100644 --- a/es/admin-api/endpoints/points/create-boosts.mdx +++ b/es/admin-api/endpoints/points/create-boosts.mdx @@ -1,6 +1,6 @@ --- -title: Crear aumentos de puntos para múltiples usuarios -openapi: openapi/admin.yml post /points/boosts +title: Crear impulsos de puntos +openapi: openapi/admin.yml post /points/{systemId}/boosts --- import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; diff --git a/es/admin-api/endpoints/points/archive-boosts-batch.mdx b/es/admin-api/endpoints/points/create-levels.mdx similarity index 59% rename from es/admin-api/endpoints/points/archive-boosts-batch.mdx rename to es/admin-api/endpoints/points/create-levels.mdx index b366d46..73fd619 100644 --- a/es/admin-api/endpoints/points/archive-boosts-batch.mdx +++ b/es/admin-api/endpoints/points/create-levels.mdx @@ -1,6 +1,6 @@ --- -title: Eliminar múltiples impulsos de puntos -openapi: openapi/admin.yml delete /points/boosts +title: Crear niveles de puntos +openapi: openapi/admin.yml post /points/{systemId}/levels --- import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; diff --git a/es/admin-api/endpoints/points/create-points-systems.mdx b/es/admin-api/endpoints/points/create-points-systems.mdx new file mode 100644 index 0000000..4e5e86d --- /dev/null +++ b/es/admin-api/endpoints/points/create-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Crear sistemas de puntos +openapi: openapi/admin.yml post /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/create-points-triggers.mdx b/es/admin-api/endpoints/points/create-points-triggers.mdx new file mode 100644 index 0000000..b0128a9 --- /dev/null +++ b/es/admin-api/endpoints/points/create-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Crear activadores de puntos +openapi: openapi/admin.yml post /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/delete-boosts.mdx b/es/admin-api/endpoints/points/delete-boosts.mdx new file mode 100644 index 0000000..3748583 --- /dev/null +++ b/es/admin-api/endpoints/points/delete-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: Eliminar impulsos de puntos +openapi: openapi/admin.yml delete /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/delete-levels.mdx b/es/admin-api/endpoints/points/delete-levels.mdx new file mode 100644 index 0000000..a11ff02 --- /dev/null +++ b/es/admin-api/endpoints/points/delete-levels.mdx @@ -0,0 +1,10 @@ +--- +title: Eliminar niveles de puntos +openapi: openapi/admin.yml delete /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/delete-points-systems.mdx b/es/admin-api/endpoints/points/delete-points-systems.mdx new file mode 100644 index 0000000..ca27c5c --- /dev/null +++ b/es/admin-api/endpoints/points/delete-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Eliminar sistemas de puntos +openapi: openapi/admin.yml delete /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/delete-points-triggers.mdx b/es/admin-api/endpoints/points/delete-points-triggers.mdx new file mode 100644 index 0000000..b6829f1 --- /dev/null +++ b/es/admin-api/endpoints/points/delete-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Eliminar activadores de puntos +openapi: openapi/admin.yml delete /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/get-a-boost.mdx b/es/admin-api/endpoints/points/get-a-boost.mdx new file mode 100644 index 0000000..87897b4 --- /dev/null +++ b/es/admin-api/endpoints/points/get-a-boost.mdx @@ -0,0 +1,10 @@ +--- +title: Obtener un impulso de puntos +openapi: openapi/admin.yml get /points/{systemId}/boosts/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/get-a-level.mdx b/es/admin-api/endpoints/points/get-a-level.mdx new file mode 100644 index 0000000..eda6ae1 --- /dev/null +++ b/es/admin-api/endpoints/points/get-a-level.mdx @@ -0,0 +1,10 @@ +--- +title: Obtener un nivel de puntos +openapi: openapi/admin.yml get /points/{systemId}/levels/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/get-a-points-system.mdx b/es/admin-api/endpoints/points/get-a-points-system.mdx new file mode 100644 index 0000000..180c671 --- /dev/null +++ b/es/admin-api/endpoints/points/get-a-points-system.mdx @@ -0,0 +1,10 @@ +--- +title: Obtener un sistema de puntos +openapi: openapi/admin.yml get /points/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/get-a-points-trigger.mdx b/es/admin-api/endpoints/points/get-a-points-trigger.mdx new file mode 100644 index 0000000..3ed3459 --- /dev/null +++ b/es/admin-api/endpoints/points/get-a-points-trigger.mdx @@ -0,0 +1,10 @@ +--- +title: Obtener un activador de puntos +openapi: openapi/admin.yml get /points/{systemId}/triggers/{id} +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/list-boosts.mdx b/es/admin-api/endpoints/points/list-boosts.mdx new file mode 100644 index 0000000..9e75be7 --- /dev/null +++ b/es/admin-api/endpoints/points/list-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: Listar impulsos de puntos +openapi: openapi/admin.yml get /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/list-levels.mdx b/es/admin-api/endpoints/points/list-levels.mdx new file mode 100644 index 0000000..381406b --- /dev/null +++ b/es/admin-api/endpoints/points/list-levels.mdx @@ -0,0 +1,10 @@ +--- +title: Listar niveles de puntos +openapi: openapi/admin.yml get /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/list-points-systems.mdx b/es/admin-api/endpoints/points/list-points-systems.mdx new file mode 100644 index 0000000..9fec82f --- /dev/null +++ b/es/admin-api/endpoints/points/list-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Listar sistemas de puntos +openapi: openapi/admin.yml get /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/list-points-triggers.mdx b/es/admin-api/endpoints/points/list-points-triggers.mdx new file mode 100644 index 0000000..9424992 --- /dev/null +++ b/es/admin-api/endpoints/points/list-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Enumerar activadores de puntos +openapi: openapi/admin.yml get /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/update-boosts.mdx b/es/admin-api/endpoints/points/update-boosts.mdx new file mode 100644 index 0000000..672f3e0 --- /dev/null +++ b/es/admin-api/endpoints/points/update-boosts.mdx @@ -0,0 +1,10 @@ +--- +title: Actualizar impulsos de puntos +openapi: openapi/admin.yml patch /points/{systemId}/boosts +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/update-levels.mdx b/es/admin-api/endpoints/points/update-levels.mdx new file mode 100644 index 0000000..1069555 --- /dev/null +++ b/es/admin-api/endpoints/points/update-levels.mdx @@ -0,0 +1,10 @@ +--- +title: Actualizar niveles de puntos +openapi: openapi/admin.yml patch /points/{systemId}/levels +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/update-points-systems.mdx b/es/admin-api/endpoints/points/update-points-systems.mdx new file mode 100644 index 0000000..f105f33 --- /dev/null +++ b/es/admin-api/endpoints/points/update-points-systems.mdx @@ -0,0 +1,10 @@ +--- +title: Actualizar sistemas de puntos +openapi: openapi/admin.yml patch /points +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/es/admin-api/endpoints/points/update-points-triggers.mdx b/es/admin-api/endpoints/points/update-points-triggers.mdx new file mode 100644 index 0000000..dd4d8dc --- /dev/null +++ b/es/admin-api/endpoints/points/update-points-triggers.mdx @@ -0,0 +1,10 @@ +--- +title: Actualizar activadores de puntos +openapi: openapi/admin.yml patch /points/{systemId}/triggers +--- + +import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx"; + +**Límites de velocidad** + + diff --git a/i18n.lock b/i18n.lock index 129173d..3b62393 100644 --- a/i18n.lock +++ b/i18n.lock @@ -99,8 +99,8 @@ checksums: content/1: 264d832bc605beaf5168c080bfed567c content/2: 580af53aa9812f2ec29a632e145669a5 d7a5a41699c1f35f60e64aa9a0c63c18: - meta/title: ef1c4a61be3dc61b6e50421fbf8c1050 - meta/openapi: c8d32f24d25cd3ab9da5ba5d8da11f24 + meta/title: 5d1964f5349a4ec6803a31e79fa564a8 + meta/openapi: 68aa681121ca384929d32ffd170cbfa7 content/0: c3d96e3528a55b20b8fbcae10af25b02 content/1: 264d832bc605beaf5168c080bfed567c content/2: 580af53aa9812f2ec29a632e145669a5 @@ -2468,3 +2468,177 @@ checksums: content/0: 040377b8c13a0665ffb600ee52933821 content/1: 10e8e9a59847ddd720c6d06b12c7b120 content/2: 9799b973234bf2d10d5c971b267f55a5 + 97859f5bb2185be6f36d8a74e9df13c8: + meta/title: ef90b945952a5cb349ab6dbf8566daef + meta/openapi: 9021a65626a3dac704db13ab44ca81bb + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 29efb43442016ac59ae80f67919ede9f: + meta/title: 7b85aa2103a928adc4fceff0a4c2a80a + meta/openapi: 080e48e9216428f9dff3257d8bef0488 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 91b2410e9698080df3b673224d599d05: + meta/title: 92e7559e853b831f24b6319b39c2ee79 + meta/openapi: 4c238e5f0e31e98570022d32cfe0d594 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + be76873e659f49949770ea72f3a16280: + meta/title: 77da41f14cf407a0009184fd1c5b86c3 + meta/openapi: a9dd21baec1e5e23fed0c74b4b0ee604 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 65adec3bdb35ecfd4e46e329621cfabd: + meta/title: 0ae71171d791e8ea326294f8944eccb2 + meta/openapi: 26b124f55426cdfb2d22abeb46c16278 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 1b2cc4afd239ffe102383662f5b10a1b: + meta/title: 1159637927d40f78c7fb66fcc162e9b9 + meta/openapi: 906420c08c6adcd7a18568f9536a28b0 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 30b3c11681b2ee292b8e6c45ff7ba784: + meta/title: 44e48fe9cc63b92a7dea7851bfe1df16 + meta/openapi: f30ce0c076b659fdb1c008c5ba20bb96 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + f2ef08520b2266e9bf792cbc6d241b24: + meta/title: 783f12a119eff5bdefd894f5293c6dd9 + meta/openapi: 71d48f6d015949fbfece730be729df4c + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 96adeaebcbae7c9242db981d4ede6b6c: + meta/title: ac5ec465de2d3f7bec0b4e3d2012e1dd + meta/openapi: b0f6aa39ad7535a81bdc82812e2eed0d + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 4470385dcedca280d50674260229e15d: + meta/title: 522bc45fed672789d7b3bfeee6163593 + meta/openapi: 69d24ab8d7fff892c829d05de46fe762 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 85d6dd97cfe88789211219dbe52fdaa8: + meta/title: 077e825e28be3a370c0b91212d3f7582 + meta/openapi: 34e4b2aeea66dc87bca721838131ed2b + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 77642b6ca0c8daa078d7f7657bd84a6c: + meta/title: ec43e4ae810a13e475ebeff4bec87699 + meta/openapi: e6134d2de1e741ef2fe6635accf181d9 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 2b5f80611b71f7981abc3e385b9bb109: + meta/title: 7c02ff18ab040f2f9e1db71bc37d8454 + meta/openapi: c2cd4aff1756acb2de15fef196b027ff + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 4b044ec7f4631180c0ea6bab1da7ce60: + meta/title: c6a7153fec10819d4bd1b17d04d58281 + meta/openapi: 51c08b1df6eac56e323f8044421700a6 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 89e7a0bcc1e75b04f6ae867076541ed0: + meta/title: 51b0572d984db8105e1ca29ddcc1bfc7 + meta/openapi: 0430bfeb31db4b5d4b0539b7481d90b4 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 5d1246f2e0518bb128583f2994caf7dc: + meta/title: 3964d2d3b5b29ce127abd9ef85f677ef + meta/openapi: c158979b832f3c41c2f18f74c5adf9b1 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 6297fe022dcb50488b3055507d944f41: + meta/title: 371046575fa5273cb8908e5845adfd32 + meta/openapi: efdc23812d31ee7f93c450586542c9b6 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + e74bcad10052dfc41f711941e656722c: + meta/title: e47f141e3b4306ddff1f1ecf0c80d60f + meta/openapi: 1a7700afc335bd788e672850b747db7e + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 43fc4a4f546c64b243ebd90f27669952: + meta/title: 0afce08805b9a2ed3210885d76d5f1de + meta/openapi: 9a967ed3a16f15b3e8be391bfd24a548 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 1b99eb2902712a22b19faec6b927eec8: + meta/title: 669c6d01568dd3696cc498a4855215ba + meta/openapi: 99e0d6d87387f6041787acdd8ae51de3 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 3478d4a7140da735fa543af38c2792a3: + meta/title: f5a8f0407ccca7f3ce6c428e75d75b46 + meta/openapi: 7880de8e2e8cffbaa12e1eeee9f9b51f + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 6814113b7741ccdd8f8a4cf67b1cb4f4: + meta/title: 9c17e73f61e524cf01cd7f2ebca1d44e + meta/openapi: 279272e31c378e0e1ad3fcf2ec3719e5 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + eee2f54eb09fd6bda9b6d3dfa54b8a0f: + meta/title: e6ae37fdb654ceee2b3a117eb7c842de + meta/openapi: b8be974fe52e440f44353ec2f644e592 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 4b3365fa23e12e35a6a1dd3f46876a36: + meta/title: 61cb6ce29db12b4ae089ee1d3dc5105c + meta/openapi: 0b17eecbf95061949e899172e019dea8 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 37ce94007ca3f924bbf598622a2ca10d: + meta/title: f6bf68d90e9259bc31f50f58138bf7ac + meta/openapi: 4240d485cb1f524a6217d7391d0c9237 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 57849eb427e99b4f049a1107ee742140: + meta/title: 49aec54064857697ee99689416246ef4 + meta/openapi: 5275025ba95658b12a6857f2db60c276 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + f6e5b614ca9edc83a3972896aba4c57d: + meta/title: b23e003651086899d1e6e690f2ce174b + meta/openapi: 45178ab3e65344c237300b2e7896750f + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + 72d450039b1bcbec10b13a37ecc1a768: + meta/title: ceefd20adbc02ddd5df34946bd40daae + meta/openapi: 9a9164e0249a7d41178ef81447a1ad6f + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 + b100c3d5d61f781472de3ef2cf5e934c: + meta/title: b3206281739d46df5dabdca66b0a9ef8 + meta/openapi: be2641c79450da5e5c00a16d931356e5 + content/0: c3d96e3528a55b20b8fbcae10af25b02 + content/1: 264d832bc605beaf5168c080bfed567c + content/2: 580af53aa9812f2ec29a632e145669a5 diff --git a/openapi/admin.yml b/openapi/admin.yml index e09cf67..0e5fc2e 100644 --- a/openapi/admin.yml +++ b/openapi/admin.yml @@ -999,18 +999,104 @@ paths: security: - ApiKeyAuth: [] - /points/boosts: + /points: servers: - url: https://admin.trophy.so/v1 description: Admin API + get: + description: List points systems. + operationId: admin_points_systems_list + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - systems + x-fern-sdk-method-name: list + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const systems = await trophy.admin.points.systems.list({ + limit: 10, + skip: 0 + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + systems = client.admin.points.systems.list( + limit=10, + skip=0 + ) + parameters: + - name: limit + in: query + description: Number of records to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + example: 10 + - name: skip + in: query + description: Number of records to skip from the start of the list. + required: false + schema: + type: integer + minimum: 0 + default: 0 + example: 0 + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ListPointsSystemsResponse' + examples: + Systems list: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: XP + key: xp + description: Experience points + status: active + badge: null + maxPoints: null + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: List points systems + security: + - ApiKeyAuth: [] post: - description: Create points boosts for multiple users. - operationId: admin_points_boosts_create + description: Create points systems. Optionally include sub-entities (levels, boosts, triggers) in each system payload to create them alongside the system. + operationId: admin_points_systems_create x-fern-server-name: admin x-fern-sdk-group-name: - admin - points - - boosts + - systems x-fern-sdk-method-name: create tags: - Admin @@ -1023,135 +1109,182 @@ paths: apiKey: 'YOUR_API_KEY' }); - const response = await trophy.admin.points.boosts.create({ - systemKey: 'xp', - boosts: [ - { - userId: 'user-123', - name: 'Double XP Weekend', - start: '2024-01-01', - end: '2024-01-03', - multiplier: 2 - }, - { - userId: 'user-456', - name: 'Holiday Bonus', - start: '2024-12-25', - multiplier: 1.5, - rounding: 'up' - } - ] - }); + const result = await trophy.admin.points.systems.create([ + { + name: 'XP', + key: 'xp', + description: 'Experience points', + levels: [ + { name: 'Bronze', key: 'bronze', points: 100 }, + { name: 'Silver', key: 'silver', points: 500 } + ] + } + ]); - lang: python source: | from trophy import TrophyApi client = TrophyApi(api_key='YOUR_API_KEY') - response = client.admin.points.boosts.create({ - "systemKey": "xp", - "boosts": [ - { - "userId": "user-123", - "name": "Double XP Weekend", - "start": "2024-01-01", - "end": "2024-01-03", - "multiplier": 2 - }, - { - "userId": "user-456", - "name": "Holiday Bonus", - "start": "2024-12-25", - "multiplier": 1.5, - "rounding": "up" - } - ] - }) + result = client.admin.points.systems.create( + request=[{ + "name": "XP", + "key": "xp", + "description": "Experience points", + "levels": [ + {"name": "Bronze", "key": "bronze", "points": 100}, + {"name": "Silver", "key": "silver", "points": 500} + ] + }] + ) requestBody: - description: The points system key and array of boosts to create + description: Array of points systems to create. Maximum 100 systems per request. required: true content: application/json: schema: - $ref: '#/components/schemas/CreatePointsBoostsRequest' + $ref: '#/components/schemas/CreatePointsSystemsRequest' examples: - Create boosts for multiple users: + Create a system with levels: value: - systemKey: xp - boosts: - - userId: user-123 - name: Double XP Weekend - start: '2024-01-01' - end: '2024-01-03' - multiplier: 2 - - userId: user-456 - name: Holiday Bonus - start: '2024-12-25' - multiplier: 1.5 - rounding: up + - name: XP + key: xp + description: Experience points + levels: + - name: Bronze + key: bronze + points: 100 + - name: Silver + key: silver + points: 500 responses: '200': - description: Successful operation (no boosts created) + description: Successful operation (no systems created) content: application/json: schema: - $ref: '#/components/schemas/CreatePointsBoostsResponse' + $ref: '#/components/schemas/CreatePointsSystemsResponse' examples: All requests had errors: value: created: [] issues: - - userId: non-existent-user + - index: 0 severity: error - message: User does not exist + message: name must be a string '201': - description: Created (at least one boost created) + description: Created (at least one system created) content: application/json: schema: - $ref: '#/components/schemas/CreatePointsBoostsResponse' + $ref: '#/components/schemas/CreatePointsSystemsResponse' examples: Success with no issues: value: created: - id: '550e8400-e29b-41d4-a716-446655440000' - name: Double XP Weekend + name: XP + key: xp + description: Experience points status: active - start: '2024-01-01' - end: '2024-01-03' - multiplier: 2 - rounding: down - userId: user-123 + badge: null + maxPoints: null + levels: + - id: '550e8400-e29b-41d4-a716-446655440001' + name: Bronze + key: bronze + points: 100 + description: '' + badge: null issues: [] - Mixed success and errors: - value: - created: - - id: '550e8400-e29b-41d4-a716-446655440001' - name: Valid Boost - status: active - start: '2024-01-15' - end: null - multiplier: 1.5 - rounding: down - userId: user-456 - issues: - - userId: non-existent-user - severity: error - message: User does not exist - '400': - description: 'Bad Request' + '401': + description: 'Unauthorized' content: application/json: schema: $ref: '#/components/schemas/ErrorBody' - '401': - description: 'Unauthorized' + '422': + description: 'Unprocessible Entity' content: application/json: schema: $ref: '#/components/schemas/ErrorBody' - '404': - description: 'Not Found (points system not found)' + summary: Create points systems + security: + - ApiKeyAuth: [] + patch: + description: Update points systems by ID. + operationId: admin_points_systems_update + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - systems + x-fern-sdk-method-name: update + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.systems.update([ + { + id: 'system-uuid', + name: 'New Name', + description: 'Updated description' + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.systems.update( + request=[{ + "id": "system-uuid", + "name": "New Name", + "description": "Updated description" + }] + ) + requestBody: + description: Array of points system updates. Maximum 100 systems per request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePointsSystemsRequest' + examples: + Update a system name: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: New Name + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UpdatePointsSystemsResponse' + examples: + Success: + value: + updated: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: New Name + key: xp + description: '' + status: active + badge: null + maxPoints: null + issues: [] + '401': + description: 'Unauthorized' content: application/json: schema: @@ -1162,17 +1295,17 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorBody' - summary: Create points boosts for multiple users + summary: Update points systems security: - ApiKeyAuth: [] delete: - description: Delete multiple points boosts by ID. - operationId: admin_points_boosts_delete + description: Delete (archive) points systems by ID. + operationId: admin_points_systems_delete x-fern-server-name: admin x-fern-sdk-group-name: - admin - points - - boosts + - systems x-fern-sdk-method-name: delete tags: - Admin @@ -1185,91 +1318,72 @@ paths: apiKey: 'YOUR_API_KEY' }); - const response = await trophy.admin.points.boosts.delete({ - ids: ['boost-uuid-1', 'boost-uuid-2', 'boost-uuid-3'] + const result = await trophy.admin.points.systems.delete({ + ids: ['system-uuid-1', 'system-uuid-2'] }); - - console.log(`Deleted ${response.deleted.length} boosts`); - lang: python source: | from trophy import TrophyApi client = TrophyApi(api_key='YOUR_API_KEY') - response = client.admin.points.boosts.delete( - ids=['boost-uuid-1', 'boost-uuid-2', 'boost-uuid-3'] + result = client.admin.points.systems.delete( + ids=['system-uuid-1', 'system-uuid-2'] ) - - print(f"Deleted {len(response.deleted)} boosts") parameters: - name: ids in: query - description: A list of up to 100 boost IDs. + description: The IDs of the points systems to delete. required: true schema: type: array items: type: string - minItems: 1 - maxItems: 100 - example: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,b1ffcd00-0d1c-4ef9-cc7e-7cc0ce491b22' + format: uuid + example: + - 550e8400-e29b-41d4-a716-446655440000 responses: '200': description: Successful operation content: application/json: schema: - $ref: '#/components/schemas/DeletePointsBoostsResponse' + $ref: '#/components/schemas/DeletePointsSystemsResponse' examples: - All boosts deleted: + Success: value: deleted: - id: '550e8400-e29b-41d4-a716-446655440000' - - id: '550e8400-e29b-41d4-a716-446655440001' - - id: '550e8400-e29b-41d4-a716-446655440002' issues: [] - Some boosts not found: - value: - deleted: - - id: '550e8400-e29b-41d4-a716-446655440000' - issues: - - boostId: '550e8400-e29b-41d4-a716-446655440001' - severity: warning - message: Points boost not found - No boosts found: - value: - deleted: [] - issues: - - boostId: '550e8400-e29b-41d4-a716-446655440999' - severity: warning - message: Points boost not found - '400': - description: 'Bad Request (no IDs provided or invalid UUID format)' + '401': + description: 'Unauthorized' content: application/json: schema: $ref: '#/components/schemas/ErrorBody' - '401': - description: 'Unauthorized' + '422': + description: 'Unprocessible Entity' content: application/json: schema: $ref: '#/components/schemas/ErrorBody' - summary: Delete multiple points boosts + summary: Delete points systems security: - ApiKeyAuth: [] - /leaderboards: + + /points/{id}: servers: - url: https://admin.trophy.so/v1 description: Admin API get: - description: List leaderboards. - operationId: admin_leaderboards_list + description: Get a points system by ID. + operationId: admin_points_systems_get x-fern-server-name: admin x-fern-sdk-group-name: - admin - - leaderboards - x-fern-sdk-method-name: list + - points + - systems + x-fern-sdk-method-name: get tags: - Admin x-codeSamples: @@ -1281,29 +1395,1699 @@ paths: apiKey: 'YOUR_API_KEY' }); - const leaderboards = await trophy.admin.leaderboards.list({ - limit: 10, - skip: 0 - }); + const system = await trophy.admin.points.systems.get('system-uuid'); - lang: python source: | from trophy import TrophyApi client = TrophyApi(api_key='YOUR_API_KEY') - leaderboards = client.admin.leaderboards.list( - limit=10, - skip=0 - ) + system = client.admin.points.systems.get(id='system-uuid') parameters: - - name: limit - in: query - description: Number of records to return. - required: false + - name: id + in: path + required: true schema: - type: integer - minimum: 1 - maximum: 100 + type: string + format: uuid + description: The ID of the points system. + example: 550e8400-e29b-41d4-a716-446655440000 + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPointsSystem' + examples: + Points system: + value: + id: '550e8400-e29b-41d4-a716-446655440000' + name: XP + key: xp + description: Experience points + status: active + badge: null + maxPoints: null + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Get a points system by ID + security: + - ApiKeyAuth: [] + + /points/{systemId}/boosts: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: List points boosts for a system. + operationId: admin_points_boosts_list + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - boosts + x-fern-sdk-method-name: list + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const boosts = await trophy.admin.points.boosts.list('system-uuid', { + limit: 10, + skip: 0 + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + boosts = client.admin.points.boosts.list( + system_id='system-uuid', + limit=10, + skip=0 + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: limit + in: query + description: Maximum number of results to return (1-100, default 10). + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + - name: skip + in: query + description: Number of results to skip for pagination (default 0). + required: false + schema: + type: integer + minimum: 0 + default: 0 + responses: + '200': + description: A paginated list of points boosts. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPointsBoostsResponse' + examples: + Boosts list: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Double XP Weekend + status: active + start: '2024-01-01' + end: '2024-01-03' + multiplier: 2 + rounding: down + userId: user-123 + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: List points boosts + security: + - ApiKeyAuth: [] + post: + description: Create points boosts. + operationId: admin_points_boosts_create + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - boosts + x-fern-sdk-method-name: create + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const response = await trophy.admin.points.boosts.create('system-uuid', [ + { + userId: 'user-123', + name: 'Double XP Weekend', + start: '2024-01-01', + end: '2024-01-03', + multiplier: 2 + }, + { + name: 'Global Holiday Bonus', + start: '2024-12-25', + multiplier: 1.5, + rounding: 'up' + }, + { + name: 'Premium User Boost', + start: '2024-01-01', + multiplier: 2, + userAttributes: [ + { attributeId: 'attr-uuid', attributeValue: 'premium' } + ] + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + response = client.admin.points.boosts.create( + system_id='system-uuid', + boosts=[ + { + "userId": "user-123", + "name": "Double XP Weekend", + "start": "2024-01-01", + "end": "2024-01-03", + "multiplier": 2 + }, + { + "name": "Global Holiday Bonus", + "start": "2024-12-25", + "multiplier": 1.5, + "rounding": "up" + }, + { + "name": "Premium User Boost", + "start": "2024-01-01", + "multiplier": 2, + "userAttributes": [ + {"attributeId": "attr-uuid", "attributeValue": "premium"} + ] + } + ] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + description: Array of boosts to create. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsBoostsRequest' + examples: + Create user-specific boost: + value: + - userId: user-123 + name: Double XP Weekend + start: '2024-01-01' + end: '2024-01-03' + multiplier: 2 + Create global boost: + value: + - name: Global Holiday Bonus + start: '2024-12-25' + multiplier: 1.5 + rounding: up + Create boost with user attributes: + value: + - name: Premium User Boost + start: '2024-01-01' + multiplier: 2 + userAttributes: + - attributeId: '550e8400-e29b-41d4-a716-446655440000' + attributeValue: premium + responses: + '200': + description: Successful operation (no boosts created) + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsBoostsResponse' + examples: + All requests had errors: + value: + created: [] + issues: + - index: 0 + severity: error + message: User does not exist + '201': + description: Created (at least one boost created) + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsBoostsResponse' + examples: + Success with no issues: + value: + created: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Double XP Weekend + status: active + start: '2024-01-01' + end: '2024-01-03' + multiplier: 2 + rounding: down + userId: user-123 + issues: [] + Global boost created: + value: + created: + - id: '550e8400-e29b-41d4-a716-446655440001' + name: Global Holiday Bonus + status: active + start: '2024-01-15' + end: null + multiplier: 1.5 + rounding: down + userId: null + userAttributes: [] + issues: [] + Mixed success and errors: + value: + created: + - id: '550e8400-e29b-41d4-a716-446655440001' + name: Valid Boost + status: active + start: '2024-01-15' + end: null + multiplier: 1.5 + rounding: down + userId: null + userAttributes: + - attributeId: '550e8400-e29b-41d4-a716-446655440000' + attributeValue: premium + issues: + - index: 1 + severity: error + message: User does not exist + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Create points boosts + security: + - ApiKeyAuth: [] + patch: + description: Update multiple points boosts. + operationId: admin_points_boosts_update + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - boosts + x-fern-sdk-method-name: update + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const response = await trophy.admin.points.boosts.update('system-uuid', [ + { + id: 'boost-uuid-1', + name: 'Updated Boost Name', + multiplier: 3 + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + response = client.admin.points.boosts.update( + system_id='system-uuid', + boosts=[ + { + "id": "boost-uuid-1", + "name": "Updated Boost Name", + "multiplier": 3 + } + ] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + description: Array of boost patches. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsBoostsRequest' + examples: + Update boost names and multipliers: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Updated Boost Name + multiplier: 3 + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsBoostsResponse' + examples: + Success: + value: + updated: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Updated Boost Name + status: active + start: '2024-01-01' + end: '2024-01-03' + multiplier: 3 + rounding: down + userId: user-123 + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Update multiple points boosts + security: + - ApiKeyAuth: [] + delete: + description: Delete multiple points boosts by ID. + operationId: admin_points_boosts_delete + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - boosts + x-fern-sdk-method-name: delete + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const response = await trophy.admin.points.boosts.delete('system-uuid', { + ids: ['boost-uuid-1', 'boost-uuid-2', 'boost-uuid-3'] + }); + + console.log(`Deleted ${response.deleted.length} boosts`); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + response = client.admin.points.boosts.delete( + system_id='system-uuid', + ids=['boost-uuid-1', 'boost-uuid-2', 'boost-uuid-3'] + ) + + print(f"Deleted {len(response.deleted)} boosts") + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: ids + in: query + description: A list of up to 100 boost IDs. + required: true + schema: + type: array + items: + type: string + minItems: 1 + maxItems: 100 + example: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,b1ffcd00-0d1c-4ef9-cc7e-7cc0ce491b22' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DeletePointsBoostsResponse' + examples: + All boosts deleted: + value: + deleted: + - id: '550e8400-e29b-41d4-a716-446655440000' + - id: '550e8400-e29b-41d4-a716-446655440001' + - id: '550e8400-e29b-41d4-a716-446655440002' + issues: [] + Some boosts not found: + value: + deleted: + - id: '550e8400-e29b-41d4-a716-446655440000' + issues: + - id: '550e8400-e29b-41d4-a716-446655440001' + severity: error + message: Points boost not found by ID + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity (no IDs provided or too many IDs)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Delete multiple points boosts + security: + - ApiKeyAuth: [] + /points/{systemId}/boosts/{id}: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: Get a single points boost by ID. + operationId: admin_points_boosts_get + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - boosts + x-fern-sdk-method-name: get + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const boost = await trophy.admin.points.boosts.get('system-uuid', 'boost-uuid'); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + boost = client.admin.points.boosts.get( + system_id='system-uuid', + boost_id='boost-uuid' + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: id + in: path + description: The UUID of the points boost. + required: true + schema: + type: string + format: uuid + example: '660f9500-f30c-42e5-b827-557766550001' + responses: + '200': + description: The points boost. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPointsBoost' + examples: + A single boost: + value: + id: '550e8400-e29b-41d4-a716-446655440000' + name: Double XP Weekend + status: active + start: '2024-01-01' + end: '2024-01-03' + multiplier: 2 + rounding: down + userId: user-123 + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Get a points boost by ID + security: + - ApiKeyAuth: [] + /points/{systemId}/levels: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: List points levels for a system. + operationId: admin_points_levels_list + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - levels + x-fern-sdk-method-name: list + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const levels = await trophy.admin.points.levels.list('system-uuid', { + limit: 10, + skip: 0 + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + levels = client.admin.points.levels.list( + system_id='system-uuid', + limit=10, + skip=0 + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: limit + in: query + description: Number of records to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + example: 10 + - name: skip + in: query + description: Number of records to skip from the start of the list. + required: false + schema: + type: integer + minimum: 0 + default: 0 + example: 0 + responses: + '200': + description: A paginated list of points levels. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPointsLevelsResponse' + examples: + Two levels: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Bronze + key: bronze + points: 100 + description: Starting level + badge: null + - id: '660f9500-f30c-42e5-b827-557766550001' + name: Silver + key: silver + points: 500 + description: Intermediate level + badge: + url: 'https://example.com/silver.png' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: List points levels + security: + - ApiKeyAuth: [] + post: + description: Create points levels. Maximum 100 levels per request. + operationId: admin_points_levels_create + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - levels + x-fern-sdk-method-name: create + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.levels.create('system-uuid', [ + { + name: 'Bronze', + key: 'bronze', + points: 100, + description: 'Starting level', + badge: { url: 'https://example.com/bronze.png' } + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.levels.create( + system_id='system-uuid', + request=[{ + "name": "Bronze", + "key": "bronze", + "points": 100, + "description": "Starting level", + "badge": {"url": "https://example.com/bronze.png"} + }] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + description: Array of levels to create. Maximum 100 levels per request. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsLevelsRequest' + responses: + '200': + description: Successful operation (no levels created) + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsLevelsResponse' + examples: + No levels created: + value: + created: [] + issues: + - index: 0 + severity: error + message: Key already in use by another level + '201': + description: Created (at least one level created) + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsLevelsResponse' + examples: + Created successfully: + value: + created: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Bronze + key: bronze + points: 100 + description: Starting level + badge: + url: 'https://example.com/bronze.png' + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Create points levels + security: + - ApiKeyAuth: [] + patch: + description: Update multiple points levels. Each item must include an ID. `key` cannot be changed. + operationId: admin_points_levels_update + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - levels + x-fern-sdk-method-name: update + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.levels.update('system-uuid', [ + { + id: '550e8400-e29b-41d4-a716-446655440000', + name: 'Bronze Tier', + points: 150 + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.levels.update( + system_id='system-uuid', + request=[{ + "id": "550e8400-e29b-41d4-a716-446655440000", + "name": "Bronze Tier", + "points": 150 + }] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + description: Array of level patches. Each item must include an ID. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsLevelsRequest' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsLevelsResponse' + examples: + Updated successfully: + value: + updated: + - id: '550e8400-e29b-41d4-a716-446655440000' + name: Bronze Tier + key: bronze + points: 150 + description: Starting level + badge: null + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Update multiple points levels + security: + - ApiKeyAuth: [] + delete: + description: Delete multiple points levels by ID. + operationId: admin_points_levels_delete + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - levels + x-fern-sdk-method-name: delete + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.levels.delete('system-uuid', { + ids: ['550e8400-e29b-41d4-a716-446655440000'] + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.levels.delete( + system_id='system-uuid', + ids=['550e8400-e29b-41d4-a716-446655440000'] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: ids + in: query + description: Comma-separated list of level UUIDs to delete. + required: true + schema: + type: array + items: + type: string + format: uuid + style: form + explode: true + example: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11,b1ffcd00-0d1c-4ef9-cc7e-7cc0ce491b22' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DeletePointsLevelsResponse' + examples: + Deleted successfully: + value: + deleted: + - id: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + issues: [] + Partial success: + value: + deleted: + - id: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + issues: + - id: b1ffcd00-0d1c-4ef9-cc7e-7cc0ce491b22 + severity: error + message: Level not found by ID + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity (no IDs provided or too many IDs)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Delete multiple points levels + security: + - ApiKeyAuth: [] + /points/{systemId}/levels/{id}: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: Get a single points level by ID. + operationId: admin_points_levels_get + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - levels + x-fern-sdk-method-name: get + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const level = await trophy.admin.points.levels.get('system-uuid', 'level-uuid'); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + level = client.admin.points.levels.get( + system_id='system-uuid', + level_id='level-uuid' + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: id + in: path + description: The UUID of the points level. + required: true + schema: + type: string + format: uuid + example: '660f9500-f30c-42e5-b827-557766550001' + responses: + '200': + description: The points level. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPointsLevel' + examples: + A single level: + value: + id: '550e8400-e29b-41d4-a716-446655440000' + name: Bronze + key: bronze + points: 100 + description: Starting level + badge: + url: 'https://example.com/bronze.png' + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Get a points level by ID + security: + - ApiKeyAuth: [] + /points/{systemId}/triggers: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: List points triggers for a system. + operationId: admin_points_triggers_list + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - triggers + x-fern-sdk-method-name: list + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const triggers = await trophy.admin.points.triggers.list('system-uuid', { + limit: 10, + skip: 0 + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + triggers = client.admin.points.triggers.list( + system_id='system-uuid', + limit=10, + skip=0 + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: limit + in: query + description: Maximum number of results to return (1-100, default 10). + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + - name: skip + in: query + description: Number of results to skip for pagination (default 0). + required: false + schema: + type: integer + minimum: 0 + default: 0 + responses: + '200': + description: A paginated list of points triggers. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPointsTriggersResponse' + examples: + Triggers list: + value: + - id: '550e8400-e29b-41d4-a716-446655440000' + type: metric + points: 10 + status: active + userAttributes: [] + metricId: '660f9500-f30c-42e5-b827-557766550001' + metricThreshold: 5 + eventAttributes: [] + blockIfOutOfPoints: false + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: List points triggers + security: + - ApiKeyAuth: [] + post: + description: Create points triggers in bulk. Maximum 100 triggers per request. + operationId: admin_points_triggers_create + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - triggers + x-fern-sdk-method-name: create + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.triggers.create('system-uuid', [ + { + type: 'metric', + points: 10, + metricId: 'metric-uuid', + metricThreshold: 5 + } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.triggers.create( + system_id='system-uuid', + request=[{ + 'type': 'metric', + 'points': 10, + 'metric_id': 'metric-uuid', + 'metric_threshold': 5 + }] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsTriggersRequest' + responses: + '200': + description: Request was valid but no triggers were created (all items had issues). + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsTriggersResponse' + '201': + description: At least one trigger was created. + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePointsTriggersResponse' + examples: + Created triggers: + value: + created: + - id: '550e8400-e29b-41d4-a716-446655440000' + type: metric + points: 10 + status: active + userAttributes: [] + metricId: '660f9500-f30c-42e5-b827-557766550001' + metricThreshold: 5 + eventAttributes: [] + blockIfOutOfPoints: false + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Create points triggers + security: + - ApiKeyAuth: [] + patch: + description: Update points triggers in bulk. Maximum 100 triggers per request. Only provided fields are updated; omitted fields are preserved. + operationId: admin_points_triggers_update + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - triggers + x-fern-sdk-method-name: update + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.triggers.update('system-uuid', [ + { id: 'trigger-uuid', points: 20 } + ]); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.triggers.update( + system_id='system-uuid', + request=[{'id': 'trigger-uuid', 'points': 20}] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsTriggersRequest' + responses: + '200': + description: Successfully processed the update request. + content: + application/json: + schema: + $ref: '#/components/schemas/PatchPointsTriggersResponse' + examples: + Updated triggers: + value: + updated: + - id: '550e8400-e29b-41d4-a716-446655440000' + type: metric + points: 20 + status: active + userAttributes: [] + metricId: '660f9500-f30c-42e5-b827-557766550001' + metricThreshold: 5 + eventAttributes: [] + blockIfOutOfPoints: false + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Update points triggers + security: + - ApiKeyAuth: [] + delete: + description: Delete (archive) points triggers by ID. Maximum 100 trigger IDs per request. + operationId: admin_points_triggers_delete + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - triggers + x-fern-sdk-method-name: delete + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const result = await trophy.admin.points.triggers.delete('system-uuid', { + ids: ['trigger-uuid-1', 'trigger-uuid-2'] + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + result = client.admin.points.triggers.delete( + system_id='system-uuid', + ids=['trigger-uuid-1', 'trigger-uuid-2'] + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: ids + in: query + description: Trigger IDs to delete. Can be repeated or comma-separated. + required: true + schema: + type: array + items: + type: string + format: uuid + style: form + explode: true + example: + - '550e8400-e29b-41d4-a716-446655440000' + responses: + '200': + description: Successfully processed the delete request. + content: + application/json: + schema: + $ref: '#/components/schemas/DeletePointsTriggersResponse' + examples: + Deleted triggers: + value: + deleted: + - id: '550e8400-e29b-41d4-a716-446655440000' + issues: [] + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found (points system not found)' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Delete points triggers + security: + - ApiKeyAuth: [] + /points/{systemId}/triggers/{id}: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: Get a single points trigger by ID. + operationId: admin_points_triggers_get + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - points + - triggers + x-fern-sdk-method-name: get + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const trigger = await trophy.admin.points.triggers.get('system-uuid', 'trigger-uuid'); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + trigger = client.admin.points.triggers.get( + system_id='system-uuid', + id='trigger-uuid' + ) + parameters: + - name: systemId + in: path + description: The UUID of the points system. + required: true + schema: + type: string + format: uuid + example: '550e8400-e29b-41d4-a716-446655440000' + - name: id + in: path + description: The UUID of the points trigger. + required: true + schema: + type: string + format: uuid + example: '660f9500-f30c-42e5-b827-557766550001' + responses: + '200': + description: The points trigger. + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPointsTrigger' + examples: + A single trigger: + value: + id: '550e8400-e29b-41d4-a716-446655440000' + type: metric + points: 10 + status: active + userAttributes: [] + metricId: '660f9500-f30c-42e5-b827-557766550001' + metricThreshold: 5 + eventAttributes: [] + blockIfOutOfPoints: false + '401': + description: 'Unauthorized' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '404': + description: 'Not Found' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + '422': + description: 'Unprocessible Entity' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorBody' + summary: Get a points trigger by ID + security: + - ApiKeyAuth: [] + /leaderboards: + servers: + - url: https://admin.trophy.so/v1 + description: Admin API + get: + description: List leaderboards. + operationId: admin_leaderboards_list + x-fern-server-name: admin + x-fern-sdk-group-name: + - admin + - leaderboards + x-fern-sdk-method-name: list + tags: + - Admin + x-codeSamples: + - lang: javascript + source: | + import { TrophyApiClient } from '@trophyso/node'; + + const trophy = new TrophyApiClient({ + apiKey: 'YOUR_API_KEY' + }); + + const leaderboards = await trophy.admin.leaderboards.list({ + limit: 10, + skip: 0 + }); + - lang: python + source: | + from trophy import TrophyApi + + client = TrophyApi(api_key='YOUR_API_KEY') + + leaderboards = client.admin.leaderboards.list( + limit=10, + skip=0 + ) + parameters: + - name: limit + in: query + description: Number of records to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 default: 10 example: 10 - name: skip @@ -2525,148 +4309,791 @@ components: description: A paginated list of metrics. items: $ref: '#/components/schemas/CreatedMetric' + CreatePointsBoostRequestItem: + title: CreatePointsBoostRequestItem + type: object + description: A points boost to create. May optionally target a specific user via `userId` or filter by user attributes via `userAttributes`. These two fields are mutually exclusive. + properties: + userId: + type: + - string + - 'null' + description: The ID of the user to create a boost for. Mutually exclusive with `userAttributes` — providing `userAttributes` when `userId` is set will result in an error. Omit for a global boost. + example: user-123 + name: + type: string + description: The name of the boost. + maxLength: 255 + example: Double XP Weekend + start: + type: string + format: date + description: The start date of the boost (YYYY-MM-DD). + example: '2024-01-01' + end: + type: + - string + - 'null' + format: date + description: The end date of the boost (YYYY-MM-DD). If null, the boost has no end date. + example: '2024-01-03' + multiplier: + type: number + description: The points multiplier. Must be greater than 0, not equal to 1, and less than 100. + example: 2 + exclusiveMinimum: 0 + exclusiveMaximum: 100 + rounding: + type: string + enum: + - down + - up + - nearest + default: down + description: How to round the boosted points. Defaults to 'down'. + example: down + userAttributes: + type: + - array + - 'null' + description: User attribute filters for the boost. Cannot be provided when `userId` is set. + items: + type: object + properties: + attributeId: + type: string + format: uuid + description: The UUID of the user attribute. + attributeValue: + type: string + description: The value to match. + required: + - attributeId + - attributeValue + example: + - attributeId: '550e8400-e29b-41d4-a716-446655440000' + attributeValue: premium + required: + - name + - start + - multiplier CreatePointsBoostsRequest: title: CreatePointsBoostsRequest + type: array + description: Array of points boosts to create. Maximum 100 boosts per request. Each boost may optionally target a specific user via `userId` or filter by user attributes via `userAttributes`. These two fields are mutually exclusive — providing `userAttributes` when `userId` is set will result in an error. Omitting both creates a global boost. + items: + $ref: '#/components/schemas/CreatePointsBoostRequestItem' + maxItems: 100 + minItems: 1 + AdminPointsBoost: + title: AdminPointsBoost type: object - description: Request body for creating points boosts. + description: A points boost as returned from admin endpoints. properties: - systemKey: + id: type: string - description: The key of the points system to create boosts for. - example: xp - boosts: + format: uuid + description: The UUID of the boost. + name: + type: string + description: The name of the boost. + status: + type: string + enum: ['active', 'scheduled', 'finished'] + description: The status of the boost. + start: + type: string + format: date + description: The start date (YYYY-MM-DD). + end: + type: + - string + - 'null' + format: date + description: The end date (YYYY-MM-DD) or null if no end date. + multiplier: + type: number + description: The points multiplier. + rounding: + type: string + enum: + - down + - up + - nearest + description: How boosted points are rounded. + userId: + type: + - string + - 'null' + description: The customer ID of the user the boost was created for, or null for global/attribute-filtered boosts. + userAttributes: + type: array + description: User attribute filters applied to the boost. Only present for non-user-specific boosts (i.e. when `userId` is null). Empty array if no filters are set. + items: + type: object + properties: + attributeId: + type: string + format: uuid + description: The UUID of the user attribute. + attributeValue: + type: string + description: The matched attribute value. + required: + - attributeId + - attributeValue + required: + - id + - name + - status + - start + - end + - multiplier + - rounding + - userId + ListPointsBoostsResponse: + title: ListPointsBoostsResponse + type: array + description: A paginated list of points boosts. + items: + $ref: '#/components/schemas/AdminPointsBoost' + CreatePointsBoostsResponse: + title: CreatePointsBoostsResponse + type: object + description: Response containing created boosts and any issues encountered while creating points boosts. + properties: + created: + type: array + items: + $ref: '#/components/schemas/AdminPointsBoost' + description: Array of successfully created boosts. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during boost creation. + required: + - created + - issues + PatchPointsBoostsRequest: + title: PatchPointsBoostsRequest + type: array + description: Array of points boost patches. Maximum 100 per request. + items: + type: object + properties: + id: + type: string + format: uuid + description: The UUID of the boost to update. + name: + type: string + description: Updated name for the boost. + maxLength: 255 + start: + type: string + format: date + description: Updated start date (YYYY-MM-DD). + end: + type: + - string + - 'null' + format: date + description: Updated end date (YYYY-MM-DD) or null to remove end date. + multiplier: + type: number + description: Updated points multiplier. + exclusiveMinimum: 0 + exclusiveMaximum: 100 + rounding: + type: string + enum: + - down + - up + - nearest + description: Updated rounding strategy. + userAttributes: + type: + - array + - 'null' + description: Updated user attribute filters. Cannot be set on user-specific boosts. Set to null to clear. + items: + type: object + properties: + attributeId: + type: string + format: uuid + description: The UUID of the user attribute. + attributeValue: + type: string + description: The value to match. + required: + - attributeId + - attributeValue + required: + - id + maxItems: 100 + minItems: 1 + PatchPointsBoostsResponse: + title: PatchPointsBoostsResponse + type: object + description: Response containing updated boosts and any issues encountered. + properties: + updated: type: array + items: + $ref: '#/components/schemas/AdminPointsBoost' + description: Array of successfully updated boosts. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during boost updates. + required: + - updated + - issues + DeletePointsBoostsResponse: + title: DeletePointsBoostsResponse + type: object + description: Response containing the points boosts that were deleted and any per-item issues. + properties: + deleted: + type: array + items: + $ref: '#/components/schemas/DeletedResource' + description: Array of deleted points boosts represented by ID. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during boost deletion. + required: + - deleted + - issues + CreatePointsLevelRequestItem: + title: CreatePointsLevelRequestItem + type: object + description: A points level to create. + properties: + name: + type: string + description: The name of the level. + example: Bronze + key: + type: string + description: A unique key for the level. Only alphanumeric characters, hyphens, and underscores are permitted. + pattern: '^[a-zA-Z\d-_]+$' + example: bronze + points: + type: integer + minimum: 0 + description: The threshold points value for the level. + example: 100 + description: + type: string + description: An optional description of the level. + example: Starting level + badge: + type: object + description: An optional badge for the level. + properties: + url: + type: string + description: The URL of the badge image. + example: 'https://example.com/bronze.png' + required: + - url + required: + - name + - key + - points + CreatePointsLevelsRequest: + title: CreatePointsLevelsRequest + type: array + description: Array of points levels to create. Maximum 100 levels per request. + items: + $ref: '#/components/schemas/CreatePointsLevelRequestItem' + maxItems: 100 + minItems: 1 + AdminPointsLevel: + title: AdminPointsLevel + type: object + description: A points level as returned from admin endpoints. + properties: + id: + type: string + format: uuid + description: The UUID of the level. + name: + type: string + description: The name of the level. + key: + type: string + description: The level key. + points: + type: integer + description: The threshold points value for the level. + description: + type: string + description: The level description. + badge: + oneOf: + - type: object + properties: + url: + type: string + description: The URL of the badge image. + required: + - url + - type: 'null' + description: The badge for the level, or null if no badge is set. + required: + - id + - name + - key + - points + - description + - badge + CreatePointsLevelsResponse: + title: CreatePointsLevelsResponse + type: object + description: Response containing created levels and any per-item issues. + properties: + created: + type: array + items: + $ref: '#/components/schemas/AdminPointsLevel' + description: Array of successfully created levels. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during level creation. + required: + - created + - issues + ListPointsLevelsResponse: + title: ListPointsLevelsResponse + type: array + description: A paginated list of points levels. + items: + $ref: '#/components/schemas/AdminPointsLevel' + PatchPointsLevelsRequest: + title: PatchPointsLevelsRequest + type: array + description: Array of points level patches. Maximum 100 per request. + items: + type: object + properties: + id: + type: string + format: uuid + description: The UUID of the level to update. + example: '550e8400-e29b-41d4-a716-446655440000' + name: + type: string + description: The updated level name. + points: + type: integer + minimum: 0 + description: The updated threshold points value. + description: + type: string + description: The updated level description. + badge: + oneOf: + - type: object + properties: + url: + type: string + description: The URL of the badge image. + required: + - url + - type: 'null' + description: The updated badge, or `null` to clear it. + required: + - id + maxItems: 100 + minItems: 1 + PatchPointsLevelsResponse: + title: PatchPointsLevelsResponse + type: object + description: Response containing updated levels and any issues encountered. + properties: + updated: + type: array + items: + $ref: '#/components/schemas/AdminPointsLevel' + description: Array of successfully updated levels. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during level updates. + required: + - updated + - issues + DeletePointsLevelsResponse: + title: DeletePointsLevelsResponse + type: object + description: Response containing the points levels that were deleted and any per-item issues. + properties: + deleted: + type: array + items: + $ref: '#/components/schemas/DeletedResource' + description: Array of deleted points levels represented by ID. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during level deletion. + required: + - deleted + - issues + CreatePointsTriggerRequestItem: + title: CreatePointsTriggerRequestItem + type: object + description: A points trigger to create. + properties: + type: + type: string + enum: + - metric + - achievement + - streak + - time + - user_creation + description: The type of trigger. + example: metric + points: + type: integer + description: The number of points to award or deduct when the trigger fires. Cannot be zero. + example: 10 + status: + type: string + enum: + - active + - inactive + default: inactive + description: The status of the trigger. Defaults to 'inactive'. + example: inactive + userAttributes: + type: + - array + - 'null' + description: Optional user attribute filters for the trigger. items: type: object properties: - userId: + attributeId: type: string - description: The ID of the user to create a boost for. - example: user-123 - name: + format: uuid + description: The UUID of the user attribute. + attributeValue: type: string - description: The name of the boost. - maxLength: 255 - example: Double XP Weekend - start: + description: The value to match. + required: + - attributeId + - attributeValue + metricId: + type: string + format: uuid + description: Required if type is `metric`. The UUID of the metric. + metricThreshold: + type: integer + minimum: 1 + description: Required if type is `metric`. The metric increment that triggers the points. + eventAttributes: + type: + - array + - 'null' + description: Optional event attribute filters. Only permitted if type is `metric`. + items: + type: object + properties: + attributeId: type: string - format: date - description: The start date of the boost (YYYY-MM-DD). - example: '2024-01-01' - end: - type: - - string - - 'null' - format: date - description: The end date of the boost (YYYY-MM-DD). If null, the boost has no end date. - example: '2024-01-03' - multiplier: - type: number - description: The points multiplier. Must be greater than 0, not equal to 1, and less than 100. - example: 2 - exclusiveMinimum: 0 - exclusiveMaximum: 100 - rounding: + format: uuid + description: The UUID of the event attribute. + attributeValue: type: string - enum: - - down - - up - - nearest - default: down - description: How to round the boosted points. Defaults to 'down'. - example: down + description: The value to match. required: - - userId - - name - - start - - multiplier - description: Array of boosts to create. Maximum 100 boosts per request. - maxItems: 100 - minItems: 1 + - attributeId + - attributeValue + achievementId: + type: string + format: uuid + description: Required if type is `achievement`. The UUID of the achievement. + streakLength: + type: integer + minimum: 1 + description: Required if type is `streak`. The number of streak periods that triggers the points. + timeUnit: + type: string + enum: + - hours + - days + description: Required if type is `time`. The unit for the time interval. + timeInterval: + type: integer + minimum: 1 + description: Required if type is `time`. The number of time units between recurring awards. + blockIfOutOfPoints: + type: boolean + default: false + description: Whether to block metric events that would reduce the user's points below zero. Defaults to false. required: - - systemKey - - boosts - CreatedPointsBoost: - title: CreatedPointsBoost + - type + - points + CreatePointsTriggersRequest: + title: CreatePointsTriggersRequest + type: array + description: Array of points triggers to create. Maximum 100 triggers per request. + items: + $ref: '#/components/schemas/CreatePointsTriggerRequestItem' + maxItems: 100 + minItems: 1 + AdminPointsTrigger: + title: AdminPointsTrigger type: object - description: A successfully created points boost returned from the create endpoint. + description: A points trigger as returned from admin endpoints. properties: id: type: string format: uuid - description: The UUID of the created boost. - name: + description: The UUID of the trigger. + type: type: string - description: The name of the boost. + enum: + - metric + - achievement + - streak + - time + - user_creation + description: The type of trigger. + points: + type: integer + description: The number of points awarded or deducted when the trigger fires. status: type: string - enum: ['active', 'scheduled', 'finished'] - description: The status of the boost. - start: + enum: + - active + - inactive + description: The status of the trigger. + userAttributes: + type: array + description: User attribute filters applied to the trigger. + items: + type: object + properties: + attributeId: + type: string + format: uuid + attributeValue: + type: string + required: + - attributeId + - attributeValue + metricId: type: string - format: date - description: The start date (YYYY-MM-DD). - end: - type: - - string - - 'null' - format: date - description: The end date (YYYY-MM-DD) or null if no end date. - multiplier: - type: number - description: The points multiplier. - rounding: + format: uuid + description: The UUID of the metric. Only present for metric triggers. + metricThreshold: + type: integer + description: The metric threshold. Only present for metric triggers. + eventAttributes: + type: array + description: Event attribute filters applied to the trigger. Only present for metric triggers. + items: + type: object + properties: + attributeId: + type: string + format: uuid + attributeValue: + type: string + required: + - attributeId + - attributeValue + achievementId: type: string - enum: - - down - - up - - nearest - description: How boosted points are rounded. - userId: + format: uuid + description: The UUID of the achievement. Only present for achievement triggers. + streakLength: + type: integer + description: The streak length. Only present for streak triggers. + timeUnit: type: string - description: The customer ID of the user the boost was created for. + enum: + - hours + - days + description: The time unit. Only present for time triggers. + timeInterval: + type: integer + description: The time interval. Only present for time triggers. + blockIfOutOfPoints: + type: boolean + description: Whether metric events that would reduce the user's points below zero are blocked. required: - id - - name + - type + - points - status - - start - - end - - multiplier - - rounding - - userId - CreatePointsBoostsResponse: - title: CreatePointsBoostsResponse + - userAttributes + - blockIfOutOfPoints + ListPointsTriggersResponse: + title: ListPointsTriggersResponse + type: array + description: A paginated list of points triggers. + items: + $ref: '#/components/schemas/AdminPointsTrigger' + CreatePointsTriggersResponse: + title: CreatePointsTriggersResponse type: object - description: Response containing created boosts and any issues encountered while creating points boosts. + description: Response containing created triggers and any per-item issues. properties: created: type: array items: - $ref: '#/components/schemas/CreatedPointsBoost' - description: Array of successfully created boosts. + $ref: '#/components/schemas/AdminPointsTrigger' + description: Array of successfully created triggers. issues: type: array items: $ref: '#/components/schemas/AdminIssue' - description: Array of issues encountered during boost creation. + description: Array of issues encountered during trigger creation. required: - created - issues - DeletePointsBoostsResponse: - title: DeletePointsBoostsResponse + PatchPointsTriggersRequest: + title: PatchPointsTriggersRequest + type: array + description: Array of points trigger patches. Maximum 100 per request. + items: + type: object + properties: + id: + type: string + format: uuid + description: The UUID of the trigger to update. + type: + type: string + enum: + - metric + - achievement + - streak + - time + - user_creation + description: Updated trigger type. Can only be changed when the trigger is inactive. Required fields for the new type must be provided. + points: + type: integer + description: Updated points value. + status: + type: string + enum: + - active + - inactive + description: Updated status. + userAttributes: + type: + - array + - 'null' + description: Updated user attribute filters. Set to null to clear. + items: + type: object + properties: + attributeId: + type: string + format: uuid + attributeValue: + type: string + required: + - attributeId + - attributeValue + metricId: + type: string + format: uuid + description: Updated metric ID. Only permitted for metric triggers. + metricThreshold: + type: integer + minimum: 1 + description: Updated metric threshold. Only permitted for metric triggers. + eventAttributes: + type: + - array + - 'null' + description: Updated event attribute filters. Only permitted for metric triggers. Set to null to clear. + items: + type: object + properties: + attributeId: + type: string + format: uuid + attributeValue: + type: string + required: + - attributeId + - attributeValue + achievementId: + type: string + format: uuid + description: Updated achievement ID. Only permitted for achievement triggers. + streakLength: + type: integer + minimum: 1 + description: Updated streak length. Only permitted for streak triggers. + timeUnit: + type: string + enum: + - hours + - days + description: Updated time unit. Only permitted for time triggers. + timeInterval: + type: integer + minimum: 1 + description: Updated time interval. Only permitted for time triggers. + blockIfOutOfPoints: + type: boolean + description: Updated block-if-out-of-points setting. + required: + - id + maxItems: 100 + minItems: 1 + PatchPointsTriggersResponse: + title: PatchPointsTriggersResponse type: object - description: Response containing the points boosts that were deleted and any per-item issues. + description: Response containing updated triggers and any issues encountered. + properties: + updated: + type: array + items: + $ref: '#/components/schemas/AdminPointsTrigger' + description: Array of successfully updated triggers. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during trigger updates. + required: + - updated + - issues + DeletePointsTriggersResponse: + title: DeletePointsTriggersResponse + type: object + description: Response containing the points triggers that were deleted and any per-item issues. properties: deleted: type: array items: $ref: '#/components/schemas/DeletedResource' - description: Array of deleted points boosts represented by ID. + description: Array of deleted points triggers represented by ID. issues: type: array items: $ref: '#/components/schemas/AdminIssue' - description: Array of issues encountered during boost deletion. + description: Array of issues encountered during trigger deletion. required: - deleted - issues @@ -2757,6 +5184,238 @@ components: description: The ID of the deleted resource. required: - id + CreatePointsSystemsRequest: + title: CreatePointsSystemsRequest + type: array + description: Request body for creating points systems. + items: + $ref: '#/components/schemas/CreatePointsSystemRequestItem' + minItems: 1 + maxItems: 100 + CreatePointsSystemRequestItem: + title: CreatePointsSystemRequestItem + type: object + description: A points system to create. Optionally include sub-entities. + properties: + name: + type: string + description: The points system name. + example: XP + key: + type: string + pattern: '^[a-zA-Z\d-_]+$' + description: The points system key. Only alphanumeric characters, hyphens, and underscores are permitted. + example: xp + description: + type: string + description: A short description of the points system. + example: Experience points + badge: + oneOf: + - type: object + properties: + url: + type: string + description: Badge image URL. + required: + - url + - type: 'null' + description: An optional badge for the points system. + maxPoints: + type: + - integer + - 'null' + minimum: 1 + description: Optional maximum points a user can earn. + levels: + type: array + description: Optional array of levels to create alongside the system. + items: + $ref: '#/components/schemas/CreatePointsLevelRequestItem' + boosts: + type: array + description: Optional array of boosts to create alongside the system. + items: + $ref: '#/components/schemas/CreatePointsBoostRequestItem' + triggers: + type: array + description: Optional array of triggers to create alongside the system. + items: + $ref: '#/components/schemas/CreatePointsTriggerRequestItem' + required: + - name + - key + AdminPointsSystem: + title: AdminPointsSystem + type: object + description: A points system returned from the admin points systems endpoints. + properties: + id: + type: string + format: uuid + description: The UUID of the points system. + name: + type: string + description: The points system name. + key: + type: string + description: The points system key. + description: + type: string + description: The points system description. + status: + type: string + enum: + - active + - archived + description: The points system status. + badge: + oneOf: + - type: object + properties: + url: + type: string + required: + - url + - type: 'null' + description: The badge for the points system. + maxPoints: + type: + - integer + - 'null' + description: The maximum points a user can earn. + required: + - id + - name + - key + - description + - status + - badge + - maxPoints + CreatedAdminPointsSystem: + title: CreatedAdminPointsSystem + description: A points system returned from the creation endpoint. Extends AdminPointsSystem with optional sub-entity arrays that are present when those sub-entities were included in the creation request. + allOf: + - $ref: '#/components/schemas/AdminPointsSystem' + - type: object + properties: + levels: + type: array + items: + $ref: '#/components/schemas/AdminPointsLevel' + description: Levels created alongside the system. Present when levels were provided in the request. + boosts: + type: array + items: + $ref: '#/components/schemas/AdminPointsBoost' + description: Boosts created alongside the system. Present when boosts were provided in the request. + triggers: + type: array + items: + $ref: '#/components/schemas/AdminPointsTrigger' + description: Triggers created alongside the system. Present when triggers were provided in the request. + ListPointsSystemsResponse: + title: ListPointsSystemsResponse + type: array + description: Response containing a list of points systems. + items: + $ref: '#/components/schemas/AdminPointsSystem' + CreatePointsSystemsResponse: + title: CreatePointsSystemsResponse + type: object + description: Response containing created points systems and any per-item issues. + properties: + created: + type: array + items: + $ref: '#/components/schemas/CreatedAdminPointsSystem' + description: Array of successfully created points systems. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during creation. + required: + - created + - issues + UpdatePointsSystemsRequest: + title: UpdatePointsSystemsRequest + type: array + description: Request body for updating points systems. + items: + $ref: '#/components/schemas/UpdatePointsSystemRequestItem' + minItems: 1 + maxItems: 100 + UpdatePointsSystemRequestItem: + title: UpdatePointsSystemRequestItem + type: object + description: A points system update object. Only id is required; all other fields are optional. + properties: + id: + type: string + format: uuid + description: The UUID of the points system to update. + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Updated name. + description: + type: string + description: Updated description. + badge: + oneOf: + - type: object + properties: + url: + type: string + required: + - url + - type: 'null' + description: Updated badge. Set to null to remove. + maxPoints: + type: + - integer + - 'null' + minimum: 1 + description: Updated max points. Set to null to remove. + required: + - id + UpdatePointsSystemsResponse: + title: UpdatePointsSystemsResponse + type: object + description: Response containing updated points systems and any per-item issues. + properties: + updated: + type: array + items: + $ref: '#/components/schemas/AdminPointsSystem' + description: Array of successfully updated points systems. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during update. + required: + - updated + - issues + DeletePointsSystemsResponse: + title: DeletePointsSystemsResponse + type: object + description: Response containing deleted points system IDs and any per-item issues. + properties: + deleted: + type: array + items: + $ref: '#/components/schemas/DeletedResource' + description: Array of deleted points system IDs. + issues: + type: array + items: + $ref: '#/components/schemas/AdminIssue' + description: Array of issues encountered during deletion. + required: + - deleted + - issues securitySchemes: ApiKeyAuth: type: apiKey diff --git a/scripts/generate-translations.mjs b/scripts/generate-translations.mjs index b65d4f5..4326720 100644 --- a/scripts/generate-translations.mjs +++ b/scripts/generate-translations.mjs @@ -150,6 +150,7 @@ function runLingoPurge(target, scopedFiles) { const targetArg = getArg("--target"); const pathFilter = getArg("--paths"); const forceRetranslate = hasFlag("--force"); +const skipAnchorSync = hasFlag("--skip-anchor-sync"); const filters = pathFilter ? pathFilter .split(",") @@ -249,7 +250,14 @@ try { execSync(`node scripts/localize-mdx-paths.mjs --target ${target}`, { stdio: "inherit" }); console.log(`Translation generation completed for target locale: ${target}`); } - execSync("node scripts/sync-heading-anchors.mjs", { stdio: "inherit" }); + if (!skipAnchorSync) { + const anchorArgs = []; + if (targets.length > 0) anchorArgs.push(`--target ${targets.join(",")}`); + if (filters.length > 0) anchorArgs.push(`--paths "${filters.join(",")}"`); + execSync(`node scripts/sync-heading-anchors.mjs ${anchorArgs.join(" ")}`.trim(), { stdio: "inherit" }); + } else { + console.log("Skipping heading anchor sync (--skip-anchor-sync)."); + } } finally { fs.rmSync(path.join(process.cwd(), stagingRoot), { recursive: true, force: true }); if (fs.existsSync(backupPath)) { diff --git a/scripts/localize-internal-links.mjs b/scripts/localize-internal-links.mjs index f6a0f01..6b635f7 100644 --- a/scripts/localize-internal-links.mjs +++ b/scripts/localize-internal-links.mjs @@ -129,6 +129,39 @@ function rewriteContent(content, locale) { return next; } +function collectNonLocalizedLinks(content, locale) { + const findings = []; + + // Markdown links: [label](/path) + const markdownRegex = /\]\(\/([^)]+)\)/g; + for (const match of content.matchAll(markdownRegex)) { + const originalPath = match[1]; + const out = transformCapturedPath(originalPath, locale); + if (out === null) continue; + findings.push({ + kind: "markdown", + before: `](/${originalPath})`, + after: `](/${out})` + }); + } + + // JSX/HTML attrs: href="/path" + const hrefRegex = /\bhref=(["'])\/([^"']+)\1/g; + for (const match of content.matchAll(hrefRegex)) { + const quote = match[1]; + const originalPath = match[2]; + const out = transformCapturedPath(originalPath, locale); + if (out === null) continue; + findings.push({ + kind: "href", + before: `href=${quote}/${originalPath}${quote}`, + after: `href=${quote}/${out}${quote}` + }); + } + + return findings; +} + function walkMdx(dir) { if (!fs.existsSync(dir)) return []; const out = []; @@ -165,6 +198,7 @@ function walkRootMdx(root, excludedTopDirs) { } let changedFiles = 0; +const checkFindings = []; for (const locale of locales) { const files = locale === sourceLocale @@ -175,6 +209,10 @@ for (const locale of locales) { const next = rewriteContent(raw, locale); if (next !== raw) { changedFiles += 1; + if (checkOnly) { + const findings = collectNonLocalizedLinks(raw, locale); + checkFindings.push({ file, findings }); + } if (!checkOnly) fs.writeFileSync(file, next); } } @@ -183,6 +221,12 @@ for (const locale of locales) { if (checkOnly) { if (changedFiles > 0) { console.error(`Found ${changedFiles} file(s) with non-localized internal links.`); + for (const item of checkFindings) { + console.error(`- ${item.file}`); + for (const finding of item.findings) { + console.error(` ${finding.before} -> ${finding.after}`); + } + } process.exit(1); } console.log("Internal links are locale-localized."); diff --git a/scripts/sync-heading-anchors.mjs b/scripts/sync-heading-anchors.mjs index 114cbbc..158ede0 100644 --- a/scripts/sync-heading-anchors.mjs +++ b/scripts/sync-heading-anchors.mjs @@ -27,6 +27,13 @@ function hasFlag(name) { const checkOnly = hasFlag("--check"); const targetArg = getArg("--target"); +const pathFilter = getArg("--paths"); +const filters = pathFilter + ? pathFilter + .split(",") + .map((s) => s.trim()) + .filter(Boolean) + : []; const ROOT = process.cwd(); const config = JSON.parse(fs.readFileSync(path.join(ROOT, "i18n.json"), "utf8")); @@ -213,7 +220,17 @@ const excludedSourceDirs = new Set([ "styles", ".cursor", ]); -const sourceFiles = walkRootMdx(ROOT, { excludeDirs: excludedSourceDirs }); +let sourceFiles = walkRootMdx(ROOT, { excludeDirs: excludedSourceDirs }); +if (filters.length > 0) { + sourceFiles = sourceFiles.filter((abs) => { + const rel = path.relative(ROOT, abs).replace(/\\/g, "/"); + return filters.some((f) => rel.includes(f)); + }); + if (sourceFiles.length === 0) { + console.error("No files matched --paths filters."); + process.exit(1); + } +} for (const abs of sourceFiles) { try {