Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/openapi-drift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: OpenAPI code samples

on:
pull_request:
push:
branches:
- main

jobs:
drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"

- run: pnpm install --frozen-lockfile

- run: pnpm --filter www openapi:build

- name: Ensure generated OpenAPI index matches commit
run: git diff --exit-code -- apps/www/lib/generated/openapi-code-samples.json
4 changes: 4 additions & 0 deletions apps/www/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
NEXT_PUBLIC_SITE_URL=https://ui.trophy.so

PROFOUND_CUSTOM_LOGGING_ENABLED=false
PROFOUND_API_KEY=
PROFOUND_LOG_QUERY_PARAM_ALLOWLIST=utm_source,utm_medium,utm_campaign,utm_term,utm_content,utm_id,utm_source_platform,utm_creative_format,utm_marketing_tactic
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/achievement-badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ When `achievement.achievedAt` is `null`, the badge is shown in a locked state.
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch a user's achievements server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/achievements"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/achievement-card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ import { AchievementCard } from "@/components/ui/achievement-card"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch a user's achievements server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/achievements"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/achievement-grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ import { AchievementGrid } from "@/components/ui/achievement-grid"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch a user's achievements server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/achievements"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/achievement-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import { AchievementList } from "@/components/ui/achievement-list"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch a user's achievements server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/achievements"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/achievement-unlocked.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const [open, setOpen] = useState(false)
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to send a metric event server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="post"
endpoint="/metrics/{key}/event"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/leaderboard-card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const selectedRun = runs[selectedRunId] ?? runs["this-week"]
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch leaderboard data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/leaderboards/{key}"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/leaderboard-podium.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Works with fewer than 3 users:
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch leaderboard data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/leaderboards/{key}"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/leaderboard-rankings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ import { LeaderboardRankings } from "@/components/ui/leaderboard-rankings"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch leaderboard data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/leaderboards/{key}"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/points-awards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ import { PointsAwards } from "@/components/ui/points-awards"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch the user's points data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/points/{key}"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/points-badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Available in three sizes: `sm`, `default`, and `lg`.
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch the user's points total server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/points/{key}"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/points-boost.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Pass `endDate` to enable the countdown label.
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch boosts for a points system server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/points/{key}/boosts"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/points-chart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const [period, setPeriod] = useState("last-7-days")
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch points time-series data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/points/{key}/event-summary"
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/www/content/docs/components/points-levels-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ import { PointsLevelsList } from "@/components/ui/points-levels-list"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch user progress and system levels server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/points/{key}"
/>

Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch points system level definitions server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/points/{key}/levels"
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/www/content/docs/components/points-levels-timeline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ import { PointsLevelsTimeline } from "@/components/ui/points-levels-timeline"
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch user progress server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/points/{key}"
/>

Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch points system level definitions server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/points/{key}/levels"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/streak-badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Available in three sizes: `sm`, `default`, and `lg`.
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch streak data for a particular user server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/streak"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/streak-calendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const streak = [
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch streak data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/streak"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/components/streak-card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const streak = [
Use the [Trophy SDK](https://docs.trophy.so/api-reference/client-libraries) to fetch streak data server-side:

<OpenApiCodeSamples
spec="application.yml"
spec="application"
method="get"
endpoint="/users/{id}/streak"
/>
Expand Down
Loading
Loading