@headless-lms/server 0.2.0 → 0.4.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 +24 -0
- package/dist/app/community-mail.js +92 -0
- package/dist/app/community-mail.js.map +1 -0
- package/dist/app/container.d.ts +40 -19
- package/dist/app/container.js +294 -45
- 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/app/notification-channels.d.ts +47 -0
- package/dist/app/notification-channels.js +174 -0
- package/dist/app/notification-channels.js.map +1 -0
- package/dist/app/notification-reads.d.ts +23 -0
- package/dist/app/notification-reads.js +95 -0
- package/dist/app/notification-reads.js.map +1 -0
- package/dist/http/config.d.ts +2 -1
- package/dist/http/errors.d.ts +15 -0
- package/dist/http/errors.js +162 -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 +51 -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 +522 -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 +435 -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 +312 -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/devices.d.ts +7 -0
- package/dist/http/routes/member/devices.js +98 -0
- package/dist/http/routes/member/devices.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 +35 -0
- package/dist/http/routes/member/index.js.map +1 -0
- package/dist/http/routes/member/notification-settings.d.ts +7 -0
- package/dist/http/routes/member/notification-settings.js +108 -0
- package/dist/http/routes/member/notification-settings.js.map +1 -0
- package/dist/http/routes/member/notifications.d.ts +7 -0
- package/dist/http/routes/member/notifications.js +125 -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 +171 -25
- 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 +79 -80
- package/dist/http/schemas/assets.js +23 -13
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +6 -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 +409 -0
- package/dist/http/schemas/chats.js +56 -0
- package/dist/http/schemas/chats.js.map +1 -0
- package/dist/http/schemas/community.d.ts +597 -0
- package/dist/http/schemas/community.js +132 -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 +98 -14
- package/dist/http/schemas/discussion.js +25 -12
- 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 +4 -4
- 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 +35 -2
- package/dist/http/schemas/members.js +17 -3
- package/dist/http/schemas/members.js.map +1 -1
- package/dist/http/schemas/notifications.d.ts +550 -0
- package/dist/http/schemas/notifications.js +164 -0
- package/dist/http/schemas/notifications.js.map +1 -0
- package/dist/http/schemas/posts.d.ts +350 -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 +32 -1
- package/dist/http/schemas/shared.js +20 -2
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +1 -7
- package/dist/http/schemas/students.js +1 -7
- package/dist/http/schemas/students.js.map +1 -1
- package/dist/http/scope.d.ts +3 -1
- package/dist/http/scope.js +26 -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 +3 -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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { activityAssetSchema,
|
|
2
|
+
import { activityAssetSchema, activityViewSchema, idSchema, moduleSchema, saveActivityInputSchema } from "@headless-lms/core/schemas";
|
|
3
3
|
//#region src/http/schemas/activities.ts
|
|
4
|
-
const Activity =
|
|
4
|
+
const Activity = activityViewSchema;
|
|
5
5
|
const ActivityAsset = activityAssetSchema;
|
|
6
6
|
const Module = moduleSchema;
|
|
7
7
|
/** Module/activity-write endpoints return the full, reordered module list. */
|
|
8
8
|
const ModuleList = z.array(Module);
|
|
9
|
-
/** A course's activities
|
|
9
|
+
/** A course's activities, each with the stable file URLs of the files it links, ordered by (moduleId, seq). */
|
|
10
10
|
const ActivityList = z.array(Activity);
|
|
11
11
|
/** A course's activity→asset link rows, ordered by (activityId, seq). */
|
|
12
12
|
const ActivityAssetList = z.array(ActivityAsset);
|
|
@@ -22,7 +22,7 @@ const ActivityPathParam = z.object({
|
|
|
22
22
|
});
|
|
23
23
|
const CreateModule = z.object({ title: z.string().min(1) });
|
|
24
24
|
const UpdateModule = z.object({ title: z.string().min(1) });
|
|
25
|
-
const ReorderInput = z.object({ orderedIds: z.array(
|
|
25
|
+
const ReorderInput = z.object({ orderedIds: z.array(idSchema).max(500).describe("Every id in the collection, in the new order") });
|
|
26
26
|
const SaveActivity = saveActivityInputSchema;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Activity, ActivityAsset, ActivityAssetList, ActivityList, ActivityPathParam, CourseIdPathParam, CreateModule, Module, ModuleList, ModulePathParam, ReorderInput, SaveActivity, UpdateModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities.js","names":[],"sources":["../../../src/http/schemas/activities.ts"],"sourcesContent":["// Course modules + activities resource schemas. A module holds an ordered list\n// of activities directly; each activity is a uniform, orderable unit placing an\n// opaque settings blob at a position (`seq`) with a set of linked assets.\nimport { z } from 'zod';\nimport {\n activityAssetSchema,\n
|
|
1
|
+
{"version":3,"file":"activities.js","names":[],"sources":["../../../src/http/schemas/activities.ts"],"sourcesContent":["// Course modules + activities resource schemas. A module holds an ordered list\n// of activities directly; each activity is a uniform, orderable unit placing an\n// opaque settings blob at a position (`seq`) with a set of linked assets.\nimport { z } from 'zod';\nimport {\n activityAssetSchema,\n activityViewSchema,\n moduleSchema,\n saveActivityInputSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\n\nexport const Activity = activityViewSchema;\nexport type Activity = z.infer<typeof Activity>;\n\nexport const ActivityAsset = activityAssetSchema;\nexport type ActivityAsset = z.infer<typeof ActivityAsset>;\n\nexport const Module = moduleSchema;\nexport type Module = z.infer<typeof Module>;\n\n/** Module/activity-write endpoints return the full, reordered module list. */\nexport const ModuleList = z.array(Module);\nexport type ModuleList = z.infer<typeof ModuleList>;\n\n/** A course's activities, each with the stable file URLs of the files it links, ordered by (moduleId, seq). */\nexport const ActivityList = z.array(Activity);\nexport type ActivityList = z.infer<typeof ActivityList>;\n\n/** A course's activity→asset link rows, ordered by (activityId, seq). */\nexport const ActivityAssetList = z.array(ActivityAsset);\nexport type ActivityAssetList = z.infer<typeof ActivityAssetList>;\n\nexport const CourseIdPathParam = z.object({ courseId: z.string() });\nexport type CourseIdPathParam = z.infer<typeof CourseIdPathParam>;\n\nexport const ModulePathParam = z.object({ courseId: z.string(), moduleId: z.string() });\nexport type ModulePathParam = z.infer<typeof ModulePathParam>;\n\nexport const ActivityPathParam = z.object({\n courseId: z.string(),\n moduleId: z.string(),\n activityId: z.string(),\n});\nexport type ActivityPathParam = z.infer<typeof ActivityPathParam>;\n\nexport const CreateModule = z.object({ title: z.string().min(1) });\nexport type CreateModule = z.infer<typeof CreateModule>;\n\nexport const UpdateModule = z.object({ title: z.string().min(1) });\nexport type UpdateModule = z.infer<typeof UpdateModule>;\n\nexport const ReorderInput = z.object({\n orderedIds: z.array(idSchema).max(500).describe('Every id in the collection, in the new order'),\n});\nexport type ReorderInput = z.infer<typeof ReorderInput>;\n\nexport const SaveActivity = saveActivityInputSchema;\nexport type SaveActivity = z.infer<typeof SaveActivity>;\n"],"mappings":";;;AAYA,MAAa,WAAW;AAGxB,MAAa,gBAAgB;AAG7B,MAAa,SAAS;;AAItB,MAAa,aAAa,EAAE,MAAM,MAAM;;AAIxC,MAAa,eAAe,EAAE,MAAM,QAAQ;;AAI5C,MAAa,oBAAoB,EAAE,MAAM,aAAa;AAGtD,MAAa,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAGlE,MAAa,kBAAkB,EAAE,OAAO;CAAE,UAAU,EAAE,OAAO;CAAG,UAAU,EAAE,OAAO;AAAE,CAAC;AAGtF,MAAa,oBAAoB,EAAE,OAAO;CACxC,UAAU,EAAE,OAAO;CACnB,UAAU,EAAE,OAAO;CACnB,YAAY,EAAE,OAAO;AACvB,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EACnC,YAAY,EAAE,MAAM,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,8CAA8C,EAChG,CAAC;AAGD,MAAa,eAAe"}
|
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/http/schemas/assets.d.ts
|
|
3
3
|
declare const AssetKind: z.ZodEnum<{
|
|
4
|
+
image: "image";
|
|
4
5
|
video: "video";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
audio: "audio";
|
|
7
|
+
document: "document";
|
|
7
8
|
}>;
|
|
8
9
|
type AssetKind = z.infer<typeof AssetKind>;
|
|
10
|
+
declare const AssetSource: z.ZodEnum<{
|
|
11
|
+
library: "library";
|
|
12
|
+
member: "member";
|
|
13
|
+
}>;
|
|
14
|
+
type AssetSource = z.infer<typeof AssetSource>;
|
|
9
15
|
declare const AssetStatus: z.ZodEnum<{
|
|
10
16
|
pending: "pending";
|
|
11
17
|
ready: "ready";
|
|
12
18
|
}>;
|
|
13
19
|
type AssetStatus = z.infer<typeof AssetStatus>;
|
|
14
20
|
declare const Asset: z.ZodObject<{
|
|
15
|
-
orgId: z.ZodString;
|
|
16
21
|
id: z.ZodString;
|
|
17
|
-
|
|
18
|
-
kind: z.ZodEnum<{
|
|
19
|
-
video: "video";
|
|
20
|
-
download: "download";
|
|
21
|
-
content: "content";
|
|
22
|
-
}>;
|
|
23
|
-
filename: z.ZodString;
|
|
24
|
-
contentType: z.ZodString;
|
|
25
|
-
size: z.ZodNumber;
|
|
22
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
26
23
|
status: z.ZodEnum<{
|
|
27
24
|
pending: "pending";
|
|
28
25
|
ready: "ready";
|
|
29
26
|
}>;
|
|
30
|
-
|
|
31
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
27
|
+
orgId: z.ZodString;
|
|
32
28
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
33
|
-
|
|
29
|
+
uploadedBy: z.ZodString;
|
|
30
|
+
filename: z.ZodString;
|
|
31
|
+
contentType: z.ZodString;
|
|
32
|
+
size: z.ZodNumber;
|
|
33
|
+
kind: z.ZodEnum<{
|
|
34
|
+
image: "image";
|
|
35
|
+
video: "video";
|
|
36
|
+
audio: "audio";
|
|
37
|
+
document: "document";
|
|
38
|
+
}>;
|
|
39
|
+
source: z.ZodEnum<{
|
|
40
|
+
library: "library";
|
|
41
|
+
member: "member";
|
|
42
|
+
}>;
|
|
43
|
+
url: z.ZodNullable<z.ZodString>;
|
|
44
|
+
downloadUrl: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
34
46
|
type Asset = z.infer<typeof Asset>;
|
|
35
47
|
declare const AssetsQuery: z.ZodObject<{
|
|
36
48
|
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -38,33 +50,44 @@ declare const AssetsQuery: z.ZodObject<{
|
|
|
38
50
|
search: z.ZodOptional<z.ZodString>;
|
|
39
51
|
sort: z.ZodOptional<z.ZodString>;
|
|
40
52
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
53
|
+
image: "image";
|
|
41
54
|
video: "video";
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
audio: "audio";
|
|
56
|
+
document: "document";
|
|
57
|
+
}>>;
|
|
58
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
library: "library";
|
|
60
|
+
member: "member";
|
|
44
61
|
}>>;
|
|
45
62
|
}, z.core.$strip>;
|
|
46
63
|
type AssetsQuery = z.infer<typeof AssetsQuery>;
|
|
47
64
|
declare const AssetsPage: z.ZodObject<{
|
|
48
65
|
rows: z.ZodArray<z.ZodObject<{
|
|
49
|
-
orgId: z.ZodString;
|
|
50
66
|
id: z.ZodString;
|
|
51
|
-
|
|
52
|
-
kind: z.ZodEnum<{
|
|
53
|
-
video: "video";
|
|
54
|
-
download: "download";
|
|
55
|
-
content: "content";
|
|
56
|
-
}>;
|
|
57
|
-
filename: z.ZodString;
|
|
58
|
-
contentType: z.ZodString;
|
|
59
|
-
size: z.ZodNumber;
|
|
67
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
60
68
|
status: z.ZodEnum<{
|
|
61
69
|
pending: "pending";
|
|
62
70
|
ready: "ready";
|
|
63
71
|
}>;
|
|
64
|
-
|
|
65
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
72
|
+
orgId: z.ZodString;
|
|
66
73
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
67
|
-
|
|
74
|
+
uploadedBy: z.ZodString;
|
|
75
|
+
filename: z.ZodString;
|
|
76
|
+
contentType: z.ZodString;
|
|
77
|
+
size: z.ZodNumber;
|
|
78
|
+
kind: z.ZodEnum<{
|
|
79
|
+
image: "image";
|
|
80
|
+
video: "video";
|
|
81
|
+
audio: "audio";
|
|
82
|
+
document: "document";
|
|
83
|
+
}>;
|
|
84
|
+
source: z.ZodEnum<{
|
|
85
|
+
library: "library";
|
|
86
|
+
member: "member";
|
|
87
|
+
}>;
|
|
88
|
+
url: z.ZodNullable<z.ZodString>;
|
|
89
|
+
downloadUrl: z.ZodNullable<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
68
91
|
total: z.ZodNumber;
|
|
69
92
|
page: z.ZodNumber;
|
|
70
93
|
pageSize: z.ZodNumber;
|
|
@@ -74,73 +97,49 @@ declare const AssetIdParam: z.ZodObject<{
|
|
|
74
97
|
id: z.ZodString;
|
|
75
98
|
}, z.core.$strip>;
|
|
76
99
|
type AssetIdParam = z.infer<typeof AssetIdParam>;
|
|
77
|
-
/** Register an asset and get a presigned upload URL. */
|
|
78
100
|
declare const RequestUpload: z.ZodObject<{
|
|
79
101
|
filename: z.ZodString;
|
|
80
102
|
contentType: z.ZodString;
|
|
81
|
-
kind: z.ZodEnum<{
|
|
82
|
-
video: "video";
|
|
83
|
-
download: "download";
|
|
84
|
-
content: "content";
|
|
85
|
-
}>;
|
|
86
103
|
}, z.core.$strip>;
|
|
87
104
|
type RequestUpload = z.infer<typeof RequestUpload>;
|
|
105
|
+
declare const RequestMemberUpload: z.ZodObject<{
|
|
106
|
+
filename: z.ZodString;
|
|
107
|
+
contentType: z.ZodString;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
type RequestMemberUpload = z.infer<typeof RequestMemberUpload>;
|
|
88
110
|
declare const UploadTicket: z.ZodObject<{
|
|
89
|
-
asset: z.ZodObject<{
|
|
90
|
-
orgId: z.ZodString;
|
|
91
|
-
id: z.ZodString;
|
|
92
|
-
key: z.ZodString;
|
|
93
|
-
kind: z.ZodEnum<{
|
|
94
|
-
video: "video";
|
|
95
|
-
download: "download";
|
|
96
|
-
content: "content";
|
|
97
|
-
}>;
|
|
98
|
-
filename: z.ZodString;
|
|
99
|
-
contentType: z.ZodString;
|
|
100
|
-
size: z.ZodNumber;
|
|
101
|
-
status: z.ZodEnum<{
|
|
102
|
-
pending: "pending";
|
|
103
|
-
ready: "ready";
|
|
104
|
-
}>;
|
|
105
|
-
uploadedBy: z.ZodString;
|
|
106
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
107
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
108
|
-
}, z.core.$strict>;
|
|
109
111
|
uploadUrl: z.ZodString;
|
|
110
112
|
method: z.ZodLiteral<"PUT">;
|
|
111
113
|
expiresInSeconds: z.ZodNumber;
|
|
112
114
|
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
113
|
-
}, z.core.$strict>;
|
|
114
|
-
type UploadTicket = z.infer<typeof UploadTicket>;
|
|
115
|
-
/** Optional override of the download filename (Content-Disposition). */
|
|
116
|
-
declare const RequestDownload: z.ZodObject<{
|
|
117
|
-
filename: z.ZodOptional<z.ZodString>;
|
|
118
|
-
}, z.core.$strip>;
|
|
119
|
-
type RequestDownload = z.infer<typeof RequestDownload>;
|
|
120
|
-
declare const DownloadTicket: z.ZodObject<{
|
|
121
|
-
url: z.ZodString;
|
|
122
115
|
asset: z.ZodObject<{
|
|
123
|
-
orgId: z.ZodString;
|
|
124
116
|
id: z.ZodString;
|
|
125
|
-
|
|
126
|
-
kind: z.ZodEnum<{
|
|
127
|
-
video: "video";
|
|
128
|
-
download: "download";
|
|
129
|
-
content: "content";
|
|
130
|
-
}>;
|
|
131
|
-
filename: z.ZodString;
|
|
132
|
-
contentType: z.ZodString;
|
|
133
|
-
size: z.ZodNumber;
|
|
117
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
134
118
|
status: z.ZodEnum<{
|
|
135
119
|
pending: "pending";
|
|
136
120
|
ready: "ready";
|
|
137
121
|
}>;
|
|
138
|
-
|
|
139
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
122
|
+
orgId: z.ZodString;
|
|
140
123
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
141
|
-
|
|
124
|
+
uploadedBy: z.ZodString;
|
|
125
|
+
filename: z.ZodString;
|
|
126
|
+
contentType: z.ZodString;
|
|
127
|
+
size: z.ZodNumber;
|
|
128
|
+
kind: z.ZodEnum<{
|
|
129
|
+
image: "image";
|
|
130
|
+
video: "video";
|
|
131
|
+
audio: "audio";
|
|
132
|
+
document: "document";
|
|
133
|
+
}>;
|
|
134
|
+
source: z.ZodEnum<{
|
|
135
|
+
library: "library";
|
|
136
|
+
member: "member";
|
|
137
|
+
}>;
|
|
138
|
+
url: z.ZodNullable<z.ZodString>;
|
|
139
|
+
downloadUrl: z.ZodNullable<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>;
|
|
142
141
|
}, z.core.$strict>;
|
|
143
|
-
type
|
|
142
|
+
type UploadTicket = z.infer<typeof UploadTicket>;
|
|
144
143
|
//#endregion
|
|
145
|
-
export { Asset, AssetIdParam, AssetKind, AssetStatus, AssetsPage, AssetsQuery,
|
|
144
|
+
export { Asset, AssetIdParam, AssetKind, AssetSource, AssetStatus, AssetsPage, AssetsQuery, RequestMemberUpload, RequestUpload, UploadTicket };
|
|
146
145
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
|
+
import { MEMBER_IMAGE_TYPE } from "@headless-lms/core/assets";
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
import { assetKindSchema,
|
|
4
|
+
import { assetKindSchema, assetSourceSchema, assetStatusSchema, assetViewSchema, uploadTicketSchema } from "@headless-lms/core/schemas";
|
|
4
5
|
//#region src/http/schemas/assets.ts
|
|
5
|
-
const AssetKind = assetKindSchema;
|
|
6
|
+
const AssetKind = assetKindSchema.describe("The media class, derived by the server from the content type.");
|
|
7
|
+
const AssetSource = assetSourceSchema.describe("Where the file came from: `library` is the org's media uploaded by staff, `member` is a person's own upload.");
|
|
6
8
|
const AssetStatus = assetStatusSchema;
|
|
7
|
-
const Asset =
|
|
8
|
-
|
|
9
|
+
const Asset = assetViewSchema.omit({ key: true }).extend({
|
|
10
|
+
kind: AssetKind,
|
|
11
|
+
source: AssetSource,
|
|
12
|
+
url: z.string().nullable().describe("A short-lived signed URL that shows a ready library file. `null` while pending and for a member upload, which is served with what it is attached to."),
|
|
13
|
+
downloadUrl: z.string().nullable().describe("The same file as a download saved under its filename. `null` when `url` is.")
|
|
14
|
+
}).strip();
|
|
15
|
+
const AssetsQuery = ListQuery.extend({
|
|
16
|
+
kind: AssetKind.optional(),
|
|
17
|
+
source: AssetSource.optional().describe("Defaults to `library`.")
|
|
18
|
+
});
|
|
9
19
|
const AssetsPage = paginated(Asset);
|
|
10
20
|
const AssetIdParam = z.object({ id: z.string() });
|
|
11
|
-
|
|
21
|
+
const Filename = z.string().trim().min(1).max(255);
|
|
12
22
|
const RequestUpload = z.object({
|
|
13
|
-
filename:
|
|
14
|
-
contentType: z.string().min(1)
|
|
15
|
-
|
|
23
|
+
filename: Filename,
|
|
24
|
+
contentType: z.string().min(1).max(255).describe("The media class is derived from this.")
|
|
25
|
+
});
|
|
26
|
+
const RequestMemberUpload = z.object({
|
|
27
|
+
filename: Filename,
|
|
28
|
+
contentType: z.string().regex(MEMBER_IMAGE_TYPE, "A member upload must be a PNG, JPEG, GIF, WebP or AVIF image").describe("One of `image/png`, `image/jpeg`, `image/gif`, `image/webp` or `image/avif`. The stored type and size are checked when the upload is finalized.")
|
|
16
29
|
});
|
|
17
|
-
const UploadTicket = uploadTicketSchema;
|
|
18
|
-
/** Optional override of the download filename (Content-Disposition). */
|
|
19
|
-
const RequestDownload = z.object({ filename: z.string().optional() });
|
|
20
|
-
const DownloadTicket = downloadTicketSchema;
|
|
30
|
+
const UploadTicket = uploadTicketSchema.extend({ asset: Asset });
|
|
21
31
|
//#endregion
|
|
22
|
-
export { Asset, AssetIdParam, AssetKind, AssetStatus, AssetsPage, AssetsQuery,
|
|
32
|
+
export { Asset, AssetIdParam, AssetKind, AssetSource, AssetStatus, AssetsPage, AssetsQuery, RequestMemberUpload, RequestUpload, UploadTicket };
|
|
23
33
|
|
|
24
34
|
//# sourceMappingURL=assets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n assetKindSchema,\n assetSourceSchema,\n assetStatusSchema,\n assetViewSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport { MEMBER_IMAGE_TYPE } from '@headless-lms/core/assets';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const AssetKind = assetKindSchema.describe(\n 'The media class, derived by the server from the content type.',\n);\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetSource = assetSourceSchema.describe(\n \"Where the file came from: `library` is the org's media uploaded by staff, `member` is a person's own upload.\",\n);\nexport type AssetSource = z.infer<typeof AssetSource>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetViewSchema\n .omit({ key: true })\n .extend({\n kind: AssetKind,\n source: AssetSource,\n url: z\n .string()\n .nullable()\n .describe(\n 'A short-lived signed URL that shows a ready library file. `null` while pending and for a member upload, which is served with what it is attached to.',\n ),\n downloadUrl: z\n .string()\n .nullable()\n .describe('The same file as a download saved under its filename. `null` when `url` is.'),\n })\n .strip();\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({\n kind: AssetKind.optional(),\n source: AssetSource.optional().describe('Defaults to `library`.'),\n});\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\nconst Filename = z.string().trim().min(1).max(255);\n\nexport const RequestUpload = z.object({\n filename: Filename,\n contentType: z.string().min(1).max(255).describe('The media class is derived from this.'),\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const RequestMemberUpload = z.object({\n filename: Filename,\n contentType: z\n .string()\n .regex(MEMBER_IMAGE_TYPE, 'A member upload must be a PNG, JPEG, GIF, WebP or AVIF image')\n .describe(\n 'One of `image/png`, `image/jpeg`, `image/gif`, `image/webp` or `image/avif`. The stored type and size are checked when the upload is finalized.',\n ),\n});\nexport type RequestMemberUpload = z.infer<typeof RequestMemberUpload>;\n\nexport const UploadTicket = uploadTicketSchema.extend({ asset: Asset });\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n"],"mappings":";;;;;AAWA,MAAa,YAAY,gBAAgB,SACvC,+DACF;AAGA,MAAa,cAAc,kBAAkB,SAC3C,8GACF;AAGA,MAAa,cAAc;AAG3B,MAAa,QAAQ,gBAClB,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,CACnB,OAAO;CACN,MAAM;CACN,QAAQ;CACR,KAAK,EACF,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,sJACF;CACF,aAAa,EACV,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,6EAA6E;AAC3F,CAAC,CAAC,CACD,MAAM;AAGT,MAAa,cAAc,UAAU,OAAO;CAC1C,MAAM,UAAU,SAAS;CACzB,QAAQ,YAAY,SAAS,CAAC,CAAC,SAAS,wBAAwB;AAClE,CAAC;AAGD,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGvD,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;AAEjD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU;CACV,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,uCAAuC;AAC1F,CAAC;AAGD,MAAa,sBAAsB,EAAE,OAAO;CAC1C,UAAU;CACV,aAAa,EACV,OAAO,CAAC,CACR,MAAM,mBAAmB,8DAA8D,CAAC,CACxF,SACC,iJACF;AACJ,CAAC;AAGD,MAAa,eAAe,mBAAmB,OAAO,EAAE,OAAO,MAAM,CAAC"}
|
|
@@ -29,6 +29,7 @@ declare const Automation: z.ZodObject<{
|
|
|
29
29
|
input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
|
|
30
30
|
}, z.core.$strict>>;
|
|
31
31
|
enabled: z.ZodBoolean;
|
|
32
|
+
filter: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>;
|
|
32
33
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
33
34
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
34
35
|
}, z.core.$strict>;
|
|
@@ -48,6 +49,7 @@ declare const CreateAutomationBody: z.ZodObject<{
|
|
|
48
49
|
type: z.ZodString;
|
|
49
50
|
input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
|
|
50
51
|
}, z.core.$strict>>;
|
|
52
|
+
filter: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>>;
|
|
51
53
|
}, z.core.$strict>;
|
|
52
54
|
type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;
|
|
53
55
|
declare const UpdateAutomationBody: z.ZodObject<{
|
|
@@ -58,6 +60,7 @@ declare const UpdateAutomationBody: z.ZodObject<{
|
|
|
58
60
|
type: z.ZodString;
|
|
59
61
|
input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
|
|
60
62
|
}, z.core.$strict>>>;
|
|
63
|
+
filter: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>>>;
|
|
61
64
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
62
65
|
}, z.core.$strict>;
|
|
63
66
|
type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;
|
|
@@ -103,6 +106,7 @@ declare const AutomationActionResult: z.ZodObject<{
|
|
|
103
106
|
failed: "failed";
|
|
104
107
|
}>;
|
|
105
108
|
error: z.ZodOptional<z.ZodString>;
|
|
109
|
+
recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
110
|
}, z.core.$strict>;
|
|
107
111
|
type AutomationActionResult = z.infer<typeof AutomationActionResult>;
|
|
108
112
|
declare const AutomationRun: z.ZodObject<{
|
|
@@ -125,6 +129,7 @@ declare const AutomationRun: z.ZodObject<{
|
|
|
125
129
|
failed: "failed";
|
|
126
130
|
}>;
|
|
127
131
|
error: z.ZodOptional<z.ZodString>;
|
|
132
|
+
recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
133
|
}, z.core.$strict>>;
|
|
129
134
|
startedAt: z.ZodCoercedDate<unknown>;
|
|
130
135
|
finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
@@ -165,6 +170,7 @@ declare const AutomationRunsPage: z.ZodObject<{
|
|
|
165
170
|
failed: "failed";
|
|
166
171
|
}>;
|
|
167
172
|
error: z.ZodOptional<z.ZodString>;
|
|
173
|
+
recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
168
174
|
}, z.core.$strict>>;
|
|
169
175
|
startedAt: z.ZodCoercedDate<unknown>;
|
|
170
176
|
finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ListQuery, paginated } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { bundleItemSchema, bundleSchema } from "@headless-lms/core/schemas";
|
|
3
|
+
import { bundleItemSchema, bundleSchema, idSchema } from "@headless-lms/core/schemas";
|
|
4
4
|
//#region src/http/schemas/bundles.ts
|
|
5
5
|
const Bundle = bundleSchema;
|
|
6
6
|
const BundleItem = bundleItemSchema;
|
|
7
7
|
const CreateBundle = z.object({
|
|
8
|
-
name: z.string().min(1),
|
|
9
|
-
contentIds: z.array(
|
|
8
|
+
name: z.string().trim().min(1).max(200),
|
|
9
|
+
contentIds: z.array(idSchema).max(500).optional()
|
|
10
10
|
});
|
|
11
|
-
const UpdateBundle = z.object({ name: z.string().min(1).optional() });
|
|
11
|
+
const UpdateBundle = z.object({ name: z.string().trim().min(1).max(200).optional() });
|
|
12
12
|
const BundlesQuery = ListQuery;
|
|
13
13
|
const BundlesPage = paginated(Bundle);
|
|
14
|
-
const AddBundleItem = z.object({ contentId:
|
|
14
|
+
const AddBundleItem = z.object({ contentId: idSchema });
|
|
15
15
|
const BundleIdParam = z.object({ bundleId: z.string() });
|
|
16
16
|
const BundleItemParams = z.object({
|
|
17
17
|
bundleId: z.string(),
|
|
18
|
-
contentId:
|
|
18
|
+
contentId: idSchema
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|
|
21
21
|
export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/schemas/bundles.ts"],"sourcesContent":["// Bundles resource schemas — a named grouping of content items. The Fastify\n// routes validate requests/responses against these, the OpenAPI spec is built\n// from them, and the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport { bundleItemSchema, bundleSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const Bundle = bundleSchema;\nexport type Bundle = z.infer<typeof Bundle>;\n\nexport const BundleItem = bundleItemSchema;\nexport type BundleItem = z.infer<typeof BundleItem>;\n\nexport const CreateBundle = z.object({\n name: z.string().min(1),\n contentIds: z.array(
|
|
1
|
+
{"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/schemas/bundles.ts"],"sourcesContent":["// Bundles resource schemas — a named grouping of content items. The Fastify\n// routes validate requests/responses against these, the OpenAPI spec is built\n// from them, and the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport { bundleItemSchema, bundleSchema, idSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const Bundle = bundleSchema;\nexport type Bundle = z.infer<typeof Bundle>;\n\nexport const BundleItem = bundleItemSchema;\nexport type BundleItem = z.infer<typeof BundleItem>;\n\nexport const CreateBundle = z.object({\n name: z.string().trim().min(1).max(200),\n contentIds: z.array(idSchema).max(500).optional(),\n});\nexport type CreateBundle = z.infer<typeof CreateBundle>;\n\nexport const UpdateBundle = z.object({\n name: z.string().trim().min(1).max(200).optional(),\n});\nexport type UpdateBundle = z.infer<typeof UpdateBundle>;\n\nexport const BundlesQuery = ListQuery;\nexport type BundlesQuery = z.infer<typeof BundlesQuery>;\n\nexport const BundlesPage = paginated(Bundle);\nexport type BundlesPage = z.infer<typeof BundlesPage>;\n\nexport const AddBundleItem = z.object({\n contentId: idSchema,\n});\nexport type AddBundleItem = z.infer<typeof AddBundleItem>;\n\nexport const BundleIdParam = z.object({ bundleId: z.string() });\nexport type BundleIdParam = z.infer<typeof BundleIdParam>;\n\nexport const BundleItemParams = z.object({\n bundleId: z.string(),\n contentId: idSchema,\n});\nexport type BundleItemParams = z.infer<typeof BundleItemParams>;\n"],"mappings":";;;;AAOA,MAAa,SAAS;AAGtB,MAAa,aAAa;AAG1B,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACtC,YAAY,EAAE,MAAM,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAClD,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EACnC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,EACnD,CAAC;AAGD,MAAa,eAAe;AAG5B,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EACpC,WAAW,SACb,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAG9D,MAAa,mBAAmB,EAAE,OAAO;CACvC,UAAU,EAAE,OAAO;CACnB,WAAW;AACb,CAAC"}
|