@headless-lms/server 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +5 -0
- package/dist/app/community-mail.d.ts +26 -0
- package/dist/app/community-mail.js +96 -0
- package/dist/app/community-mail.js.map +1 -0
- package/dist/app/container.d.ts +22 -14
- package/dist/app/container.js +186 -62
- package/dist/app/container.js.map +1 -1
- package/dist/app/mcp-endpoints.d.ts +13 -0
- package/dist/app/mcp-endpoints.js +25 -0
- package/dist/app/mcp-endpoints.js.map +1 -0
- package/dist/http/config.d.ts +2 -1
- package/dist/http/errors.d.ts +14 -0
- package/dist/http/errors.js +147 -0
- package/dist/http/errors.js.map +1 -0
- package/dist/http/mcp/catalogue.d.ts +37 -0
- package/dist/http/mcp/catalogue.js +69 -0
- package/dist/http/mcp/catalogue.js.map +1 -0
- package/dist/http/mcp/challenge.d.ts +7 -0
- package/dist/http/mcp/challenge.js +35 -0
- package/dist/http/mcp/challenge.js.map +1 -0
- package/dist/http/mcp/input-schema.d.ts +7 -0
- package/dist/http/mcp/input-schema.js +28 -0
- package/dist/http/mcp/input-schema.js.map +1 -0
- package/dist/http/mcp/route.d.ts +8 -0
- package/dist/http/mcp/route.js +75 -0
- package/dist/http/mcp/route.js.map +1 -0
- package/dist/http/mcp/server.d.ts +8 -0
- package/dist/http/mcp/server.js +31 -0
- package/dist/http/mcp/server.js.map +1 -0
- package/dist/http/mcp/test-support.d.ts +55 -0
- package/dist/http/mcp/test-support.js +151 -0
- package/dist/http/mcp/test-support.js.map +1 -0
- package/dist/http/mcp/tool.d.ts +48 -0
- package/dist/http/mcp/tool.js +58 -0
- package/dist/http/mcp/tool.js.map +1 -0
- package/dist/http/mcp/tools/automations.d.ts +6 -0
- package/dist/http/mcp/tools/automations.js +120 -0
- package/dist/http/mcp/tools/automations.js.map +1 -0
- package/dist/http/mcp/tools/catalog.d.ts +6 -0
- package/dist/http/mcp/tools/catalog.js +200 -0
- package/dist/http/mcp/tools/catalog.js.map +1 -0
- package/dist/http/mcp/tools/comments.d.ts +6 -0
- package/dist/http/mcp/tools/comments.js +70 -0
- package/dist/http/mcp/tools/comments.js.map +1 -0
- package/dist/http/mcp/tools/communities.d.ts +6 -0
- package/dist/http/mcp/tools/communities.js +175 -0
- package/dist/http/mcp/tools/communities.js.map +1 -0
- package/dist/http/mcp/tools/community-members.d.ts +6 -0
- package/dist/http/mcp/tools/community-members.js +89 -0
- package/dist/http/mcp/tools/community-members.js.map +1 -0
- package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
- package/dist/http/mcp/tools/community-moderation.js +144 -0
- package/dist/http/mcp/tools/community-moderation.js.map +1 -0
- package/dist/http/mcp/tools/courses.d.ts +6 -0
- package/dist/http/mcp/tools/courses.js +121 -0
- package/dist/http/mcp/tools/courses.js.map +1 -0
- package/dist/http/mcp/tools/index.d.ts +6 -0
- package/dist/http/mcp/tools/index.js +23 -0
- package/dist/http/mcp/tools/index.js.map +1 -0
- package/dist/http/mcp/tools/people.d.ts +6 -0
- package/dist/http/mcp/tools/people.js +145 -0
- package/dist/http/mcp/tools/people.js.map +1 -0
- package/dist/http/plugins/auth.js +13 -5
- package/dist/http/plugins/auth.js.map +1 -1
- package/dist/http/plugins/error-handler.d.ts +3 -2
- package/dist/http/plugins/error-handler.js +52 -57
- package/dist/http/plugins/error-handler.js.map +1 -1
- package/dist/http/plugins/openapi.js +70 -20
- package/dist/http/plugins/openapi.js.map +1 -1
- package/dist/http/routes/access.d.ts +7 -0
- package/dist/http/routes/access.js +140 -0
- package/dist/http/routes/access.js.map +1 -0
- package/dist/http/routes/activities.js +97 -20
- package/dist/http/routes/activities.js.map +1 -1
- package/dist/http/routes/assets.js +60 -51
- package/dist/http/routes/assets.js.map +1 -1
- package/dist/http/routes/automations.js +64 -20
- package/dist/http/routes/automations.js.map +1 -1
- package/dist/http/routes/bundles.d.ts +7 -0
- package/dist/http/routes/bundles.js +181 -0
- package/dist/http/routes/bundles.js.map +1 -0
- package/dist/http/routes/communities.d.ts +7 -0
- package/dist/http/routes/communities.js +462 -0
- package/dist/http/routes/communities.js.map +1 -0
- package/dist/http/routes/community-moderation.d.ts +7 -0
- package/dist/http/routes/community-moderation.js +425 -0
- package/dist/http/routes/community-moderation.js.map +1 -0
- package/dist/http/routes/course-analytics.d.ts +7 -0
- package/dist/http/routes/course-analytics.js +60 -0
- package/dist/http/routes/course-analytics.js.map +1 -0
- package/dist/http/routes/courses.js +38 -23
- package/dist/http/routes/courses.js.map +1 -1
- package/dist/http/routes/dashboard.js +17 -8
- package/dist/http/routes/dashboard.js.map +1 -1
- package/dist/http/routes/discussion.js +35 -27
- package/dist/http/routes/discussion.js.map +1 -1
- package/dist/http/routes/downloads.js +58 -40
- package/dist/http/routes/downloads.js.map +1 -1
- package/dist/http/routes/entitlements.js +16 -7
- package/dist/http/routes/entitlements.js.map +1 -1
- package/dist/http/routes/integrations.js +38 -41
- package/dist/http/routes/integrations.js.map +1 -1
- package/dist/http/routes/member/actor.d.ts +14 -0
- package/dist/http/routes/member/actor.js +11 -0
- package/dist/http/routes/member/actor.js.map +1 -0
- package/dist/http/routes/member/assets.d.ts +7 -0
- package/dist/http/routes/member/assets.js +79 -0
- package/dist/http/routes/member/assets.js.map +1 -0
- package/dist/http/routes/member/chats.d.ts +7 -0
- package/dist/http/routes/member/chats.js +456 -0
- package/dist/http/routes/member/chats.js.map +1 -0
- package/dist/http/routes/member/comments.d.ts +7 -0
- package/dist/http/routes/member/comments.js +187 -0
- package/dist/http/routes/member/comments.js.map +1 -0
- package/dist/http/routes/member/community.d.ts +7 -0
- package/dist/http/routes/member/community.js +288 -0
- package/dist/http/routes/member/community.js.map +1 -0
- package/dist/http/routes/member/courses.d.ts +7 -0
- package/dist/http/routes/member/courses.js +101 -0
- package/dist/http/routes/member/courses.js.map +1 -0
- package/dist/http/routes/member/downloads.d.ts +7 -0
- package/dist/http/routes/member/downloads.js +56 -0
- package/dist/http/routes/member/downloads.js.map +1 -0
- package/dist/http/routes/member/files.d.ts +7 -0
- package/dist/http/routes/member/files.js +184 -0
- package/dist/http/routes/member/files.js.map +1 -0
- package/dist/http/routes/member/index.d.ts +7 -0
- package/dist/http/routes/member/index.js +31 -0
- package/dist/http/routes/member/index.js.map +1 -0
- package/dist/http/routes/member/notifications.d.ts +7 -0
- package/dist/http/routes/member/notifications.js +101 -0
- package/dist/http/routes/member/notifications.js.map +1 -0
- package/dist/http/routes/member/org.d.ts +7 -0
- package/dist/http/routes/member/org.js +56 -0
- package/dist/http/routes/member/org.js.map +1 -0
- package/dist/http/routes/member/posts.d.ts +7 -0
- package/dist/http/routes/member/posts.js +612 -0
- package/dist/http/routes/member/posts.js.map +1 -0
- package/dist/http/routes/member/profile.d.ts +7 -0
- package/dist/http/routes/member/profile.js +48 -0
- package/dist/http/routes/member/profile.js.map +1 -0
- package/dist/http/routes/member/progress.d.ts +7 -0
- package/dist/http/routes/member/progress.js +60 -0
- package/dist/http/routes/member/progress.js.map +1 -0
- package/dist/http/routes/organizations.js +49 -24
- package/dist/http/routes/organizations.js.map +1 -1
- package/dist/http/routes/students.js +43 -37
- package/dist/http/routes/students.js.map +1 -1
- package/dist/http/routes/webhooks.d.ts +7 -0
- package/dist/http/routes/webhooks.js +167 -0
- package/dist/http/routes/webhooks.js.map +1 -0
- package/dist/http/routes.js +14 -2
- package/dist/http/routes.js.map +1 -1
- package/dist/http/schemas/access.d.ts +146 -0
- package/dist/http/schemas/access.js +36 -0
- package/dist/http/schemas/access.js.map +1 -0
- package/dist/http/schemas/activities.d.ts +36 -1
- package/dist/http/schemas/activities.js +9 -4
- package/dist/http/schemas/activities.js.map +1 -1
- package/dist/http/schemas/assets.d.ts +76 -73
- package/dist/http/schemas/assets.js +23 -13
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +85 -8
- package/dist/http/schemas/automations.js +13 -2
- package/dist/http/schemas/automations.js.map +1 -1
- package/dist/http/schemas/bundles.d.ts +63 -0
- package/dist/http/schemas/bundles.js +23 -0
- package/dist/http/schemas/bundles.js.map +1 -0
- package/dist/http/schemas/chats.d.ts +386 -0
- package/dist/http/schemas/chats.js +58 -0
- package/dist/http/schemas/chats.js.map +1 -0
- package/dist/http/schemas/community.d.ts +537 -0
- package/dist/http/schemas/community.js +129 -0
- package/dist/http/schemas/community.js.map +1 -0
- package/dist/http/schemas/content.d.ts +22 -13
- package/dist/http/schemas/content.js +11 -9
- package/dist/http/schemas/content.js.map +1 -1
- package/dist/http/schemas/course-analytics.d.ts +29 -0
- package/dist/http/schemas/course-analytics.js +21 -0
- package/dist/http/schemas/course-analytics.js.map +1 -0
- package/dist/http/schemas/dashboard.js.map +1 -1
- package/dist/http/schemas/discussion.d.ts +85 -23
- package/dist/http/schemas/discussion.js +12 -11
- package/dist/http/schemas/discussion.js.map +1 -1
- package/dist/http/schemas/downloads.d.ts +13 -5
- package/dist/http/schemas/downloads.js +14 -11
- package/dist/http/schemas/downloads.js.map +1 -1
- package/dist/http/schemas/entitlements.d.ts +14 -6
- package/dist/http/schemas/entitlements.js +8 -6
- package/dist/http/schemas/entitlements.js.map +1 -1
- package/dist/http/schemas/files.d.ts +45 -0
- package/dist/http/schemas/files.js +25 -0
- package/dist/http/schemas/files.js.map +1 -0
- package/dist/http/schemas/index.d.ts +19 -10
- package/dist/http/schemas/index.js +19 -10
- package/dist/http/schemas/integrations.d.ts +4 -4
- package/dist/http/schemas/integrations.js.map +1 -1
- package/dist/http/schemas/invites.d.ts +4 -0
- package/dist/http/schemas/invites.js +3 -1
- package/dist/http/schemas/invites.js.map +1 -1
- package/dist/http/schemas/{learn.d.ts → member.d.ts} +42 -19
- package/dist/http/schemas/{learn.js → member.js} +17 -13
- package/dist/http/schemas/member.js.map +1 -0
- package/dist/http/schemas/members.d.ts +39 -6
- package/dist/http/schemas/members.js +17 -3
- package/dist/http/schemas/members.js.map +1 -1
- package/dist/http/schemas/notifications.d.ts +227 -0
- package/dist/http/schemas/notifications.js +44 -0
- package/dist/http/schemas/notifications.js.map +1 -0
- package/dist/http/schemas/organizations.js.map +1 -1
- package/dist/http/schemas/posts.d.ts +316 -0
- package/dist/http/schemas/posts.js +47 -0
- package/dist/http/schemas/posts.js.map +1 -0
- package/dist/http/schemas/profile.d.ts +23 -0
- package/dist/http/schemas/profile.js +15 -0
- package/dist/http/schemas/profile.js.map +1 -0
- package/dist/http/schemas/settings.js.map +1 -1
- package/dist/http/schemas/shared.d.ts +26 -1
- package/dist/http/schemas/shared.js +22 -3
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +32 -10
- package/dist/http/schemas/students.js +19 -6
- package/dist/http/schemas/students.js.map +1 -1
- package/dist/http/scope.d.ts +2 -1
- package/dist/http/scope.js +20 -4
- package/dist/http/scope.js.map +1 -1
- package/dist/http/server.js +10 -3
- package/dist/http/server.js.map +1 -1
- package/dist/http/web-bridge.d.ts +1 -1
- package/dist/http/web-bridge.js +2 -2
- package/dist/http/web-bridge.js.map +1 -1
- package/dist/http/well-known.d.ts +7 -0
- package/dist/http/well-known.js +22 -0
- package/dist/http/well-known.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
- package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
- package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
- package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
- package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
- package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
- package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
- package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
- package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
- package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
- package/dist/packages/server/package.js +6 -0
- package/dist/packages/server/package.js.map +1 -0
- package/package.json +9 -7
- package/dist/app/notifications.d.ts +0 -7
- package/dist/app/notifications.js +0 -23
- package/dist/app/notifications.js.map +0 -1
- package/dist/http/routes/learn/assets.d.ts +0 -8
- package/dist/http/routes/learn/assets.js +0 -32
- package/dist/http/routes/learn/assets.js.map +0 -1
- package/dist/http/routes/learn/comments.d.ts +0 -7
- package/dist/http/routes/learn/comments.js +0 -175
- package/dist/http/routes/learn/comments.js.map +0 -1
- package/dist/http/routes/learn/courses.d.ts +0 -7
- package/dist/http/routes/learn/courses.js +0 -75
- package/dist/http/routes/learn/courses.js.map +0 -1
- package/dist/http/routes/learn/downloads.d.ts +0 -7
- package/dist/http/routes/learn/downloads.js +0 -76
- package/dist/http/routes/learn/downloads.js.map +0 -1
- package/dist/http/routes/learn/index.d.ts +0 -7
- package/dist/http/routes/learn/index.js +0 -19
- package/dist/http/routes/learn/index.js.map +0 -1
- package/dist/http/routes/learn/org.d.ts +0 -7
- package/dist/http/routes/learn/org.js +0 -50
- package/dist/http/routes/learn/org.js.map +0 -1
- package/dist/http/routes/learn/progress.d.ts +0 -7
- package/dist/http/routes/learn/progress.js +0 -63
- package/dist/http/routes/learn/progress.js.map +0 -1
- package/dist/http/schemas/learn.js.map +0 -1
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { PageQuery, refusals } from "../../schemas/shared.js";
|
|
2
|
+
import { CommentView, PostComment, Reactions, SetReaction } from "../../schemas/discussion.js";
|
|
3
|
+
import { CommunitySpaceParam } from "../../schemas/community.js";
|
|
4
|
+
import { CreatePost, FeedQuery, FlagReason, PostCommentsPage, PostFeedPage, PostFlag, PostIdParam, PostView, ResolvePostFlags, SchedulePost, SetPostReactions, SpaceQueue, UpdatePost } from "../../schemas/posts.js";
|
|
5
|
+
import { CommunityParam } from "../../schemas/chats.js";
|
|
6
|
+
import "../../schemas/index.js";
|
|
7
|
+
import { actorOf } from "./actor.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
//#region src/http/routes/member/posts.ts
|
|
10
|
+
async function memberPostRoutes(app, container) {
|
|
11
|
+
const r = app.withTypeProvider();
|
|
12
|
+
const posts = container.posts;
|
|
13
|
+
const tags = ["Posts"];
|
|
14
|
+
r.route({
|
|
15
|
+
method: "GET",
|
|
16
|
+
url: "/api/member/communities/:communityId/feed",
|
|
17
|
+
preHandler: app.requireOrgSession,
|
|
18
|
+
schema: {
|
|
19
|
+
operationId: "getMemberFeed",
|
|
20
|
+
tags,
|
|
21
|
+
summary: "Published posts across the spaces you can open",
|
|
22
|
+
description: "For a member of the community. Pinned posts first, then newest first. 404 when you are not a member.",
|
|
23
|
+
params: CommunityParam,
|
|
24
|
+
querystring: PageQuery,
|
|
25
|
+
response: {
|
|
26
|
+
200: PostFeedPage,
|
|
27
|
+
...refusals(403, 404)
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
handler: async (req) => {
|
|
31
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
32
|
+
return posts.memberFeed(req.orgId, actor, req.params.communityId, req.query);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
r.route({
|
|
36
|
+
method: "GET",
|
|
37
|
+
url: "/api/member/communities/:communityId/own-posts",
|
|
38
|
+
preHandler: app.requireOrgSession,
|
|
39
|
+
schema: {
|
|
40
|
+
operationId: "listOwnPosts",
|
|
41
|
+
tags,
|
|
42
|
+
summary: "Your own posts in a community, newest first",
|
|
43
|
+
description: "For a member of the community. Your posts in any status, drafts included, in the spaces you can open. 404 when you are not a member.",
|
|
44
|
+
params: CommunityParam,
|
|
45
|
+
querystring: PageQuery,
|
|
46
|
+
response: {
|
|
47
|
+
200: PostFeedPage,
|
|
48
|
+
...refusals(403, 404)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
handler: async (req) => {
|
|
52
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
53
|
+
return posts.listOwn(req.orgId, actor, req.params.communityId, req.query);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
r.route({
|
|
57
|
+
method: "GET",
|
|
58
|
+
url: "/api/member/communities/:communityId/bookmarks",
|
|
59
|
+
preHandler: app.requireOrgSession,
|
|
60
|
+
schema: {
|
|
61
|
+
operationId: "listBookmarkedPosts",
|
|
62
|
+
tags,
|
|
63
|
+
summary: "The posts you bookmarked in a community, newest bookmark first",
|
|
64
|
+
description: "For a member of the community. Only posts you can still read. 404 when you are not a member.",
|
|
65
|
+
params: CommunityParam,
|
|
66
|
+
querystring: PageQuery,
|
|
67
|
+
response: {
|
|
68
|
+
200: PostFeedPage,
|
|
69
|
+
...refusals(403, 404)
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
handler: async (req) => {
|
|
73
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
74
|
+
return posts.listBookmarked(req.orgId, actor, req.params.communityId, req.query);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
r.route({
|
|
78
|
+
method: "GET",
|
|
79
|
+
url: "/api/member/communities/:communityId/spaces/:spaceId/feed",
|
|
80
|
+
preHandler: app.requireOrgSession,
|
|
81
|
+
schema: {
|
|
82
|
+
operationId: "getSpaceFeed",
|
|
83
|
+
tags,
|
|
84
|
+
summary: "Published posts in a space",
|
|
85
|
+
description: "For anyone who can open the space (403 otherwise). Filter by `topicId`; an unknown topic is a 404.",
|
|
86
|
+
params: CommunitySpaceParam,
|
|
87
|
+
querystring: FeedQuery,
|
|
88
|
+
response: {
|
|
89
|
+
200: PostFeedPage,
|
|
90
|
+
...refusals(403, 404)
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
handler: async (req) => {
|
|
94
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
95
|
+
return posts.spaceFeed(req.orgId, actor, req.params.communityId, req.params.spaceId, req.query);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
r.route({
|
|
99
|
+
method: "GET",
|
|
100
|
+
url: "/api/member/communities/:communityId/spaces/:spaceId/queue",
|
|
101
|
+
preHandler: app.requireOrgSession,
|
|
102
|
+
schema: {
|
|
103
|
+
operationId: "getSpaceQueue",
|
|
104
|
+
tags,
|
|
105
|
+
summary: "The moderation queue of a space you moderate",
|
|
106
|
+
description: "For a moderator who can open the space. Posts awaiting review, and the open flags on posts and on comments in the space. Each list holds at most the 100 oldest entries: pending posts by creation, flags by when they were raised; working the queue brings in the next ones.",
|
|
107
|
+
params: CommunitySpaceParam,
|
|
108
|
+
response: {
|
|
109
|
+
200: SpaceQueue,
|
|
110
|
+
...refusals(403, 404)
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
handler: async (req) => {
|
|
114
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
115
|
+
return posts.moderationQueue(req.orgId, actor, req.params.communityId, req.params.spaceId);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
r.route({
|
|
119
|
+
method: "POST",
|
|
120
|
+
url: "/api/member/communities/:communityId/spaces/:spaceId/posts",
|
|
121
|
+
preHandler: app.requireOrgSession,
|
|
122
|
+
schema: {
|
|
123
|
+
operationId: "createPost",
|
|
124
|
+
tags,
|
|
125
|
+
summary: "Create a post",
|
|
126
|
+
description: "For anyone who can open the space. `mode` decides the status: `draft`, `scheduled`, or on `submit` `published`, or `pending` when the space requires review and you are not staff. 409 when the space has topics and none is given, or a schedule is missing or in the past.",
|
|
127
|
+
params: CommunitySpaceParam,
|
|
128
|
+
body: CreatePost,
|
|
129
|
+
response: {
|
|
130
|
+
201: PostView,
|
|
131
|
+
...refusals(403, 404, 409)
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
handler: async (req, reply) => {
|
|
135
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
136
|
+
const post = await posts.create(req.orgId, actor, {
|
|
137
|
+
...req.body,
|
|
138
|
+
communityId: req.params.communityId,
|
|
139
|
+
spaceId: req.params.spaceId
|
|
140
|
+
});
|
|
141
|
+
req.log.info({
|
|
142
|
+
postId: post.id,
|
|
143
|
+
status: post.status
|
|
144
|
+
}, "post created");
|
|
145
|
+
return reply.code(201).send(post);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
r.route({
|
|
149
|
+
method: "GET",
|
|
150
|
+
url: "/api/member/posts/:postId",
|
|
151
|
+
preHandler: app.requireOrgSession,
|
|
152
|
+
schema: {
|
|
153
|
+
operationId: "getPost",
|
|
154
|
+
tags,
|
|
155
|
+
summary: "Read a post",
|
|
156
|
+
description: "For anyone who can open the space while the post is published; for its author in any status; for moderators also while it is pending or removed. Any other post is a 404.",
|
|
157
|
+
params: PostIdParam,
|
|
158
|
+
response: {
|
|
159
|
+
200: PostView,
|
|
160
|
+
...refusals(403, 404)
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
handler: async (req) => {
|
|
164
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
165
|
+
return posts.getPost(req.orgId, actor, req.params.postId);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
r.route({
|
|
169
|
+
method: "PATCH",
|
|
170
|
+
url: "/api/member/posts/:postId",
|
|
171
|
+
preHandler: app.requireOrgSession,
|
|
172
|
+
schema: {
|
|
173
|
+
operationId: "updatePost",
|
|
174
|
+
tags,
|
|
175
|
+
summary: "Edit your own post",
|
|
176
|
+
description: "Author only. Changes only the fields sent. 409 when the post is removed, or the topic rules of the space are not met.",
|
|
177
|
+
params: PostIdParam,
|
|
178
|
+
body: UpdatePost,
|
|
179
|
+
response: {
|
|
180
|
+
200: PostView,
|
|
181
|
+
...refusals(403, 404, 409)
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
handler: async (req) => {
|
|
185
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
186
|
+
return posts.update(req.orgId, req.params.postId, actor, req.body);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
r.route({
|
|
190
|
+
method: "POST",
|
|
191
|
+
url: "/api/member/posts/:postId/submission",
|
|
192
|
+
preHandler: app.requireOrgSession,
|
|
193
|
+
schema: {
|
|
194
|
+
operationId: "submitPost",
|
|
195
|
+
tags,
|
|
196
|
+
summary: "Submit your draft or scheduled post",
|
|
197
|
+
description: "Author only. Publishes it now, or holds it for review when the space requires review and you are not staff. 409 when the post is not a draft or scheduled.",
|
|
198
|
+
params: PostIdParam,
|
|
199
|
+
response: {
|
|
200
|
+
200: PostView,
|
|
201
|
+
...refusals(403, 404, 409)
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
handler: async (req) => {
|
|
205
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
206
|
+
return posts.submit(req.orgId, req.params.postId, actor);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
r.route({
|
|
210
|
+
method: "POST",
|
|
211
|
+
url: "/api/member/posts/:postId/schedule",
|
|
212
|
+
preHandler: app.requireOrgSession,
|
|
213
|
+
schema: {
|
|
214
|
+
operationId: "schedulePost",
|
|
215
|
+
tags,
|
|
216
|
+
summary: "Schedule your post",
|
|
217
|
+
description: "Author only. The post is submitted at `scheduledAt`. 409 when it is already submitted or removed, or the time is not in the future.",
|
|
218
|
+
params: PostIdParam,
|
|
219
|
+
body: SchedulePost,
|
|
220
|
+
response: {
|
|
221
|
+
200: PostView,
|
|
222
|
+
...refusals(403, 404, 409)
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
handler: async (req) => {
|
|
226
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
227
|
+
return posts.schedule(req.orgId, req.params.postId, actor, req.body.scheduledAt);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
r.route({
|
|
231
|
+
method: "POST",
|
|
232
|
+
url: "/api/member/posts/:postId/approval",
|
|
233
|
+
preHandler: app.requireOrgSession,
|
|
234
|
+
schema: {
|
|
235
|
+
operationId: "approvePost",
|
|
236
|
+
tags,
|
|
237
|
+
summary: "Publish a post that awaits review in a space you moderate",
|
|
238
|
+
description: "For a moderator who can open the space. 409 when the post is not awaiting review.",
|
|
239
|
+
params: PostIdParam,
|
|
240
|
+
response: {
|
|
241
|
+
200: PostView,
|
|
242
|
+
...refusals(403, 404, 409)
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
handler: async (req) => {
|
|
246
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
247
|
+
return posts.approve(req.orgId, req.params.postId, actor);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
r.route({
|
|
251
|
+
method: "POST",
|
|
252
|
+
url: "/api/member/posts/:postId/removal",
|
|
253
|
+
preHandler: app.requireOrgSession,
|
|
254
|
+
schema: {
|
|
255
|
+
operationId: "removePost",
|
|
256
|
+
tags,
|
|
257
|
+
summary: "Remove your post, or one in a space you moderate",
|
|
258
|
+
description: "For the author or a moderator. Takes a published or pending post down; a moderator removing someone else's post resolves its open flags as `removed`. 409 when it is already removed or was never submitted.",
|
|
259
|
+
params: PostIdParam,
|
|
260
|
+
response: {
|
|
261
|
+
200: PostView,
|
|
262
|
+
...refusals(403, 404, 409)
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
handler: async (req) => {
|
|
266
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
267
|
+
return posts.remove(req.orgId, req.params.postId, actor);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
r.route({
|
|
271
|
+
method: "POST",
|
|
272
|
+
url: "/api/member/posts/:postId/restoration",
|
|
273
|
+
preHandler: app.requireOrgSession,
|
|
274
|
+
schema: {
|
|
275
|
+
operationId: "restorePost",
|
|
276
|
+
tags,
|
|
277
|
+
summary: "Restore a removed post in a space you moderate",
|
|
278
|
+
description: "For a moderator who can open the space. 409 when the post is not removed.",
|
|
279
|
+
params: PostIdParam,
|
|
280
|
+
response: {
|
|
281
|
+
200: PostView,
|
|
282
|
+
...refusals(403, 404, 409)
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
handler: async (req) => {
|
|
286
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
287
|
+
return posts.restore(req.orgId, req.params.postId, actor);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
r.route({
|
|
291
|
+
method: "POST",
|
|
292
|
+
url: "/api/member/posts/:postId/pin",
|
|
293
|
+
preHandler: app.requireOrgSession,
|
|
294
|
+
schema: {
|
|
295
|
+
operationId: "pinPost",
|
|
296
|
+
tags,
|
|
297
|
+
summary: "Pin a post in a space you moderate",
|
|
298
|
+
description: "For a moderator. Pinned posts lead the feeds. 409 when the post is removed.",
|
|
299
|
+
params: PostIdParam,
|
|
300
|
+
response: {
|
|
301
|
+
200: PostView,
|
|
302
|
+
...refusals(403, 404, 409)
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
handler: async (req) => {
|
|
306
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
307
|
+
return posts.pin(req.orgId, req.params.postId, actor);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
r.route({
|
|
311
|
+
method: "POST",
|
|
312
|
+
url: "/api/member/posts/:postId/unpin",
|
|
313
|
+
preHandler: app.requireOrgSession,
|
|
314
|
+
schema: {
|
|
315
|
+
operationId: "unpinPost",
|
|
316
|
+
tags,
|
|
317
|
+
summary: "Unpin a post in a space you moderate",
|
|
318
|
+
description: "For a moderator. 409 when the post is removed.",
|
|
319
|
+
params: PostIdParam,
|
|
320
|
+
response: {
|
|
321
|
+
200: PostView,
|
|
322
|
+
...refusals(403, 404, 409)
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
handler: async (req) => {
|
|
326
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
327
|
+
return posts.unpin(req.orgId, req.params.postId, actor);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
r.route({
|
|
331
|
+
method: "POST",
|
|
332
|
+
url: "/api/member/posts/:postId/comments/close",
|
|
333
|
+
preHandler: app.requireOrgSession,
|
|
334
|
+
schema: {
|
|
335
|
+
operationId: "closePostComments",
|
|
336
|
+
tags,
|
|
337
|
+
summary: "Close comments on a post in a space you moderate",
|
|
338
|
+
description: "For a moderator. Nobody can comment until they are opened again. 409 when the post is removed.",
|
|
339
|
+
params: PostIdParam,
|
|
340
|
+
response: {
|
|
341
|
+
200: PostView,
|
|
342
|
+
...refusals(403, 404, 409)
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
handler: async (req) => {
|
|
346
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
347
|
+
return posts.closeComments(req.orgId, req.params.postId, actor);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
r.route({
|
|
351
|
+
method: "POST",
|
|
352
|
+
url: "/api/member/posts/:postId/comments/open",
|
|
353
|
+
preHandler: app.requireOrgSession,
|
|
354
|
+
schema: {
|
|
355
|
+
operationId: "openPostComments",
|
|
356
|
+
tags,
|
|
357
|
+
summary: "Open comments on a post in a space you moderate",
|
|
358
|
+
description: "For a moderator. 409 when the post is removed.",
|
|
359
|
+
params: PostIdParam,
|
|
360
|
+
response: {
|
|
361
|
+
200: PostView,
|
|
362
|
+
...refusals(403, 404, 409)
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
handler: async (req) => {
|
|
366
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
367
|
+
return posts.openComments(req.orgId, req.params.postId, actor);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
r.route({
|
|
371
|
+
method: "PUT",
|
|
372
|
+
url: "/api/member/posts/:postId/reactions",
|
|
373
|
+
preHandler: app.requireOrgSession,
|
|
374
|
+
schema: {
|
|
375
|
+
operationId: "setPostReactionPolicy",
|
|
376
|
+
tags,
|
|
377
|
+
summary: "Turn reactions on or off for a post in a space you moderate",
|
|
378
|
+
description: "For a moderator. Overrides the space's reactions setting for this post. 409 when the post is removed.",
|
|
379
|
+
params: PostIdParam,
|
|
380
|
+
body: SetPostReactions,
|
|
381
|
+
response: {
|
|
382
|
+
200: PostView,
|
|
383
|
+
...refusals(403, 404, 409)
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
handler: async (req) => {
|
|
387
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
388
|
+
return posts.setReactions(req.orgId, req.params.postId, actor, req.body.enabled);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
r.route({
|
|
392
|
+
method: "PUT",
|
|
393
|
+
url: "/api/member/posts/:postId/reaction",
|
|
394
|
+
preHandler: app.requireOrgSession,
|
|
395
|
+
schema: {
|
|
396
|
+
operationId: "setPostReaction",
|
|
397
|
+
tags,
|
|
398
|
+
summary: "Set your reaction on a post",
|
|
399
|
+
description: "For anyone who can read the post, while reactions are on for it (403 otherwise). Replaces any reaction you already had and returns the new counts.",
|
|
400
|
+
params: PostIdParam,
|
|
401
|
+
body: SetReaction,
|
|
402
|
+
response: {
|
|
403
|
+
200: Reactions,
|
|
404
|
+
...refusals(403, 404)
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
handler: async (req) => {
|
|
408
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
409
|
+
return posts.setReaction(req.orgId, req.params.postId, actor, req.body.emoji);
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
r.route({
|
|
413
|
+
method: "DELETE",
|
|
414
|
+
url: "/api/member/posts/:postId/reaction",
|
|
415
|
+
preHandler: app.requireOrgSession,
|
|
416
|
+
schema: {
|
|
417
|
+
operationId: "clearPostReaction",
|
|
418
|
+
tags,
|
|
419
|
+
summary: "Withdraw your reaction from a post",
|
|
420
|
+
description: "For anyone who can read the post, while reactions are on for it (403 otherwise). Returns the new counts.",
|
|
421
|
+
params: PostIdParam,
|
|
422
|
+
response: {
|
|
423
|
+
200: Reactions,
|
|
424
|
+
...refusals(403, 404)
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
handler: async (req) => {
|
|
428
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
429
|
+
return posts.setReaction(req.orgId, req.params.postId, actor, null);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
r.route({
|
|
433
|
+
method: "POST",
|
|
434
|
+
url: "/api/member/posts/:postId/follow",
|
|
435
|
+
preHandler: app.requireOrgSession,
|
|
436
|
+
schema: {
|
|
437
|
+
operationId: "followPost",
|
|
438
|
+
tags,
|
|
439
|
+
summary: "Follow a post",
|
|
440
|
+
description: "For anyone who can read the post. You are notified of new comments on it. Following twice is harmless.",
|
|
441
|
+
params: PostIdParam,
|
|
442
|
+
response: {
|
|
443
|
+
204: z.void(),
|
|
444
|
+
...refusals(403, 404)
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
handler: async (req, reply) => {
|
|
448
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
449
|
+
await posts.follow(req.orgId, req.params.postId, actor);
|
|
450
|
+
return reply.code(204).send();
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
r.route({
|
|
454
|
+
method: "DELETE",
|
|
455
|
+
url: "/api/member/posts/:postId/follow",
|
|
456
|
+
preHandler: app.requireOrgSession,
|
|
457
|
+
schema: {
|
|
458
|
+
operationId: "unfollowPost",
|
|
459
|
+
tags,
|
|
460
|
+
summary: "Stop following a post",
|
|
461
|
+
description: "For anyone who can read the post. Harmless when you do not follow it.",
|
|
462
|
+
params: PostIdParam,
|
|
463
|
+
response: {
|
|
464
|
+
204: z.void(),
|
|
465
|
+
...refusals(403, 404)
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
handler: async (req, reply) => {
|
|
469
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
470
|
+
await posts.unfollow(req.orgId, req.params.postId, actor);
|
|
471
|
+
return reply.code(204).send();
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
r.route({
|
|
475
|
+
method: "POST",
|
|
476
|
+
url: "/api/member/posts/:postId/bookmark",
|
|
477
|
+
preHandler: app.requireOrgSession,
|
|
478
|
+
schema: {
|
|
479
|
+
operationId: "bookmarkPost",
|
|
480
|
+
tags,
|
|
481
|
+
summary: "Bookmark a post",
|
|
482
|
+
description: "For anyone who can read the post. Bookmarking twice is harmless.",
|
|
483
|
+
params: PostIdParam,
|
|
484
|
+
response: {
|
|
485
|
+
204: z.void(),
|
|
486
|
+
...refusals(403, 404)
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
handler: async (req, reply) => {
|
|
490
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
491
|
+
await posts.bookmark(req.orgId, req.params.postId, actor);
|
|
492
|
+
return reply.code(204).send();
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
r.route({
|
|
496
|
+
method: "DELETE",
|
|
497
|
+
url: "/api/member/posts/:postId/bookmark",
|
|
498
|
+
preHandler: app.requireOrgSession,
|
|
499
|
+
schema: {
|
|
500
|
+
operationId: "unbookmarkPost",
|
|
501
|
+
tags,
|
|
502
|
+
summary: "Remove a bookmark",
|
|
503
|
+
description: "For anyone who can read the post. Harmless when you have not bookmarked it.",
|
|
504
|
+
params: PostIdParam,
|
|
505
|
+
response: {
|
|
506
|
+
204: z.void(),
|
|
507
|
+
...refusals(403, 404)
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
handler: async (req, reply) => {
|
|
511
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
512
|
+
await posts.unbookmark(req.orgId, req.params.postId, actor);
|
|
513
|
+
return reply.code(204).send();
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
r.route({
|
|
517
|
+
method: "POST",
|
|
518
|
+
url: "/api/member/posts/:postId/flags",
|
|
519
|
+
preHandler: app.requireOrgSession,
|
|
520
|
+
schema: {
|
|
521
|
+
operationId: "flagPost",
|
|
522
|
+
tags,
|
|
523
|
+
summary: "Flag a post for the moderators",
|
|
524
|
+
description: "For anyone who can read the post. Flagging it again while your flag is open returns that flag.",
|
|
525
|
+
params: PostIdParam,
|
|
526
|
+
body: FlagReason,
|
|
527
|
+
response: {
|
|
528
|
+
201: PostFlag,
|
|
529
|
+
...refusals(403, 404)
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
handler: async (req, reply) => {
|
|
533
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
534
|
+
const flag = await posts.flag(req.orgId, req.params.postId, actor, req.body.reason);
|
|
535
|
+
return reply.code(201).send(flag);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
r.route({
|
|
539
|
+
method: "POST",
|
|
540
|
+
url: "/api/member/posts/:postId/flags/resolution",
|
|
541
|
+
preHandler: app.requireOrgSession,
|
|
542
|
+
schema: {
|
|
543
|
+
operationId: "resolvePostFlags",
|
|
544
|
+
tags,
|
|
545
|
+
summary: "Dismiss the open flags on a post in a space you moderate",
|
|
546
|
+
description: "For a moderator who can open the space. Closes every open flag and leaves the post up.",
|
|
547
|
+
params: PostIdParam,
|
|
548
|
+
body: ResolvePostFlags,
|
|
549
|
+
response: {
|
|
550
|
+
204: z.void(),
|
|
551
|
+
...refusals(403, 404)
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
handler: async (req, reply) => {
|
|
555
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
556
|
+
await posts.resolveFlags(req.orgId, req.params.postId, actor, req.body.resolution);
|
|
557
|
+
return reply.code(204).send();
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
r.route({
|
|
561
|
+
method: "GET",
|
|
562
|
+
url: "/api/member/posts/:postId/comments",
|
|
563
|
+
preHandler: app.requireOrgSession,
|
|
564
|
+
schema: {
|
|
565
|
+
operationId: "listPostComments",
|
|
566
|
+
tags,
|
|
567
|
+
summary: "Read a post's comments",
|
|
568
|
+
description: "For anyone who can read the post. Pages by top-level comment, oldest first. Each page carries its top-level comments and all of their replies; `total` counts top-level comments.",
|
|
569
|
+
params: PostIdParam,
|
|
570
|
+
querystring: PageQuery,
|
|
571
|
+
response: {
|
|
572
|
+
200: PostCommentsPage,
|
|
573
|
+
...refusals(403, 404)
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
handler: async (req) => {
|
|
577
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
578
|
+
return container.discussion.postComments(req.orgId, req.params.postId, actor, req.query);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
r.route({
|
|
582
|
+
method: "POST",
|
|
583
|
+
url: "/api/member/posts/:postId/comments",
|
|
584
|
+
preHandler: app.requireOrgSession,
|
|
585
|
+
schema: {
|
|
586
|
+
operationId: "createPostComment",
|
|
587
|
+
tags,
|
|
588
|
+
summary: "Comment on a post",
|
|
589
|
+
description: "For anyone who can read the post, while its comments are open (403 otherwise). Replies nest one level. 409 when the post is not published.",
|
|
590
|
+
params: PostIdParam,
|
|
591
|
+
body: PostComment,
|
|
592
|
+
response: {
|
|
593
|
+
201: CommentView,
|
|
594
|
+
...refusals(403, 404, 409)
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
handler: async (req, reply) => {
|
|
598
|
+
const actor = await actorOf(container, req.orgId, req.userId);
|
|
599
|
+
const comment = await container.discussion.postComment(req.orgId, {
|
|
600
|
+
actor,
|
|
601
|
+
postId: req.params.postId,
|
|
602
|
+
parentId: req.body.parentId,
|
|
603
|
+
body: req.body.body
|
|
604
|
+
});
|
|
605
|
+
return reply.code(201).send(comment);
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
export { memberPostRoutes };
|
|
611
|
+
|
|
612
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","names":[],"sources":["../../../../src/http/routes/member/posts.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport { z } from 'zod';\nimport type { Container } from '../../../app/container.js';\nimport { actorOf } from './actor.js';\nimport {\n CommentView,\n CommunityParam,\n CommunitySpaceParam,\n CreatePost,\n FeedQuery,\n FlagReason,\n PageQuery,\n PostCommentsPage,\n PostComment,\n PostFeedPage,\n PostFlag,\n PostIdParam,\n PostView,\n Reactions,\n ResolvePostFlags,\n SchedulePost,\n SetPostReactions,\n SetReaction,\n SpaceQueue,\n UpdatePost,\n refusals,\n} from '../../schemas/index.js';\n\nexport async function memberPostRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const posts = container.posts;\n const tags = ['Posts'];\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/feed',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getMemberFeed',\n tags,\n summary: 'Published posts across the spaces you can open',\n description:\n 'For a member of the community. Pinned posts first, then newest first. 404 when you are not a member.',\n params: CommunityParam,\n querystring: PageQuery,\n response: { 200: PostFeedPage, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.memberFeed(req.orgId, actor, req.params.communityId, req.query);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/own-posts',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listOwnPosts',\n tags,\n summary: 'Your own posts in a community, newest first',\n description:\n 'For a member of the community. Your posts in any status, drafts included, in the spaces you can open. 404 when you are not a member.',\n params: CommunityParam,\n querystring: PageQuery,\n response: { 200: PostFeedPage, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.listOwn(req.orgId, actor, req.params.communityId, req.query);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/bookmarks',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listBookmarkedPosts',\n tags,\n summary: 'The posts you bookmarked in a community, newest bookmark first',\n description:\n 'For a member of the community. Only posts you can still read. 404 when you are not a member.',\n params: CommunityParam,\n querystring: PageQuery,\n response: { 200: PostFeedPage, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.listBookmarked(req.orgId, actor, req.params.communityId, req.query);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/spaces/:spaceId/feed',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getSpaceFeed',\n tags,\n summary: 'Published posts in a space',\n description:\n 'For anyone who can open the space (403 otherwise). Filter by `topicId`; an unknown topic is a 404.',\n params: CommunitySpaceParam,\n querystring: FeedQuery,\n response: { 200: PostFeedPage, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.spaceFeed(\n req.orgId,\n actor,\n req.params.communityId,\n req.params.spaceId,\n req.query,\n );\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/spaces/:spaceId/queue',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getSpaceQueue',\n tags,\n summary: 'The moderation queue of a space you moderate',\n description:\n 'For a moderator who can open the space. Posts awaiting review, and the open flags on posts and on comments in the space. Each list holds at most the 100 oldest entries: pending posts by creation, flags by when they were raised; working the queue brings in the next ones.',\n params: CommunitySpaceParam,\n response: { 200: SpaceQueue, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.moderationQueue(req.orgId, actor, req.params.communityId, req.params.spaceId);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/communities/:communityId/spaces/:spaceId/posts',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'createPost',\n tags,\n summary: 'Create a post',\n description:\n 'For anyone who can open the space. `mode` decides the status: `draft`, `scheduled`, or on `submit` `published`, or `pending` when the space requires review and you are not staff. 409 when the space has topics and none is given, or a schedule is missing or in the past.',\n params: CommunitySpaceParam,\n body: CreatePost,\n response: { 201: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n const post = await posts.create(req.orgId, actor, {\n ...req.body,\n communityId: req.params.communityId,\n spaceId: req.params.spaceId,\n });\n req.log.info({ postId: post.id, status: post.status }, 'post created');\n return reply.code(201).send(post);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getPost',\n tags,\n summary: 'Read a post',\n description:\n 'For anyone who can open the space while the post is published; for its author in any status; for moderators also while it is pending or removed. Any other post is a 404.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.getPost(req.orgId, actor, req.params.postId);\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/member/posts/:postId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'updatePost',\n tags,\n summary: 'Edit your own post',\n description:\n 'Author only. Changes only the fields sent. 409 when the post is removed, or the topic rules of the space are not met.',\n params: PostIdParam,\n body: UpdatePost,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.update(req.orgId, req.params.postId, actor, req.body);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/submission',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'submitPost',\n tags,\n summary: 'Submit your draft or scheduled post',\n description:\n 'Author only. Publishes it now, or holds it for review when the space requires review and you are not staff. 409 when the post is not a draft or scheduled.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.submit(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/schedule',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'schedulePost',\n tags,\n summary: 'Schedule your post',\n description:\n 'Author only. The post is submitted at `scheduledAt`. 409 when it is already submitted or removed, or the time is not in the future.',\n params: PostIdParam,\n body: SchedulePost,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.schedule(req.orgId, req.params.postId, actor, req.body.scheduledAt);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/approval',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'approvePost',\n tags,\n summary: 'Publish a post that awaits review in a space you moderate',\n description:\n 'For a moderator who can open the space. 409 when the post is not awaiting review.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.approve(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/removal',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'removePost',\n tags,\n summary: 'Remove your post, or one in a space you moderate',\n description:\n \"For the author or a moderator. Takes a published or pending post down; a moderator removing someone else's post resolves its open flags as `removed`. 409 when it is already removed or was never submitted.\",\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.remove(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/restoration',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'restorePost',\n tags,\n summary: 'Restore a removed post in a space you moderate',\n description: 'For a moderator who can open the space. 409 when the post is not removed.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.restore(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/pin',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'pinPost',\n tags,\n summary: 'Pin a post in a space you moderate',\n description: 'For a moderator. Pinned posts lead the feeds. 409 when the post is removed.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.pin(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/unpin',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'unpinPost',\n tags,\n summary: 'Unpin a post in a space you moderate',\n description: 'For a moderator. 409 when the post is removed.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.unpin(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/comments/close',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'closePostComments',\n tags,\n summary: 'Close comments on a post in a space you moderate',\n description:\n 'For a moderator. Nobody can comment until they are opened again. 409 when the post is removed.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.closeComments(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/comments/open',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'openPostComments',\n tags,\n summary: 'Open comments on a post in a space you moderate',\n description: 'For a moderator. 409 when the post is removed.',\n params: PostIdParam,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.openComments(req.orgId, req.params.postId, actor);\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/member/posts/:postId/reactions',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'setPostReactionPolicy',\n tags,\n summary: 'Turn reactions on or off for a post in a space you moderate',\n description:\n \"For a moderator. Overrides the space's reactions setting for this post. 409 when the post is removed.\",\n params: PostIdParam,\n body: SetPostReactions,\n response: { 200: PostView, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.setReactions(req.orgId, req.params.postId, actor, req.body.enabled);\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/member/posts/:postId/reaction',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'setPostReaction',\n tags,\n summary: 'Set your reaction on a post',\n description:\n 'For anyone who can read the post, while reactions are on for it (403 otherwise). Replaces any reaction you already had and returns the new counts.',\n params: PostIdParam,\n body: SetReaction,\n response: { 200: Reactions, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.setReaction(req.orgId, req.params.postId, actor, req.body.emoji);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/member/posts/:postId/reaction',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'clearPostReaction',\n tags,\n summary: 'Withdraw your reaction from a post',\n description:\n 'For anyone who can read the post, while reactions are on for it (403 otherwise). Returns the new counts.',\n params: PostIdParam,\n response: { 200: Reactions, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return posts.setReaction(req.orgId, req.params.postId, actor, null);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/follow',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'followPost',\n tags,\n summary: 'Follow a post',\n description:\n 'For anyone who can read the post. You are notified of new comments on it. Following twice is harmless.',\n params: PostIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n await posts.follow(req.orgId, req.params.postId, actor);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/member/posts/:postId/follow',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'unfollowPost',\n tags,\n summary: 'Stop following a post',\n description: 'For anyone who can read the post. Harmless when you do not follow it.',\n params: PostIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n await posts.unfollow(req.orgId, req.params.postId, actor);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/bookmark',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'bookmarkPost',\n tags,\n summary: 'Bookmark a post',\n description: 'For anyone who can read the post. Bookmarking twice is harmless.',\n params: PostIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n await posts.bookmark(req.orgId, req.params.postId, actor);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/member/posts/:postId/bookmark',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'unbookmarkPost',\n tags,\n summary: 'Remove a bookmark',\n description: 'For anyone who can read the post. Harmless when you have not bookmarked it.',\n params: PostIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n await posts.unbookmark(req.orgId, req.params.postId, actor);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/flags',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'flagPost',\n tags,\n summary: 'Flag a post for the moderators',\n description:\n 'For anyone who can read the post. Flagging it again while your flag is open returns that flag.',\n params: PostIdParam,\n body: FlagReason,\n response: { 201: PostFlag, ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n const flag = await posts.flag(req.orgId, req.params.postId, actor, req.body.reason);\n return reply.code(201).send(flag);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/flags/resolution',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'resolvePostFlags',\n tags,\n summary: 'Dismiss the open flags on a post in a space you moderate',\n description:\n 'For a moderator who can open the space. Closes every open flag and leaves the post up.',\n params: PostIdParam,\n body: ResolvePostFlags,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n await posts.resolveFlags(req.orgId, req.params.postId, actor, req.body.resolution);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId/comments',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listPostComments',\n tags,\n summary: \"Read a post's comments\",\n description:\n 'For anyone who can read the post. Pages by top-level comment, oldest first. Each page carries its top-level comments and all of their replies; `total` counts top-level comments.',\n params: PostIdParam,\n querystring: PageQuery,\n response: { 200: PostCommentsPage, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n return container.discussion.postComments(req.orgId, req.params.postId, actor, req.query);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/member/posts/:postId/comments',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'createPostComment',\n tags,\n summary: 'Comment on a post',\n description:\n 'For anyone who can read the post, while its comments are open (403 otherwise). Replies nest one level. 409 when the post is not published.',\n params: PostIdParam,\n body: PostComment,\n response: { 201: CommentView, ...refusals(403, 404, 409) },\n },\n handler: async (req, reply) => {\n const actor = await actorOf(container, req.orgId, req.userId);\n const comment = await container.discussion.postComment(req.orgId, {\n actor,\n postId: req.params.postId,\n parentId: req.body.parentId,\n body: req.body.body,\n });\n return reply.code(201).send(comment);\n },\n });\n}\n"],"mappings":";;;;;;;;;AA6BA,eAAsB,iBAAiB,KAAsB,WAAqC;CAChG,MAAM,IAAI,IAAI,iBAAkC;CAChD,MAAM,QAAQ,UAAU;CACxB,MAAM,OAAO,CAAC,OAAO;CAErB,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aACE;GACF,QAAQ;GACR,aAAa;GACb,UAAU;IAAE,KAAK;IAAc,GAAG,SAAS,KAAK,GAAG;GAAE;EACvD;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM;GAC5D,OAAO,MAAM,WAAW,IAAI,OAAO,OAAO,IAAI,OAAO,aAAa,IAAI,KAAK;EAC7E;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aACE;GACF,QAAQ;GACR,aAAa;GACb,UAAU;IAAE,KAAK;IAAc,GAAG,SAAS,KAAK,GAAG;GAAE;EACvD;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM;GAC5D,OAAO,MAAM,QAAQ,IAAI,OAAO,OAAO,IAAI,OAAO,aAAa,IAAI,KAAK;EAC1E;CACF,CAAC;CAED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;IAAE,KAAK;IAAa,GAAG,SAAS,KAAK,KAAK,GAAG;GAAE;EAC3D;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,QAAQ,MAAM,QAAQ,WAAW,IAAI,OAAO,IAAI,MAAM;GAC5D,MAAM,UAAU,MAAM,UAAU,WAAW,YAAY,IAAI,OAAO;IAChE;IACA,QAAQ,IAAI,OAAO;IACnB,UAAU,IAAI,KAAK;IACnB,MAAM,IAAI,KAAK;GACjB,CAAC;GACD,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,OAAO;EACrC;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Container } from "../../../app/container.js";
|
|
2
|
+
import { FastifyInstance } from "fastify";
|
|
3
|
+
//#region src/http/routes/member/profile.d.ts
|
|
4
|
+
declare function memberProfileRoutes(app: FastifyInstance, container: Container): Promise<void>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { memberProfileRoutes };
|
|
7
|
+
//# sourceMappingURL=profile.d.ts.map
|