@headless-lms/server 0.2.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/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 +18 -14
- package/dist/app/container.js +136 -43
- 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 +2 -1
- package/dist/http/plugins/error-handler.js +49 -65
- package/dist/http/plugins/error-handler.js.map +1 -1
- package/dist/http/plugins/openapi.js +49 -2
- 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 +68 -23
- package/dist/http/routes/activities.js.map +1 -1
- package/dist/http/routes/assets.js +60 -55
- package/dist/http/routes/assets.js.map +1 -1
- package/dist/http/routes/automations.js +44 -24
- package/dist/http/routes/automations.js.map +1 -1
- package/dist/http/routes/bundles.js +29 -18
- package/dist/http/routes/bundles.js.map +1 -1
- 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.js +9 -7
- package/dist/http/routes/course-analytics.js.map +1 -1
- package/dist/http/routes/courses.js +30 -15
- package/dist/http/routes/courses.js.map +1 -1
- package/dist/http/routes/dashboard.js +15 -6
- package/dist/http/routes/dashboard.js.map +1 -1
- package/dist/http/routes/discussion.js +34 -26
- package/dist/http/routes/discussion.js.map +1 -1
- package/dist/http/routes/downloads.js +48 -30
- 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 +32 -47
- package/dist/http/routes/students.js.map +1 -1
- package/dist/http/routes/webhooks.js +26 -18
- package/dist/http/routes/webhooks.js.map +1 -1
- package/dist/http/routes.js +8 -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 +3 -1
- package/dist/http/schemas/activities.js +4 -4
- package/dist/http/schemas/activities.js.map +1 -1
- package/dist/http/schemas/assets.d.ts +73 -74
- package/dist/http/schemas/assets.js +23 -13
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +10 -0
- package/dist/http/schemas/bundles.js +6 -6
- package/dist/http/schemas/bundles.js.map +1 -1
- 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 +4 -2
- package/dist/http/schemas/content.js +11 -8
- package/dist/http/schemas/content.js.map +1 -1
- package/dist/http/schemas/discussion.d.ts +76 -14
- package/dist/http/schemas/discussion.js +12 -11
- package/dist/http/schemas/discussion.js.map +1 -1
- package/dist/http/schemas/downloads.d.ts +11 -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 +6 -6
- package/dist/http/schemas/entitlements.js +6 -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 +15 -8
- package/dist/http/schemas/index.js +15 -8
- package/dist/http/schemas/integrations.d.ts +2 -2
- package/dist/http/schemas/invites.d.ts +4 -0
- package/dist/http/schemas/invites.js +1 -0
- package/dist/http/schemas/invites.js.map +1 -1
- package/dist/http/schemas/{learn.d.ts → member.d.ts} +31 -18
- 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/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/shared.d.ts +25 -1
- package/dist/http/schemas/shared.js +19 -2
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +4 -10
- package/dist/http/schemas/students.js +1 -7
- 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 +6 -1
- 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 +2 -1
- 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 -26
- 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 -98
- 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
- package/dist/package.js +0 -6
- package/dist/package.js.map +0 -1
|
@@ -49,6 +49,7 @@ declare const Course: z.ZodObject<{
|
|
|
49
49
|
}, z.core.$strict>;
|
|
50
50
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
51
51
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
52
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
52
53
|
}, z.core.$strict>;
|
|
53
54
|
type Course = z.infer<typeof Course>;
|
|
54
55
|
declare const CreateCourse: z.ZodObject<{
|
|
@@ -59,8 +60,8 @@ declare const CreateCourse: z.ZodObject<{
|
|
|
59
60
|
type CreateCourse = z.infer<typeof CreateCourse>;
|
|
60
61
|
declare const UpdateCourse: z.ZodObject<{
|
|
61
62
|
title: z.ZodOptional<z.ZodString>;
|
|
62
|
-
description: z.ZodOptional<z.
|
|
63
|
-
category: z.ZodOptional<z.
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
category: z.ZodOptional<z.ZodString>;
|
|
64
65
|
status: z.ZodOptional<z.ZodEnum<{
|
|
65
66
|
draft: "draft";
|
|
66
67
|
published: "published";
|
|
@@ -105,6 +106,7 @@ declare const CoursesPage: z.ZodObject<{
|
|
|
105
106
|
}, z.core.$strict>;
|
|
106
107
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
107
108
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
109
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
108
110
|
}, z.core.$strict>>;
|
|
109
111
|
total: z.ZodNumber;
|
|
110
112
|
page: z.ZodNumber;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { courseSettingsSchema, courseStatusSchema, courseViewSchema, idSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/content.ts
|
|
5
5
|
const CourseStatus = courseStatusSchema;
|
|
6
6
|
const CourseSettings = courseSettingsSchema;
|
|
7
7
|
const PatchCourseSettings = CourseSettings.partial();
|
|
8
|
-
const Course =
|
|
8
|
+
const Course = courseViewSchema;
|
|
9
9
|
const CreateCourse = z.object({
|
|
10
|
-
title: z.string().min(1),
|
|
11
|
-
description: z.string().default(""),
|
|
12
|
-
category: z.string().default("")
|
|
10
|
+
title: z.string().trim().min(1).max(200),
|
|
11
|
+
description: z.string().max(5e3).default(""),
|
|
12
|
+
category: z.string().trim().max(100).default("")
|
|
13
13
|
});
|
|
14
|
-
const UpdateCourse =
|
|
14
|
+
const UpdateCourse = z.object({
|
|
15
|
+
title: z.string().trim().min(1).max(200).optional(),
|
|
16
|
+
description: z.string().max(5e3).optional(),
|
|
17
|
+
category: z.string().trim().max(100).optional(),
|
|
15
18
|
status: CourseStatus.optional(),
|
|
16
19
|
/** null clears the cover. */
|
|
17
|
-
thumbnailAssetId:
|
|
20
|
+
thumbnailAssetId: idSchema.nullable().optional()
|
|
18
21
|
});
|
|
19
22
|
const CoursesQuery = ListQuery.extend({
|
|
20
23
|
status: CourseStatus.optional(),
|
|
21
|
-
category: z.string().optional()
|
|
24
|
+
category: z.string().trim().max(100).optional()
|
|
22
25
|
});
|
|
23
26
|
const CoursesPage = paginated(Course);
|
|
24
27
|
const CourseIdParam = z.object({ id: z.string() });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from 'zod';\nimport {
|
|
1
|
+
{"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from 'zod';\nimport {\n courseSettingsSchema,\n courseStatusSchema,\n courseViewSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const CourseStatus = courseStatusSchema;\nexport type CourseStatus = z.infer<typeof CourseStatus>;\n\nexport const CourseSettings = courseSettingsSchema;\nexport type CourseSettings = z.infer<typeof CourseSettings>;\n\nexport const PatchCourseSettings = CourseSettings.partial();\nexport type PatchCourseSettings = z.infer<typeof PatchCourseSettings>;\n\nexport const Course = courseViewSchema;\nexport type Course = z.infer<typeof Course>;\n\nexport const CreateCourse = z.object({\n title: z.string().trim().min(1).max(200),\n description: z.string().max(5_000).default(''),\n category: z.string().trim().max(100).default(''),\n});\nexport type CreateCourse = z.infer<typeof CreateCourse>;\n\nexport const UpdateCourse = z.object({\n title: z.string().trim().min(1).max(200).optional(),\n description: z.string().max(5_000).optional(),\n category: z.string().trim().max(100).optional(),\n status: CourseStatus.optional(),\n /** null clears the cover. */\n thumbnailAssetId: idSchema.nullable().optional(),\n});\nexport type UpdateCourse = z.infer<typeof UpdateCourse>;\n\nexport const CoursesQuery = ListQuery.extend({\n status: CourseStatus.optional(),\n category: z.string().trim().max(100).optional(),\n});\nexport type CoursesQuery = z.infer<typeof CoursesQuery>;\n\nexport const CoursesPage = paginated(Course);\nexport type CoursesPage = z.infer<typeof CoursesPage>;\n\nexport const CourseIdParam = z.object({ id: z.string() });\nexport type CourseIdParam = z.infer<typeof CourseIdParam>;\n"],"mappings":";;;;AAYA,MAAa,eAAe;AAG5B,MAAa,iBAAiB;AAG9B,MAAa,sBAAsB,eAAe,QAAQ;AAG1D,MAAa,SAAS;AAGtB,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACvC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE;CAC7C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;AACjD,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAClD,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,SAAS;CAC5C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAC9C,QAAQ,aAAa,SAAS;;CAE9B,kBAAkB,SAAS,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,QAAQ,aAAa,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAChD,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -10,11 +10,16 @@ declare const CommentAuthor: z.ZodObject<{
|
|
|
10
10
|
id: z.ZodString;
|
|
11
11
|
firstName: z.ZodNullable<z.ZodString>;
|
|
12
12
|
lastName: z.ZodNullable<z.ZodString>;
|
|
13
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
14
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
13
15
|
image: z.ZodNullable<z.ZodString>;
|
|
16
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
17
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
14
18
|
role: z.ZodEnum<{
|
|
15
19
|
owner: "owner";
|
|
16
20
|
admin: "admin";
|
|
17
21
|
instructor: "instructor";
|
|
22
|
+
moderator: "moderator";
|
|
18
23
|
student: "student";
|
|
19
24
|
}>;
|
|
20
25
|
}, z.core.$strict>;
|
|
@@ -27,17 +32,24 @@ declare const ReactionCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
|
27
32
|
type ReactionCounts = z.infer<typeof ReactionCounts>;
|
|
28
33
|
declare const CommentView: z.ZodObject<{
|
|
29
34
|
id: z.ZodString;
|
|
30
|
-
activityId: z.ZodString
|
|
35
|
+
activityId: z.ZodNullable<z.ZodString>;
|
|
36
|
+
postId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
communityId: z.ZodNullable<z.ZodString>;
|
|
31
38
|
parentId: z.ZodNullable<z.ZodString>;
|
|
32
39
|
author: z.ZodObject<{
|
|
33
40
|
id: z.ZodString;
|
|
34
41
|
firstName: z.ZodNullable<z.ZodString>;
|
|
35
42
|
lastName: z.ZodNullable<z.ZodString>;
|
|
43
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
44
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
36
45
|
image: z.ZodNullable<z.ZodString>;
|
|
46
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
47
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
37
48
|
role: z.ZodEnum<{
|
|
38
49
|
owner: "owner";
|
|
39
50
|
admin: "admin";
|
|
40
51
|
instructor: "instructor";
|
|
52
|
+
moderator: "moderator";
|
|
41
53
|
student: "student";
|
|
42
54
|
}>;
|
|
43
55
|
}, z.core.$strict>;
|
|
@@ -51,11 +63,16 @@ declare const CommentView: z.ZodObject<{
|
|
|
51
63
|
id: z.ZodString;
|
|
52
64
|
firstName: z.ZodNullable<z.ZodString>;
|
|
53
65
|
lastName: z.ZodNullable<z.ZodString>;
|
|
66
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
67
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
54
68
|
image: z.ZodNullable<z.ZodString>;
|
|
69
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
70
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
55
71
|
role: z.ZodEnum<{
|
|
56
72
|
owner: "owner";
|
|
57
73
|
admin: "admin";
|
|
58
74
|
instructor: "instructor";
|
|
75
|
+
moderator: "moderator";
|
|
59
76
|
student: "student";
|
|
60
77
|
}>;
|
|
61
78
|
}, z.core.$strict>>;
|
|
@@ -65,12 +82,12 @@ declare const CommentView: z.ZodObject<{
|
|
|
65
82
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
66
83
|
}, z.core.$strict>;
|
|
67
84
|
type CommentView = z.infer<typeof CommentView>;
|
|
68
|
-
/** What
|
|
69
|
-
declare const
|
|
85
|
+
/** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
|
|
86
|
+
declare const Reactions: z.ZodObject<{
|
|
70
87
|
reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
71
88
|
viewerReaction: z.ZodOptional<z.ZodString>;
|
|
72
89
|
}, z.core.$strip>;
|
|
73
|
-
type
|
|
90
|
+
type Reactions = z.infer<typeof Reactions>;
|
|
74
91
|
/** A course's comment settings. Stored under the course, carried on the course
|
|
75
92
|
* payload as `settings.comments`. */
|
|
76
93
|
declare const CommentSettings: z.ZodObject<{
|
|
@@ -98,17 +115,24 @@ declare const ActivityComments: z.ZodObject<{
|
|
|
98
115
|
}, z.core.$strip>;
|
|
99
116
|
comments: z.ZodArray<z.ZodObject<{
|
|
100
117
|
id: z.ZodString;
|
|
101
|
-
activityId: z.ZodString
|
|
118
|
+
activityId: z.ZodNullable<z.ZodString>;
|
|
119
|
+
postId: z.ZodNullable<z.ZodString>;
|
|
120
|
+
communityId: z.ZodNullable<z.ZodString>;
|
|
102
121
|
parentId: z.ZodNullable<z.ZodString>;
|
|
103
122
|
author: z.ZodObject<{
|
|
104
123
|
id: z.ZodString;
|
|
105
124
|
firstName: z.ZodNullable<z.ZodString>;
|
|
106
125
|
lastName: z.ZodNullable<z.ZodString>;
|
|
126
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
127
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
107
128
|
image: z.ZodNullable<z.ZodString>;
|
|
129
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
130
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
108
131
|
role: z.ZodEnum<{
|
|
109
132
|
owner: "owner";
|
|
110
133
|
admin: "admin";
|
|
111
134
|
instructor: "instructor";
|
|
135
|
+
moderator: "moderator";
|
|
112
136
|
student: "student";
|
|
113
137
|
}>;
|
|
114
138
|
}, z.core.$strict>;
|
|
@@ -122,11 +146,16 @@ declare const ActivityComments: z.ZodObject<{
|
|
|
122
146
|
id: z.ZodString;
|
|
123
147
|
firstName: z.ZodNullable<z.ZodString>;
|
|
124
148
|
lastName: z.ZodNullable<z.ZodString>;
|
|
149
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
150
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
125
151
|
image: z.ZodNullable<z.ZodString>;
|
|
152
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
153
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
126
154
|
role: z.ZodEnum<{
|
|
127
155
|
owner: "owner";
|
|
128
156
|
admin: "admin";
|
|
129
157
|
instructor: "instructor";
|
|
158
|
+
moderator: "moderator";
|
|
130
159
|
student: "student";
|
|
131
160
|
}>;
|
|
132
161
|
}, z.core.$strict>>;
|
|
@@ -140,24 +169,30 @@ type ActivityComments = z.infer<typeof ActivityComments>;
|
|
|
140
169
|
declare const PostComment: z.ZodObject<{
|
|
141
170
|
body: z.ZodString;
|
|
142
171
|
parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
143
|
-
}, z.core.$
|
|
172
|
+
}, z.core.$strict>;
|
|
144
173
|
type PostComment = z.infer<typeof PostComment>;
|
|
145
174
|
declare const EditComment: z.ZodObject<{
|
|
146
175
|
body: z.ZodString;
|
|
147
|
-
}, z.core.$
|
|
176
|
+
}, z.core.$strict>;
|
|
148
177
|
type EditComment = z.infer<typeof EditComment>;
|
|
149
178
|
/** The staff PATCH writes status and nothing else: publishing covers approving
|
|
150
179
|
* a pending comment and restoring a removed one. Revising the text is the
|
|
151
|
-
* author's own edit, under /api/
|
|
180
|
+
* author's own edit, under /api/member. */
|
|
152
181
|
declare const PatchComment: z.ZodObject<{
|
|
153
182
|
status: z.ZodLiteral<"published">;
|
|
154
183
|
}, z.core.$strip>;
|
|
155
184
|
type PatchComment = z.infer<typeof PatchComment>;
|
|
156
185
|
/** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
|
|
157
|
-
declare const
|
|
186
|
+
declare const SetReaction: z.ZodObject<{
|
|
158
187
|
emoji: z.ZodString;
|
|
159
|
-
}, z.core.$
|
|
160
|
-
type
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
type SetReaction = z.infer<typeof SetReaction>;
|
|
190
|
+
declare const ResolveCommentFlags: z.ZodObject<{
|
|
191
|
+
resolution: z.ZodEnum<{
|
|
192
|
+
dismissed: "dismissed";
|
|
193
|
+
}>;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
type ResolveCommentFlags = z.infer<typeof ResolveCommentFlags>;
|
|
161
196
|
/** A moderator's reply, posted from the queue against the comment it answers. */
|
|
162
197
|
declare const ReplyToComment: z.ZodObject<{
|
|
163
198
|
body: z.ZodString;
|
|
@@ -165,12 +200,14 @@ declare const ReplyToComment: z.ZodObject<{
|
|
|
165
200
|
type ReplyToComment = z.infer<typeof ReplyToComment>;
|
|
166
201
|
declare const ReportComment: z.ZodObject<{
|
|
167
202
|
reason: z.ZodDefault<z.ZodString>;
|
|
168
|
-
}, z.core.$
|
|
203
|
+
}, z.core.$strict>;
|
|
169
204
|
type ReportComment = z.infer<typeof ReportComment>;
|
|
170
205
|
declare const Comment: z.ZodObject<{
|
|
171
206
|
id: z.ZodString;
|
|
172
207
|
orgId: z.ZodString;
|
|
173
|
-
activityId: z.ZodString
|
|
208
|
+
activityId: z.ZodNullable<z.ZodString>;
|
|
209
|
+
postId: z.ZodNullable<z.ZodString>;
|
|
210
|
+
communityId: z.ZodNullable<z.ZodString>;
|
|
174
211
|
parentId: z.ZodNullable<z.ZodString>;
|
|
175
212
|
orgUserId: z.ZodString;
|
|
176
213
|
body: z.ZodString;
|
|
@@ -200,11 +237,16 @@ declare const CommentReportSummary: z.ZodObject<{
|
|
|
200
237
|
id: z.ZodString;
|
|
201
238
|
firstName: z.ZodNullable<z.ZodString>;
|
|
202
239
|
lastName: z.ZodNullable<z.ZodString>;
|
|
240
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
241
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
203
242
|
image: z.ZodNullable<z.ZodString>;
|
|
243
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
244
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
204
245
|
role: z.ZodEnum<{
|
|
205
246
|
owner: "owner";
|
|
206
247
|
admin: "admin";
|
|
207
248
|
instructor: "instructor";
|
|
249
|
+
moderator: "moderator";
|
|
208
250
|
student: "student";
|
|
209
251
|
}>;
|
|
210
252
|
}, z.core.$strict>;
|
|
@@ -230,11 +272,16 @@ declare const CommentListItem: z.ZodObject<{
|
|
|
230
272
|
id: z.ZodString;
|
|
231
273
|
firstName: z.ZodNullable<z.ZodString>;
|
|
232
274
|
lastName: z.ZodNullable<z.ZodString>;
|
|
275
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
276
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
233
277
|
image: z.ZodNullable<z.ZodString>;
|
|
278
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
279
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
234
280
|
role: z.ZodEnum<{
|
|
235
281
|
owner: "owner";
|
|
236
282
|
admin: "admin";
|
|
237
283
|
instructor: "instructor";
|
|
284
|
+
moderator: "moderator";
|
|
238
285
|
student: "student";
|
|
239
286
|
}>;
|
|
240
287
|
}, z.core.$strict>;
|
|
@@ -245,11 +292,16 @@ declare const CommentListItem: z.ZodObject<{
|
|
|
245
292
|
id: z.ZodString;
|
|
246
293
|
firstName: z.ZodNullable<z.ZodString>;
|
|
247
294
|
lastName: z.ZodNullable<z.ZodString>;
|
|
295
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
296
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
248
297
|
image: z.ZodNullable<z.ZodString>;
|
|
298
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
299
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
249
300
|
role: z.ZodEnum<{
|
|
250
301
|
owner: "owner";
|
|
251
302
|
admin: "admin";
|
|
252
303
|
instructor: "instructor";
|
|
304
|
+
moderator: "moderator";
|
|
253
305
|
student: "student";
|
|
254
306
|
}>;
|
|
255
307
|
}, z.core.$strict>;
|
|
@@ -293,11 +345,16 @@ declare const CommentsPage: z.ZodObject<{
|
|
|
293
345
|
id: z.ZodString;
|
|
294
346
|
firstName: z.ZodNullable<z.ZodString>;
|
|
295
347
|
lastName: z.ZodNullable<z.ZodString>;
|
|
348
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
349
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
296
350
|
image: z.ZodNullable<z.ZodString>;
|
|
351
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
352
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
297
353
|
role: z.ZodEnum<{
|
|
298
354
|
owner: "owner";
|
|
299
355
|
admin: "admin";
|
|
300
356
|
instructor: "instructor";
|
|
357
|
+
moderator: "moderator";
|
|
301
358
|
student: "student";
|
|
302
359
|
}>;
|
|
303
360
|
}, z.core.$strict>;
|
|
@@ -308,11 +365,16 @@ declare const CommentsPage: z.ZodObject<{
|
|
|
308
365
|
id: z.ZodString;
|
|
309
366
|
firstName: z.ZodNullable<z.ZodString>;
|
|
310
367
|
lastName: z.ZodNullable<z.ZodString>;
|
|
368
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
369
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
311
370
|
image: z.ZodNullable<z.ZodString>;
|
|
371
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
372
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
312
373
|
role: z.ZodEnum<{
|
|
313
374
|
owner: "owner";
|
|
314
375
|
admin: "admin";
|
|
315
376
|
instructor: "instructor";
|
|
377
|
+
moderator: "moderator";
|
|
316
378
|
student: "student";
|
|
317
379
|
}>;
|
|
318
380
|
}, z.core.$strict>;
|
|
@@ -336,5 +398,5 @@ declare const CommentIdParam: z.ZodObject<{
|
|
|
336
398
|
}, z.core.$strip>;
|
|
337
399
|
type CommentIdParam = z.infer<typeof CommentIdParam>;
|
|
338
400
|
//#endregion
|
|
339
|
-
export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem,
|
|
401
|
+
export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetReaction };
|
|
340
402
|
//# sourceMappingURL=discussion.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { commentAuthorSchema, commentListItemSchema, commentReportSummarySchema, commentSchema, commentStatusSchema, commentViewSchema } from "@headless-lms/core/schemas";
|
|
3
|
+
import { commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReportSummarySchema, commentSchema, commentStatusSchema, commentViewSchema, idSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/discussion.ts
|
|
5
5
|
const CommentStatus = commentStatusSchema;
|
|
6
6
|
const CommentAuthor = commentAuthorSchema;
|
|
@@ -9,10 +9,10 @@ const ReactionEmoji = z.string().min(1).max(16);
|
|
|
9
9
|
/** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */
|
|
10
10
|
const ReactionCounts = z.record(z.string(), z.number().int());
|
|
11
11
|
const CommentView = commentViewSchema;
|
|
12
|
-
/** What
|
|
13
|
-
const
|
|
12
|
+
/** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
|
|
13
|
+
const Reactions = z.object({
|
|
14
14
|
reactions: ReactionCounts,
|
|
15
|
-
viewerReaction: ReactionEmoji.optional()
|
|
15
|
+
viewerReaction: ReactionEmoji.optional().describe("Absent when you have no reaction")
|
|
16
16
|
});
|
|
17
17
|
/** A course's comment settings. Stored under the course, carried on the course
|
|
18
18
|
* payload as `settings.comments`. */
|
|
@@ -31,18 +31,19 @@ const ActivityComments = z.object({
|
|
|
31
31
|
});
|
|
32
32
|
const PostComment = z.object({
|
|
33
33
|
body: z.string().min(1).max(1e4),
|
|
34
|
-
parentId:
|
|
35
|
-
});
|
|
36
|
-
const EditComment = z.object({ body: z.string().min(1).max(1e4) });
|
|
34
|
+
parentId: idSchema.nullable().default(null).describe("The comment this replies to. Replies nest one level, under a root comment")
|
|
35
|
+
}).strict();
|
|
36
|
+
const EditComment = z.object({ body: z.string().min(1).max(1e4) }).strict();
|
|
37
37
|
/** The staff PATCH writes status and nothing else: publishing covers approving
|
|
38
38
|
* a pending comment and restoring a removed one. Revising the text is the
|
|
39
|
-
* author's own edit, under /api/
|
|
39
|
+
* author's own edit, under /api/member. */
|
|
40
40
|
const PatchComment = z.object({ status: z.literal("published") });
|
|
41
41
|
/** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
|
|
42
|
-
const
|
|
42
|
+
const SetReaction = z.object({ emoji: ReactionEmoji.describe("Replaces any reaction you already had") }).strict();
|
|
43
|
+
const ResolveCommentFlags = z.object({ resolution: commentFlagResolutionSchema.extract(["dismissed"]).describe("`dismissed` closes the open flags and leaves the comment up. Removing the comment resolves its flags as `removed` instead.") }).strict();
|
|
43
44
|
/** A moderator's reply, posted from the queue against the comment it answers. */
|
|
44
45
|
const ReplyToComment = z.object({ body: z.string().min(1).max(1e4) });
|
|
45
|
-
const ReportComment = z.object({ reason: z.string().max(1e3).default("") });
|
|
46
|
+
const ReportComment = z.object({ reason: z.string().max(1e3).default("") }).strict();
|
|
46
47
|
const Comment = commentSchema;
|
|
47
48
|
const CommentReport = z.object({
|
|
48
49
|
id: z.string(),
|
|
@@ -73,6 +74,6 @@ const CommentsPage = paginated(CommentListItem);
|
|
|
73
74
|
const DiscussionActivityParam = z.object({ activityId: z.string() });
|
|
74
75
|
const CommentIdParam = z.object({ commentId: z.string() });
|
|
75
76
|
//#endregion
|
|
76
|
-
export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem,
|
|
77
|
+
export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetReaction };
|
|
77
78
|
|
|
78
79
|
//# sourceMappingURL=discussion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discussion.js","names":[],"sources":["../../../src/http/schemas/discussion.ts"],"sourcesContent":["// Discussion resource schemas. Comments attach to an activity; settings are\n// per course, with a per-activity override carried on the activity's own\n// settings blob rather than a resource of its own.\n//\n// The author is the org user's profile minus its email — learners read each\n// other's comments and the list must not be a directory of the cohort's\n// addresses. The staff-facing comment list carries `authorEmail` separately.\nimport type { CommentSettings as DomainCommentSettings } from '@headless-lms/core/types';\nimport {\n commentAuthorSchema,\n commentListItemSchema,\n commentReportSummarySchema,\n commentSchema,\n commentStatusSchema,\n commentViewSchema,\n} from '@headless-lms/core/schemas';\nimport { z } from 'zod';\nimport { ListQuery, type Matches, paginated } from './shared.js';\n\nexport const CommentStatus = commentStatusSchema;\nexport type CommentStatus = z.infer<typeof CommentStatus>;\n\nexport const CommentAuthor = commentAuthorSchema;\nexport type CommentAuthor = z.infer<typeof CommentAuthor>;\n\n/** Any single emoji. Open, so widening the picker needs no schema change. */\nexport const ReactionEmoji = z.string().min(1).max(16);\nexport type ReactionEmoji = z.infer<typeof ReactionEmoji>;\n\n/** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */\nexport const ReactionCounts = z.record(z.string(), z.number().int());\nexport type ReactionCounts = z.infer<typeof ReactionCounts>;\n\nexport const CommentView = commentViewSchema;\nexport type CommentView = z.infer<typeof CommentView>;\n\n/** What
|
|
1
|
+
{"version":3,"file":"discussion.js","names":[],"sources":["../../../src/http/schemas/discussion.ts"],"sourcesContent":["// Discussion resource schemas. Comments attach to an activity; settings are\n// per course, with a per-activity override carried on the activity's own\n// settings blob rather than a resource of its own.\n//\n// The author is the org user's profile minus its email — learners read each\n// other's comments and the list must not be a directory of the cohort's\n// addresses. The staff-facing comment list carries `authorEmail` separately.\nimport type { CommentSettings as DomainCommentSettings } from '@headless-lms/core/types';\nimport {\n commentAuthorSchema,\n commentListItemSchema,\n commentReportSummarySchema,\n commentSchema,\n commentFlagResolutionSchema,\n commentStatusSchema,\n commentViewSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\nimport { z } from 'zod';\nimport { ListQuery, type Matches, paginated } from './shared.js';\n\nexport const CommentStatus = commentStatusSchema;\nexport type CommentStatus = z.infer<typeof CommentStatus>;\n\nexport const CommentAuthor = commentAuthorSchema;\nexport type CommentAuthor = z.infer<typeof CommentAuthor>;\n\n/** Any single emoji. Open, so widening the picker needs no schema change. */\nexport const ReactionEmoji = z.string().min(1).max(16);\nexport type ReactionEmoji = z.infer<typeof ReactionEmoji>;\n\n/** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */\nexport const ReactionCounts = z.record(z.string(), z.number().int());\nexport type ReactionCounts = z.infer<typeof ReactionCounts>;\n\nexport const CommentView = commentViewSchema;\nexport type CommentView = z.infer<typeof CommentView>;\n\n/** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */\nexport const Reactions = z.object({\n reactions: ReactionCounts,\n viewerReaction: ReactionEmoji.optional().describe('Absent when you have no reaction'),\n});\nexport type Reactions = z.infer<typeof Reactions>;\n\n/** A course's comment settings. Stored under the course, carried on the course\n * payload as `settings.comments`. */\nexport const CommentSettings = z.object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n});\nexport type CommentSettings = z.infer<typeof CommentSettings>;\ntype _CommentSettingsMatchesDomain = Matches<DomainCommentSettings, CommentSettings> &\n Matches<CommentSettings, DomainCommentSettings>;\n\n/** The course settings with the activity's override applied: `enabled` is the\n * resolved answer for this activity, not the course switch. */\nexport const CommentsConfig = CommentSettings;\nexport type CommentsConfig = z.infer<typeof CommentsConfig>;\n\nexport const ActivityComments = z.object({\n config: CommentsConfig,\n comments: z.array(CommentView),\n});\nexport type ActivityComments = z.infer<typeof ActivityComments>;\n\nexport const PostComment = z\n .object({\n body: z.string().min(1).max(10_000),\n parentId: idSchema\n .nullable()\n .default(null)\n .describe('The comment this replies to. Replies nest one level, under a root comment'),\n })\n .strict();\nexport type PostComment = z.infer<typeof PostComment>;\n\nexport const EditComment = z.object({ body: z.string().min(1).max(10_000) }).strict();\nexport type EditComment = z.infer<typeof EditComment>;\n\n/** The staff PATCH writes status and nothing else: publishing covers approving\n * a pending comment and restoring a removed one. Revising the text is the\n * author's own edit, under /api/member. */\nexport const PatchComment = z.object({\n status: z.literal('published'),\n});\nexport type PatchComment = z.infer<typeof PatchComment>;\n\n/** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */\nexport const SetReaction = z\n .object({ emoji: ReactionEmoji.describe('Replaces any reaction you already had') })\n .strict();\nexport type SetReaction = z.infer<typeof SetReaction>;\n\nexport const ResolveCommentFlags = z\n .object({\n resolution: commentFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the comment up. Removing the comment resolves its flags as `removed` instead.',\n ),\n })\n .strict();\nexport type ResolveCommentFlags = z.infer<typeof ResolveCommentFlags>;\n\n/** A moderator's reply, posted from the queue against the comment it answers. */\nexport const ReplyToComment = z.object({\n body: z.string().min(1).max(10_000),\n});\nexport type ReplyToComment = z.infer<typeof ReplyToComment>;\n\nexport const ReportComment = z.object({ reason: z.string().max(1_000).default('') }).strict();\nexport type ReportComment = z.infer<typeof ReportComment>;\n\nexport const Comment = commentSchema;\nexport type Comment = z.infer<typeof Comment>;\n\nexport const CommentReport = z.object({\n id: z.string(),\n commentId: z.string(),\n orgUserId: z.string(),\n reason: z.string(),\n resolvedAt: z.date().nullable(),\n createdAt: z.date(),\n});\nexport type CommentReport = z.infer<typeof CommentReport>;\n\n/** An unresolved report on a listed comment. Resolved ones are history and are\n * never served here. */\nexport const CommentReportSummary = commentReportSummarySchema;\nexport type CommentReportSummary = z.infer<typeof CommentReportSummary>;\n\n/** One row of the staff comment list: the comment plus the context a\n * moderation decision needs, so the list needs no follow-up request. */\nexport const CommentListItem = commentListItemSchema;\nexport type CommentListItem = z.infer<typeof CommentListItem>;\n\nexport const CommentsQuery = ListQuery.extend({\n status: CommentStatus.optional(),\n /** true = only comments carrying an unresolved report, false = only those\n * carrying none. `z.stringbool` because query values arrive as strings and\n * `z.coerce.boolean()` would read \"false\" as true. */\n reported: z.stringbool().optional(),\n courseId: z.string().optional(),\n activityId: z.string().optional(),\n /** Scope to one author (org_users.id). */\n orgUserId: z.string().optional(),\n});\nexport type CommentsQuery = z.infer<typeof CommentsQuery>;\n\nexport const CommentsPage = paginated(CommentListItem);\nexport type CommentsPage = z.infer<typeof CommentsPage>;\n\nexport const DiscussionActivityParam = z.object({ activityId: z.string() });\nexport type DiscussionActivityParam = z.infer<typeof DiscussionActivityParam>;\n\nexport const CommentIdParam = z.object({ commentId: z.string() });\nexport type CommentIdParam = z.infer<typeof CommentIdParam>;\n"],"mappings":";;;;AAqBA,MAAa,gBAAgB;AAG7B,MAAa,gBAAgB;;AAI7B,MAAa,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;;AAIrD,MAAa,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAGnE,MAAa,cAAc;;AAI3B,MAAa,YAAY,EAAE,OAAO;CAChC,WAAW;CACX,gBAAgB,cAAc,SAAS,CAAC,CAAC,SAAS,kCAAkC;AACtF,CAAC;;;AAKD,MAAa,kBAAkB,EAAE,OAAO;CACtC,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,QAAQ;CACpB,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,QAAQ;AACvB,CAAC;;;AAOD,MAAa,iBAAiB;AAG9B,MAAa,mBAAmB,EAAE,OAAO;CACvC,QAAQ;CACR,UAAU,EAAE,MAAM,WAAW;AAC/B,CAAC;AAGD,MAAa,cAAc,EACxB,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM;CAClC,UAAU,SACP,SAAS,CAAC,CACV,QAAQ,IAAI,CAAC,CACb,SAAS,2EAA2E;AACzF,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EAAE,CAAC,CAAC,CAAC,OAAO;;;;AAMpF,MAAa,eAAe,EAAE,OAAO,EACnC,QAAQ,EAAE,QAAQ,WAAW,EAC/B,CAAC;;AAID,MAAa,cAAc,EACxB,OAAO,EAAE,OAAO,cAAc,SAAS,uCAAuC,EAAE,CAAC,CAAC,CAClF,OAAO;AAGV,MAAa,sBAAsB,EAChC,OAAO,EACN,YAAY,4BACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CACtB,SACC,4HACF,EACJ,CAAC,CAAC,CACD,OAAO;;AAIV,MAAa,iBAAiB,EAAE,OAAO,EACrC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EACpC,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO;AAG5F,MAAa,UAAU;AAGvB,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,OAAO;CACb,WAAW,EAAE,OAAO;CACpB,WAAW,EAAE,OAAO;CACpB,QAAQ,EAAE,OAAO;CACjB,YAAY,EAAE,KAAK,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,KAAK;AACpB,CAAC;;;AAKD,MAAa,uBAAuB;;;AAKpC,MAAa,kBAAkB;AAG/B,MAAa,gBAAgB,UAAU,OAAO;CAC5C,QAAQ,cAAc,SAAS;;;;CAI/B,UAAU,EAAE,WAAW,CAAC,CAAC,SAAS;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;;CAEhC,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;AAGD,MAAa,eAAe,UAAU,eAAe;AAGrD,MAAa,0BAA0B,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAG1E,MAAa,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -20,9 +20,10 @@ declare const Download: z.ZodObject<{
|
|
|
20
20
|
thumbnailAssetId: z.ZodNullable<z.ZodString>;
|
|
21
21
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
22
22
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
23
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
23
24
|
}, z.core.$strict>;
|
|
24
25
|
type Download = z.infer<typeof Download>;
|
|
25
|
-
declare const
|
|
26
|
+
declare const DownloadFile: z.ZodObject<{
|
|
26
27
|
orgId: z.ZodString;
|
|
27
28
|
id: z.ZodString;
|
|
28
29
|
downloadId: z.ZodString;
|
|
@@ -31,8 +32,12 @@ declare const DownloadAsset: z.ZodObject<{
|
|
|
31
32
|
displayName: z.ZodNullable<z.ZodString>;
|
|
32
33
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
33
34
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
35
|
+
filename: z.ZodString;
|
|
36
|
+
contentType: z.ZodString;
|
|
37
|
+
size: z.ZodNumber;
|
|
38
|
+
url: z.ZodString;
|
|
34
39
|
}, z.core.$strict>;
|
|
35
|
-
type
|
|
40
|
+
type DownloadFile = z.infer<typeof DownloadFile>;
|
|
36
41
|
declare const CreateDownload: z.ZodObject<{
|
|
37
42
|
title: z.ZodString;
|
|
38
43
|
description: z.ZodDefault<z.ZodString>;
|
|
@@ -41,8 +46,8 @@ declare const CreateDownload: z.ZodObject<{
|
|
|
41
46
|
type CreateDownload = z.infer<typeof CreateDownload>;
|
|
42
47
|
declare const UpdateDownload: z.ZodObject<{
|
|
43
48
|
title: z.ZodOptional<z.ZodString>;
|
|
44
|
-
description: z.ZodOptional<z.
|
|
45
|
-
category: z.ZodOptional<z.
|
|
49
|
+
description: z.ZodOptional<z.ZodString>;
|
|
50
|
+
category: z.ZodOptional<z.ZodString>;
|
|
46
51
|
status: z.ZodOptional<z.ZodEnum<{
|
|
47
52
|
draft: "draft";
|
|
48
53
|
published: "published";
|
|
@@ -78,6 +83,7 @@ declare const DownloadsPage: z.ZodObject<{
|
|
|
78
83
|
thumbnailAssetId: z.ZodNullable<z.ZodString>;
|
|
79
84
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
80
85
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
86
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
81
87
|
}, z.core.$strict>>;
|
|
82
88
|
total: z.ZodNumber;
|
|
83
89
|
page: z.ZodNumber;
|
|
@@ -108,5 +114,5 @@ declare const DownloadAssetParams: z.ZodObject<{
|
|
|
108
114
|
}, z.core.$strip>;
|
|
109
115
|
type DownloadAssetParams = z.infer<typeof DownloadAssetParams>;
|
|
110
116
|
//#endregion
|
|
111
|
-
export { AddDownloadAsset, CreateDownload, Download,
|
|
117
|
+
export { AddDownloadAsset, CreateDownload, Download, DownloadAssetParams, DownloadFile, DownloadIdParam, DownloadStatus, DownloadsPage, DownloadsQuery, RenameDownloadAsset, ReorderDownloadAssets, UpdateDownload };
|
|
112
118
|
//# sourceMappingURL=downloads.d.ts.map
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { addDownloadAssetInputSchema,
|
|
3
|
+
import { addDownloadAssetInputSchema, downloadFileSchema, downloadStatusSchema, downloadViewSchema, idSchema, reorderDownloadAssetsInputSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/downloads.ts
|
|
5
5
|
const DownloadStatus = downloadStatusSchema;
|
|
6
|
-
const Download =
|
|
7
|
-
const
|
|
6
|
+
const Download = downloadViewSchema;
|
|
7
|
+
const DownloadFile = downloadFileSchema;
|
|
8
8
|
const CreateDownload = z.object({
|
|
9
|
-
title: z.string().min(1),
|
|
10
|
-
description: z.string().default(""),
|
|
11
|
-
category: z.string().default("")
|
|
9
|
+
title: z.string().trim().min(1).max(200),
|
|
10
|
+
description: z.string().max(5e3).default(""),
|
|
11
|
+
category: z.string().trim().max(100).default("")
|
|
12
12
|
});
|
|
13
|
-
const UpdateDownload =
|
|
13
|
+
const UpdateDownload = z.object({
|
|
14
|
+
title: z.string().trim().min(1).max(200).optional(),
|
|
15
|
+
description: z.string().max(5e3).optional(),
|
|
16
|
+
category: z.string().trim().max(100).optional(),
|
|
14
17
|
status: DownloadStatus.optional(),
|
|
15
|
-
thumbnailAssetId:
|
|
18
|
+
thumbnailAssetId: idSchema.nullable().optional()
|
|
16
19
|
});
|
|
17
20
|
const DownloadsQuery = ListQuery.extend({
|
|
18
21
|
status: DownloadStatus.optional(),
|
|
19
|
-
category: z.string().optional()
|
|
22
|
+
category: z.string().trim().max(100).optional()
|
|
20
23
|
});
|
|
21
24
|
const DownloadsPage = paginated(Download);
|
|
22
25
|
const AddDownloadAsset = addDownloadAssetInputSchema;
|
|
23
26
|
/** `null` restores the `filename` fallback. */
|
|
24
|
-
const RenameDownloadAsset = z.object({ displayName: z.string().nullable() });
|
|
27
|
+
const RenameDownloadAsset = z.object({ displayName: z.string().trim().min(1).max(255).nullable() });
|
|
25
28
|
const ReorderDownloadAssets = reorderDownloadAssetsInputSchema;
|
|
26
29
|
const DownloadIdParam = z.object({ downloadId: z.string() });
|
|
27
30
|
const DownloadAssetParams = z.object({
|
|
@@ -29,6 +32,6 @@ const DownloadAssetParams = z.object({
|
|
|
29
32
|
assetId: z.string()
|
|
30
33
|
});
|
|
31
34
|
//#endregion
|
|
32
|
-
export { AddDownloadAsset, CreateDownload, Download,
|
|
35
|
+
export { AddDownloadAsset, CreateDownload, Download, DownloadAssetParams, DownloadFile, DownloadIdParam, DownloadStatus, DownloadsPage, DownloadsQuery, RenameDownloadAsset, ReorderDownloadAssets, UpdateDownload };
|
|
33
36
|
|
|
34
37
|
//# sourceMappingURL=downloads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloads.js","names":[],"sources":["../../../src/http/schemas/downloads.ts"],"sourcesContent":["// Downloads resource schemas — a content type whose whole structure is an\n// ordered set of media-library assets. The Fastify routes validate\n// requests/responses against these, the OpenAPI spec is built from them, and\n// the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport {\n addDownloadAssetInputSchema,\n
|
|
1
|
+
{"version":3,"file":"downloads.js","names":[],"sources":["../../../src/http/schemas/downloads.ts"],"sourcesContent":["// Downloads resource schemas — a content type whose whole structure is an\n// ordered set of media-library assets. The Fastify routes validate\n// requests/responses against these, the OpenAPI spec is built from them, and\n// the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport {\n addDownloadAssetInputSchema,\n downloadFileSchema,\n downloadStatusSchema,\n downloadViewSchema,\n reorderDownloadAssetsInputSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const DownloadStatus = downloadStatusSchema;\nexport type DownloadStatus = z.infer<typeof DownloadStatus>;\n\nexport const Download = downloadViewSchema;\nexport type Download = z.infer<typeof Download>;\n\nexport const DownloadFile = downloadFileSchema;\nexport type DownloadFile = z.infer<typeof DownloadFile>;\n\nexport const CreateDownload = z.object({\n title: z.string().trim().min(1).max(200),\n description: z.string().max(5_000).default(''),\n category: z.string().trim().max(100).default(''),\n});\nexport type CreateDownload = z.infer<typeof CreateDownload>;\n\nexport const UpdateDownload = z.object({\n title: z.string().trim().min(1).max(200).optional(),\n description: z.string().max(5_000).optional(),\n category: z.string().trim().max(100).optional(),\n status: DownloadStatus.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n});\nexport type UpdateDownload = z.infer<typeof UpdateDownload>;\n\nexport const DownloadsQuery = ListQuery.extend({\n status: DownloadStatus.optional(),\n category: z.string().trim().max(100).optional(),\n});\nexport type DownloadsQuery = z.infer<typeof DownloadsQuery>;\n\nexport const DownloadsPage = paginated(Download);\nexport type DownloadsPage = z.infer<typeof DownloadsPage>;\n\nexport const AddDownloadAsset = addDownloadAssetInputSchema;\nexport type AddDownloadAsset = z.infer<typeof AddDownloadAsset>;\n\n/** `null` restores the `filename` fallback. */\nexport const RenameDownloadAsset = z.object({\n displayName: z.string().trim().min(1).max(255).nullable(),\n});\nexport type RenameDownloadAsset = z.infer<typeof RenameDownloadAsset>;\n\nexport const ReorderDownloadAssets = reorderDownloadAssetsInputSchema;\nexport type ReorderDownloadAssets = z.infer<typeof ReorderDownloadAssets>;\n\nexport const DownloadIdParam = z.object({ downloadId: z.string() });\nexport type DownloadIdParam = z.infer<typeof DownloadIdParam>;\n\nexport const DownloadAssetParams = z.object({\n downloadId: z.string(),\n assetId: z.string(),\n});\nexport type DownloadAssetParams = z.infer<typeof DownloadAssetParams>;\n"],"mappings":";;;;AAeA,MAAa,iBAAiB;AAG9B,MAAa,WAAW;AAGxB,MAAa,eAAe;AAG5B,MAAa,iBAAiB,EAAE,OAAO;CACrC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACvC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE;CAC7C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;AACjD,CAAC;AAGD,MAAa,iBAAiB,EAAE,OAAO;CACrC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAClD,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,SAAS;CAC5C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAC9C,QAAQ,eAAe,SAAS;CAChC,kBAAkB,SAAS,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC;AAGD,MAAa,iBAAiB,UAAU,OAAO;CAC7C,QAAQ,eAAe,SAAS;CAChC,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAChD,CAAC;AAGD,MAAa,gBAAgB,UAAU,QAAQ;AAG/C,MAAa,mBAAmB;;AAIhC,MAAa,sBAAsB,EAAE,OAAO,EAC1C,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,EAC1D,CAAC;AAGD,MAAa,wBAAwB;AAGrC,MAAa,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAGlE,MAAa,sBAAsB,EAAE,OAAO;CAC1C,YAAY,EAAE,OAAO;CACrB,SAAS,EAAE,OAAO;AACpB,CAAC"}
|
|
@@ -2,13 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
//#region src/http/schemas/entitlements.d.ts
|
|
3
3
|
declare const EntitlementStatus: z.ZodEnum<{
|
|
4
4
|
active: "active";
|
|
5
|
-
expired: "expired";
|
|
6
5
|
revoked: "revoked";
|
|
6
|
+
expired: "expired";
|
|
7
7
|
}>;
|
|
8
8
|
type EntitlementStatus = z.infer<typeof EntitlementStatus>;
|
|
9
9
|
declare const ContentType: z.ZodEnum<{
|
|
10
|
-
download: "download";
|
|
11
10
|
course: "course";
|
|
11
|
+
download: "download";
|
|
12
12
|
}>;
|
|
13
13
|
type ContentType = z.infer<typeof ContentType>;
|
|
14
14
|
/** Reference to the granted content: identity + display name (join-derived).
|
|
@@ -16,8 +16,8 @@ type ContentType = z.infer<typeof ContentType>;
|
|
|
16
16
|
declare const ContentRef: z.ZodObject<{
|
|
17
17
|
id: z.ZodString;
|
|
18
18
|
type: z.ZodEnum<{
|
|
19
|
-
download: "download";
|
|
20
19
|
course: "course";
|
|
20
|
+
download: "download";
|
|
21
21
|
}>;
|
|
22
22
|
title: z.ZodString;
|
|
23
23
|
}, z.core.$strip>;
|
|
@@ -46,15 +46,15 @@ declare const EntitlementsQuery: z.ZodObject<{
|
|
|
46
46
|
sort: z.ZodOptional<z.ZodString>;
|
|
47
47
|
status: z.ZodOptional<z.ZodEnum<{
|
|
48
48
|
active: "active";
|
|
49
|
-
expired: "expired";
|
|
50
49
|
revoked: "revoked";
|
|
50
|
+
expired: "expired";
|
|
51
51
|
}>>;
|
|
52
52
|
source: z.ZodOptional<z.ZodString>;
|
|
53
53
|
orgUserId: z.ZodOptional<z.ZodString>;
|
|
54
54
|
contentId: z.ZodOptional<z.ZodString>;
|
|
55
55
|
type: z.ZodOptional<z.ZodEnum<{
|
|
56
|
-
download: "download";
|
|
57
56
|
course: "course";
|
|
57
|
+
download: "download";
|
|
58
58
|
}>>;
|
|
59
59
|
}, z.core.$strip>;
|
|
60
60
|
type EntitlementsQuery = z.infer<typeof EntitlementsQuery>;
|
|
@@ -85,7 +85,7 @@ declare const GrantEntitlement: z.ZodObject<{
|
|
|
85
85
|
orgUserId: z.ZodString;
|
|
86
86
|
contentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
87
|
bundleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
-
expiresAt: z.ZodNullable<z.ZodCoercedDate<
|
|
88
|
+
expiresAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>;
|
|
89
89
|
}, z.core.$strip>;
|
|
90
90
|
type GrantEntitlement = z.infer<typeof GrantEntitlement>;
|
|
91
91
|
/** Revoke/reinstate access by setting the active|revoked status. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ListQuery, paginated } from "./shared.js";
|
|
1
|
+
import { DateTimeInput, ListQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { entitlementSchema } from "@headless-lms/core/schemas";
|
|
3
|
+
import { entitlementSchema, idSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/entitlements.ts
|
|
5
5
|
const EntitlementStatus = z.enum([
|
|
6
6
|
"active",
|
|
@@ -29,10 +29,10 @@ const EntitlementsQuery = ListQuery.extend({
|
|
|
29
29
|
const EntitlementsPage = paginated(Entitlement);
|
|
30
30
|
/** A grant targets exactly one of: a single content item or a bundle. */
|
|
31
31
|
const GrantEntitlement = z.object({
|
|
32
|
-
orgUserId:
|
|
33
|
-
contentId:
|
|
34
|
-
bundleId:
|
|
35
|
-
expiresAt:
|
|
32
|
+
orgUserId: idSchema,
|
|
33
|
+
contentId: idSchema.nullish(),
|
|
34
|
+
bundleId: idSchema.nullish(),
|
|
35
|
+
expiresAt: DateTimeInput.nullable().describe("When access ends; null never expires")
|
|
36
36
|
}).refine((v) => v.contentId != null !== (v.bundleId != null), { message: "Provide exactly one of contentId or bundleId" });
|
|
37
37
|
/** Revoke/reinstate access by setting the active|revoked status. */
|
|
38
38
|
const SetEntitlementStatus = z.object({ status: z.enum(["active", "revoked"]) });
|