@headless-lms/server 0.5.0 → 0.6.1

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.
Files changed (44) hide show
  1. package/README.md +6 -0
  2. package/dist/app/container.d.ts +5 -1
  3. package/dist/app/container.js +3 -1
  4. package/dist/app/container.js.map +1 -1
  5. package/dist/http/mcp/tools/communities.js +1 -1
  6. package/dist/http/mcp/tools/communities.js.map +1 -1
  7. package/dist/http/routes/access.js +1 -1
  8. package/dist/http/routes/access.js.map +1 -1
  9. package/dist/http/routes/communities.js +1 -1
  10. package/dist/http/routes/communities.js.map +1 -1
  11. package/dist/http/routes/member/files.js +18 -1
  12. package/dist/http/routes/member/files.js.map +1 -1
  13. package/dist/http/routes/platform.js +1 -1
  14. package/dist/http/routes/platform.js.map +1 -1
  15. package/dist/http/schemas/access.d.ts +6 -6
  16. package/dist/http/schemas/assets.d.ts +6 -6
  17. package/dist/http/schemas/chats.d.ts +27 -27
  18. package/dist/http/schemas/community.d.ts +61 -34
  19. package/dist/http/schemas/community.js +6 -3
  20. package/dist/http/schemas/community.js.map +1 -1
  21. package/dist/http/schemas/content.d.ts +5 -5
  22. package/dist/http/schemas/course-analytics.d.ts +2 -2
  23. package/dist/http/schemas/downloads.d.ts +5 -5
  24. package/dist/http/schemas/entitlements.d.ts +5 -5
  25. package/dist/http/schemas/events.d.ts +57 -57
  26. package/dist/http/schemas/files.d.ts +10 -1
  27. package/dist/http/schemas/files.js +6 -1
  28. package/dist/http/schemas/files.js.map +1 -1
  29. package/dist/http/schemas/index.d.ts +2 -2
  30. package/dist/http/schemas/index.js +2 -2
  31. package/dist/http/schemas/integrations.d.ts +4 -4
  32. package/dist/http/schemas/member.d.ts +3 -3
  33. package/dist/http/schemas/members.d.ts +22 -22
  34. package/dist/http/schemas/notifications.d.ts +20 -20
  35. package/dist/http/schemas/platform.d.ts +2 -1
  36. package/dist/http/schemas/platform.js +2 -2
  37. package/dist/http/schemas/platform.js.map +1 -1
  38. package/dist/http/schemas/posts.d.ts +6 -6
  39. package/dist/http/schemas/profile.d.ts +3 -3
  40. package/dist/http/schemas/students.d.ts +7 -7
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js.map +1 -1
  43. package/dist/packages/server/package.js +1 -1
  44. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","names":[],"sources":["../../../../src/http/routes/member/files.ts"],"sourcesContent":["// Member file proxies. Each route asks the context that owns the file, then\n// redirects to a short-lived signed storage URL. Every refusal is a 404, so a\n// response never confirms that a file exists. A 403 only means the caller is\n// not an active member of the organization.\nimport type { FastifyInstance, FastifyReply } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport { z } from 'zod';\nimport {\n ActivityFileParams,\n CommunityThumbnailParams,\n CourseThumbnailParams,\n DownloadFileParams,\n DownloadThumbnailParams,\n EventFileParams,\n EventThumbnailParams,\n MessageAttachmentParams,\n PostCoverParams,\n PostAssetParams,\n UploadFileParams,\n refusals,\n} from '../../schemas/index.js';\nimport { resolveActor } from '../../scope.js';\nimport type { Container } from '../../../app/container.js';\n\nconst tags = ['Files'];\nconst responses = { 302: z.void(), ...refusals(403, 404) };\n\nfunction redirect(reply: FastifyReply, url: string) {\n return reply\n .header('cache-control', 'no-store')\n .header('referrer-policy', 'no-referrer')\n .redirect(url, 302);\n}\n\nexport async function memberFileRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const member = container.reporting.member;\n\n r.route({\n method: 'GET',\n url: '/api/member/courses/:courseId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getCourseThumbnail',\n tags,\n summary: \"Redirect to a course's thumbnail\",\n description:\n 'For an unpublished course, which only a holder of `courses:read` on it may fetch: a published course carries a public `thumbnailUrl` instead. 404 when the course has no thumbnail.',\n params: CourseThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('course', req.params.courseId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/events/:eventId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getEventThumbnail',\n tags,\n summary: \"Redirect to an event's cover\",\n description:\n 'For a draft event, which only a holder of `events:read` on it may fetch: a published or canceled event carries a public `thumbnailUrl` instead. 404 when the event read returns 404 or the event has no cover.',\n params: EventThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('event', req.params.eventId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/events/:eventId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getEventFile',\n tags,\n summary: 'Redirect to a file attached to an event',\n description:\n 'For a holder of `events:read` on the event or the org, or an attendee of the published or canceled event. Saved under its display name. 404 otherwise, or when the file is not attached to the event.',\n params: EventFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.eventFile(req.params.eventId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/downloads/:downloadId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getDownloadThumbnail',\n tags,\n summary: \"Redirect to a download's thumbnail\",\n description:\n 'For an unpublished download, which only a holder of `downloads:read` on it may fetch: a published download carries a public `thumbnailUrl` instead. 404 when the download has no thumbnail.',\n params: DownloadThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('download', req.params.downloadId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getCommunityThumbnail',\n tags,\n summary: \"Redirect to a community's thumbnail\",\n description:\n 'For an unpublished community, which only a holder of `communities:read` on it may fetch: a published community carries a public `thumbnailUrl` instead. 404 when the community has no thumbnail.',\n params: CommunityThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('community', req.params.communityId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/activities/:activityId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getActivityFile',\n tags,\n summary: 'Redirect to a file used in a lesson',\n description:\n 'Served when the person can open the course, the course and the lesson are published, and the lesson lists the file. A holder of `courses:read` on the course may fetch any file a lesson lists. Use the URL as an img, video or audio src.',\n params: ActivityFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.activityFile(req.params.activityId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/downloads/:downloadId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getDownloadFile',\n tags,\n summary: 'Redirect to a file in a download, saved under its display name',\n description:\n 'Served when the person can open the download, it is published, and it lists the file. A holder of `downloads:read` on the download may fetch it unpublished. The storage link lives DELIVERY_URL_EXPIRY seconds.',\n params: DownloadFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.downloadFile(req.params.downloadId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId/cover',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getPostCover',\n tags,\n summary: \"Redirect to a post's cover image\",\n description:\n 'For a post that is not published, served to whoever can read it: a published post carries a public `coverUrl` instead. 404 when the post has no cover.',\n params: PostCoverParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.posts.coverFile(req.params.postId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getPostAsset',\n tags,\n summary: \"Redirect to a file in a post's body\",\n description:\n 'Served to whoever can read the post while its body shows the file. Images, video, audio and PDFs open in place; any other file downloads under its name.',\n params: PostAssetParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.posts.assetFile(req.params.postId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/chats/:chatId/messages/:messageId/attachments/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getMessageAttachment',\n tags,\n summary: 'Redirect to an image attached to a chat message',\n description:\n \"Served to the chat's participants while the message stands, to holders of `communities:moderate` on the community also after it is deleted, and to them while the message is flagged.\",\n params: MessageAttachmentParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.chats.attachmentFile(\n req.params.chatId,\n req.params.messageId,\n req.params.assetId,\n actor,\n );\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/uploads/:id/file',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getMemberUploadFile',\n tags,\n summary: 'Redirect to an image you uploaded',\n description: 'Served only to the person who uploaded it, once it is finalized.',\n params: UploadFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.assets.ownUploadFile(req.params.id, actor);\n return redirect(reply, url);\n },\n });\n}\n"],"mappings":";;;;;;AAwBA,MAAM,OAAO,CAAC,OAAO;AACrB,MAAM,YAAY;CAAE,KAAK,EAAE,KAAK;CAAG,GAAG,SAAS,KAAK,GAAG;AAAE;AAEzD,SAAS,SAAS,OAAqB,KAAa;CAClD,OAAO,MACJ,OAAO,iBAAiB,UAAU,CAAC,CACnC,OAAO,mBAAmB,aAAa,CAAC,CACxC,SAAS,KAAK,GAAG;AACtB;AAEA,eAAsB,iBAAiB,KAAsB,WAAqC;CAChG,MA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,UAAU,MAAM,UAAU,IAAI,OAAO,QAAQ,KAAK,CAC1C;EAC5B;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aACE;GACF,QAAQ;GACR,UAAU;EACZ;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAE/C,OAAO,SAAS,OAAO,MADL,UAAU,MAAM,UAAU,IAAI,OAAO,QAAQ,IAAI,OAAO,SAAS,KAAK,CAC9D;EAC5B;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aACE;GACF,QAAQ;GACR,UAAU;EACZ;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAO/C,OAAO,SAAS,OAAO,MANL,UAAU,MAAM,eAChC,IAAI,OAAO,QACX,IAAI,OAAO,WACX,IAAI,OAAO,SACX,KACF,CAC0B;EAC5B;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aAAa;GACb,QAAQ;GACR,UAAU;EACZ;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAE/C,OAAO,SAAS,OAAO,MADL,UAAU,OAAO,cAAc,IAAI,OAAO,IAAI,KAAK,CAC3C;EAC5B;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"files.js","names":[],"sources":["../../../../src/http/routes/member/files.ts"],"sourcesContent":["// Member file proxies. Each route asks the context that owns the file, then\n// redirects to a short-lived signed storage URL. Every refusal is a 404, so a\n// response never confirms that a file exists. A 403 only means the caller is\n// not an active member of the organization.\nimport type { FastifyInstance, FastifyReply } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport { z } from 'zod';\nimport {\n ActivityFileParams,\n CommunityThumbnailParams,\n CourseThumbnailParams,\n DownloadFileParams,\n DownloadThumbnailParams,\n EventFileParams,\n EventThumbnailParams,\n MessageAttachmentParams,\n PostCoverParams,\n PostAssetParams,\n SpaceImageParams,\n UploadFileParams,\n refusals,\n} from '../../schemas/index.js';\nimport { resolveActor } from '../../scope.js';\nimport type { Container } from '../../../app/container.js';\n\nconst tags = ['Files'];\nconst responses = { 302: z.void(), ...refusals(403, 404) };\n\nfunction redirect(reply: FastifyReply, url: string) {\n return reply\n .header('cache-control', 'no-store')\n .header('referrer-policy', 'no-referrer')\n .redirect(url, 302);\n}\n\nexport async function memberFileRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const member = container.reporting.member;\n\n r.route({\n method: 'GET',\n url: '/api/member/courses/:courseId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getCourseThumbnail',\n tags,\n summary: \"Redirect to a course's thumbnail\",\n description:\n 'For an unpublished course, which only a holder of `courses:read` on it may fetch: a published course carries a public `thumbnailUrl` instead. 404 when the course has no thumbnail.',\n params: CourseThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('course', req.params.courseId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/events/:eventId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getEventThumbnail',\n tags,\n summary: \"Redirect to an event's cover\",\n description:\n 'For a draft event, which only a holder of `events:read` on it may fetch: a published or canceled event carries a public `thumbnailUrl` instead. 404 when the event read returns 404 or the event has no cover.',\n params: EventThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('event', req.params.eventId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/events/:eventId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getEventFile',\n tags,\n summary: 'Redirect to a file attached to an event',\n description:\n 'For a holder of `events:read` on the event or the org, or an attendee of the published or canceled event. Saved under its display name. 404 otherwise, or when the file is not attached to the event.',\n params: EventFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.eventFile(req.params.eventId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/downloads/:downloadId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getDownloadThumbnail',\n tags,\n summary: \"Redirect to a download's thumbnail\",\n description:\n 'For an unpublished download, which only a holder of `downloads:read` on it may fetch: a published download carries a public `thumbnailUrl` instead. 404 when the download has no thumbnail.',\n params: DownloadThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('download', req.params.downloadId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/communities/:communityId/thumbnail',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getCommunityThumbnail',\n tags,\n summary: \"Redirect to a community's thumbnail\",\n description:\n 'For an unpublished community, which only a holder of `communities:read` on it may fetch: a published community carries a public `thumbnailUrl` instead. 404 when the community has no thumbnail.',\n params: CommunityThumbnailParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.thumbnailFile('community', req.params.communityId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/spaces/:spaceId/images/:image',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getSpaceImage',\n tags,\n summary: \"Redirect to a space's cover, background or icon\",\n description:\n 'For a space in an unpublished community, which only a holder of `communities:read` on the community may fetch: a space in a published community carries public `coverUrl`, `backgroundUrl` and `iconUrl` instead. 404 when the space has no such image.',\n params: SpaceImageParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.spaceImageFile(req.params.spaceId, req.params.image, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/activities/:activityId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getActivityFile',\n tags,\n summary: 'Redirect to a file used in a lesson',\n description:\n 'Served when the person can open the course, the course and the lesson are published, and the lesson lists the file. A holder of `courses:read` on the course may fetch any file a lesson lists. Use the URL as an img, video or audio src.',\n params: ActivityFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.activityFile(req.params.activityId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/downloads/:downloadId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getDownloadFile',\n tags,\n summary: 'Redirect to a file in a download, saved under its display name',\n description:\n 'Served when the person can open the download, it is published, and it lists the file. A holder of `downloads:read` on the download may fetch it unpublished. The storage link lives DELIVERY_URL_EXPIRY seconds.',\n params: DownloadFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await member.downloadFile(req.params.downloadId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId/cover',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getPostCover',\n tags,\n summary: \"Redirect to a post's cover image\",\n description:\n 'For a post that is not published, served to whoever can read it: a published post carries a public `coverUrl` instead. 404 when the post has no cover.',\n params: PostCoverParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.posts.coverFile(req.params.postId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/posts/:postId/assets/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getPostAsset',\n tags,\n summary: \"Redirect to a file in a post's body\",\n description:\n 'Served to whoever can read the post while its body shows the file. Images, video, audio and PDFs open in place; any other file downloads under its name.',\n params: PostAssetParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.posts.assetFile(req.params.postId, req.params.assetId, actor);\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/chats/:chatId/messages/:messageId/attachments/:assetId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getMessageAttachment',\n tags,\n summary: 'Redirect to an image attached to a chat message',\n description:\n \"Served to the chat's participants while the message stands, to holders of `communities:moderate` on the community also after it is deleted, and to them while the message is flagged.\",\n params: MessageAttachmentParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.chats.attachmentFile(\n req.params.chatId,\n req.params.messageId,\n req.params.assetId,\n actor,\n );\n return redirect(reply, url);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/member/uploads/:id/file',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getMemberUploadFile',\n tags,\n summary: 'Redirect to an image you uploaded',\n description: 'Served only to the person who uploaded it, once it is finalized.',\n params: UploadFileParams,\n response: responses,\n },\n handler: async (req, reply) => {\n const actor = await resolveActor(container, req);\n const url = await container.assets.ownUploadFile(req.params.id, actor);\n return redirect(reply, url);\n },\n });\n}\n"],"mappings":";;;;;;AAyBA,MAAM,OAAO,CAAC,OAAO;AACrB,MAAM,YAAY;CAAE,KAAK,EAAE,KAAK;CAAG,GAAG,SAAS,KAAK,GAAG;AAAE;AAEzD,SAAS,SAAS,OAAqB,KAAa;CAClD,OAAO,MACJ,OAAO,iBAAiB,UAAU,CAAC,CACnC,OAAO,mBAAmB,aAAa,CAAC,CACxC,SAAS,KAAK,GAAG;AACtB;AAEA,eAAsB,iBAAiB,KAAsB,WAAqC;CAChG,MAAM,IAAI,IA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,WAAW,GAAG;GAE/C,OAAO,SAAS,OAAO,MADL,UAAU,OAAO,cAAc,IAAI,OAAO,IAAI,KAAK,CAC3C;EAC5B;CACF,CAAC;AACH"}
@@ -15,7 +15,7 @@ async function platformRoutes(app, container) {
15
15
  operationId: "createPlatformOrganization",
16
16
  tags,
17
17
  summary: "Create an organization and its first API key",
18
- description: `Requires the platform key as \`Authorization: Bearer <platform key>\`. Creates the organization, owned by the platform account, and an API key for the platform account with the Owner role and no expiry. The key is returned once. 409 when the slug is in use.`,
18
+ description: `Requires the platform key as \`Authorization: Bearer <platform key>\`. Creates the organization, owned by the platform account, with its metadata, and an API key for the platform account with the Owner role and no expiry. The key is returned once. 409 when the slug is in use.`,
19
19
  body: CreatePlatformOrganization,
20
20
  response: {
21
21
  201: PlatformOrganization,
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","names":[],"sources":["../../../src/http/routes/platform.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport type { Container } from '../../app/container.js';\nimport {\n CreatedApiKey,\n CreatePlatformApiKey,\n CreatePlatformOrganization,\n PlatformOrganization,\n PlatformOrgIdParam,\n refusals,\n} from '../schemas/index.js';\n\nexport async function platformRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const tags = ['Platform'];\n const organizations = container.organizations;\n\n r.route({\n method: 'POST',\n url: '/api/platform/organizations',\n preHandler: app.requirePlatform,\n schema: {\n operationId: 'createPlatformOrganization',\n tags,\n summary: 'Create an organization and its first API key',\n description: `Requires the platform key as \\`Authorization: Bearer <platform key>\\`. Creates the organization, owned by the platform account, and an API key for the platform account with the Owner role and no expiry. The key is returned once. 409 when the slug is in use.`,\n body: CreatePlatformOrganization,\n response: { 201: PlatformOrganization, ...refusals(400, 409) },\n },\n handler: async (req, reply) => {\n const created = await organizations.createPlatformOrganization(req.body);\n return reply.code(201).send({\n organization: {\n ...created.organization,\n createdAt: created.organization.createdAt.toISOString(),\n },\n apiKey: created.apiKey,\n });\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/platform/organizations/:orgId/api-keys',\n preHandler: app.requirePlatform,\n schema: {\n operationId: 'createPlatformApiKey',\n tags,\n summary: 'Create another API key for an organization',\n description: `Requires the platform key as \\`Authorization: Bearer <platform key>\\`. Creates an API key for the platform account in the organization, with the Owner role and no expiry, to replace a lost or leaked one; revoke the old key with the new one. The key is returned once. 404 when the platform account is not an active member of the organization.`,\n params: PlatformOrgIdParam,\n body: CreatePlatformApiKey,\n response: { 201: CreatedApiKey, ...refusals(400, 404) },\n },\n handler: async (req, reply) => {\n const created = await organizations.createPlatformApiKey(req.params.orgId, req.body.name);\n return reply.code(201).send(created);\n },\n });\n}\n"],"mappings":";;;;;AAYA,eAAsB,eAAe,KAAsB,WAAqC;CAC9F,MAAM,IAAI,IAAI,iBAAkC;CAChD,MAAM,OAAO,CAAC,UAAU;CACxB,MAAM,gBAAgB,UAAU;CAEhC,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aAAa;GACb,MAAM;GACN,UAAU;IAAE,KAAK;IAAsB,GAAG,SAAS,KAAK,GAAG;GAAE;EAC/D;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,UAAU,MAAM,cAAc,2BAA2B,IAAI,IAAI;GACvE,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK;IAC1B,cAAc;KACZ,GAAG,QAAQ;KACX,WAAW,QAAQ,aAAa,UAAU,YAAY;IACxD;IACA,QAAQ,QAAQ;GAClB,CAAC;EACH;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aAAa;GACb,QAAQ;GACR,MAAM;GACN,UAAU;IAAE,KAAK;IAAe,GAAG,SAAS,KAAK,GAAG;GAAE;EACxD;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,UAAU,MAAM,cAAc,qBAAqB,IAAI,OAAO,OAAO,IAAI,KAAK,IAAI;GACxF,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,OAAO;EACrC;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"platform.js","names":[],"sources":["../../../src/http/routes/platform.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport type { Container } from '../../app/container.js';\nimport {\n CreatedApiKey,\n CreatePlatformApiKey,\n CreatePlatformOrganization,\n PlatformOrganization,\n PlatformOrgIdParam,\n refusals,\n} from '../schemas/index.js';\n\nexport async function platformRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const tags = ['Platform'];\n const organizations = container.organizations;\n\n r.route({\n method: 'POST',\n url: '/api/platform/organizations',\n preHandler: app.requirePlatform,\n schema: {\n operationId: 'createPlatformOrganization',\n tags,\n summary: 'Create an organization and its first API key',\n description: `Requires the platform key as \\`Authorization: Bearer <platform key>\\`. Creates the organization, owned by the platform account, with its metadata, and an API key for the platform account with the Owner role and no expiry. The key is returned once. 409 when the slug is in use.`,\n body: CreatePlatformOrganization,\n response: { 201: PlatformOrganization, ...refusals(400, 409) },\n },\n handler: async (req, reply) => {\n const created = await organizations.createPlatformOrganization(req.body);\n return reply.code(201).send({\n organization: {\n ...created.organization,\n createdAt: created.organization.createdAt.toISOString(),\n },\n apiKey: created.apiKey,\n });\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/platform/organizations/:orgId/api-keys',\n preHandler: app.requirePlatform,\n schema: {\n operationId: 'createPlatformApiKey',\n tags,\n summary: 'Create another API key for an organization',\n description: `Requires the platform key as \\`Authorization: Bearer <platform key>\\`. Creates an API key for the platform account in the organization, with the Owner role and no expiry, to replace a lost or leaked one; revoke the old key with the new one. The key is returned once. 404 when the platform account is not an active member of the organization.`,\n params: PlatformOrgIdParam,\n body: CreatePlatformApiKey,\n response: { 201: CreatedApiKey, ...refusals(400, 404) },\n },\n handler: async (req, reply) => {\n const created = await organizations.createPlatformApiKey(req.params.orgId, req.body.name);\n return reply.code(201).send(created);\n },\n });\n}\n"],"mappings":";;;;;AAYA,eAAsB,eAAe,KAAsB,WAAqC;CAC9F,MAAM,IAAI,IAAI,iBAAkC;CAChD,MAAM,OAAO,CAAC,UAAU;CACxB,MAAM,gBAAgB,UAAU;CAEhC,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aAAa;GACb,MAAM;GACN,UAAU;IAAE,KAAK;IAAsB,GAAG,SAAS,KAAK,GAAG;GAAE;EAC/D;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,UAAU,MAAM,cAAc,2BAA2B,IAAI,IAAI;GACvE,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK;IAC1B,cAAc;KACZ,GAAG,QAAQ;KACX,WAAW,QAAQ,aAAa,UAAU,YAAY;IACxD;IACA,QAAQ,QAAQ;GAClB,CAAC;EACH;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aAAa;GACb,QAAQ;GACR,MAAM;GACN,UAAU;IAAE,KAAK;IAAe,GAAG,SAAS,KAAK,GAAG;GAAE;EACxD;EACA,SAAS,OAAO,KAAK,UAAU;GAC7B,MAAM,UAAU,MAAM,cAAc,qBAAqB,IAAI,OAAO,OAAO,IAAI,KAAK,IAAI;GACxF,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,OAAO;EACrC;CACF,CAAC;AACH"}
@@ -46,10 +46,10 @@ declare const Permission: z.ZodEnum<{
46
46
  "automations:delete": "automations:delete";
47
47
  }>;
48
48
  declare const Level: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
49
- community: "community";
50
- course: "course";
51
49
  download: "download";
50
+ course: "course";
52
51
  event: "event";
52
+ community: "community";
53
53
  }>>]>;
54
54
  declare const PermissionDefinition: z.ZodObject<{
55
55
  key: z.ZodEnum<{
@@ -101,10 +101,10 @@ declare const PermissionDefinition: z.ZodObject<{
101
101
  label: z.ZodString;
102
102
  description: z.ZodString;
103
103
  about: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
104
- community: "community";
105
- course: "course";
106
104
  download: "download";
105
+ course: "course";
107
106
  event: "event";
107
+ community: "community";
108
108
  }>>]>;
109
109
  implies: z.ZodOptional<z.ZodArray<z.ZodEnum<{
110
110
  "organizations:read": "organizations:read";
@@ -202,10 +202,10 @@ declare const PermissionDefinitionList: z.ZodArray<z.ZodObject<{
202
202
  label: z.ZodString;
203
203
  description: z.ZodString;
204
204
  about: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
205
- community: "community";
206
- course: "course";
207
205
  download: "download";
206
+ course: "course";
208
207
  event: "event";
208
+ community: "community";
209
209
  }>>]>;
210
210
  implies: z.ZodOptional<z.ZodArray<z.ZodEnum<{
211
211
  "organizations:read": "organizations:read";
@@ -18,7 +18,6 @@ declare const AssetStatus: z.ZodEnum<{
18
18
  }>;
19
19
  type AssetStatus = z.infer<typeof AssetStatus>;
20
20
  declare const Asset: z.ZodObject<{
21
- orgId: z.ZodString;
22
21
  id: z.ZodString;
23
22
  status: z.ZodEnum<{
24
23
  pending: "pending";
@@ -26,10 +25,11 @@ declare const Asset: z.ZodObject<{
26
25
  }>;
27
26
  createdAt: z.ZodCoercedDate<unknown>;
28
27
  updatedAt: z.ZodCoercedDate<unknown>;
29
- contentId: z.ZodNullable<z.ZodString>;
28
+ orgId: z.ZodString;
30
29
  filename: z.ZodString;
31
30
  contentType: z.ZodString;
32
31
  size: z.ZodNumber;
32
+ contentId: z.ZodNullable<z.ZodString>;
33
33
  uploadedBy: z.ZodString;
34
34
  kind: z.ZodEnum<{
35
35
  image: "image";
@@ -65,7 +65,6 @@ declare const AssetsQuery: z.ZodObject<{
65
65
  type AssetsQuery = z.infer<typeof AssetsQuery>;
66
66
  declare const AssetsPage: z.ZodObject<{
67
67
  rows: z.ZodArray<z.ZodObject<{
68
- orgId: z.ZodString;
69
68
  id: z.ZodString;
70
69
  status: z.ZodEnum<{
71
70
  pending: "pending";
@@ -73,10 +72,11 @@ declare const AssetsPage: z.ZodObject<{
73
72
  }>;
74
73
  createdAt: z.ZodCoercedDate<unknown>;
75
74
  updatedAt: z.ZodCoercedDate<unknown>;
76
- contentId: z.ZodNullable<z.ZodString>;
75
+ orgId: z.ZodString;
77
76
  filename: z.ZodString;
78
77
  contentType: z.ZodString;
79
78
  size: z.ZodNumber;
79
+ contentId: z.ZodNullable<z.ZodString>;
80
80
  uploadedBy: z.ZodString;
81
81
  kind: z.ZodEnum<{
82
82
  image: "image";
@@ -117,7 +117,6 @@ declare const UploadTicket: z.ZodObject<{
117
117
  expiresInSeconds: z.ZodNumber;
118
118
  headers: z.ZodRecord<z.ZodString, z.ZodString>;
119
119
  asset: z.ZodObject<{
120
- orgId: z.ZodString;
121
120
  id: z.ZodString;
122
121
  status: z.ZodEnum<{
123
122
  pending: "pending";
@@ -125,10 +124,11 @@ declare const UploadTicket: z.ZodObject<{
125
124
  }>;
126
125
  createdAt: z.ZodCoercedDate<unknown>;
127
126
  updatedAt: z.ZodCoercedDate<unknown>;
128
- contentId: z.ZodNullable<z.ZodString>;
127
+ orgId: z.ZodString;
129
128
  filename: z.ZodString;
130
129
  contentType: z.ZodString;
131
130
  size: z.ZodNumber;
131
+ contentId: z.ZodNullable<z.ZodString>;
132
132
  uploadedBy: z.ZodString;
133
133
  kind: z.ZodEnum<{
134
134
  image: "image";
@@ -5,8 +5,8 @@ declare const Chat: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  communityId: z.ZodString;
7
7
  kind: z.ZodEnum<{
8
- direct: "direct";
9
8
  group: "group";
9
+ direct: "direct";
10
10
  }>;
11
11
  status: z.ZodEnum<{
12
12
  pending: "pending";
@@ -29,8 +29,8 @@ declare const MessageFlag: z.ZodObject<{
29
29
  resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
30
30
  resolution: z.ZodNullable<z.ZodEnum<{
31
31
  dismissed: "dismissed";
32
- deleted: "deleted";
33
32
  locked: "locked";
33
+ deleted: "deleted";
34
34
  }>>;
35
35
  resolvedBy: z.ZodNullable<z.ZodString>;
36
36
  createdAt: z.ZodCoercedDate<unknown>;
@@ -119,8 +119,8 @@ declare const ChatListItem: z.ZodObject<{
119
119
  id: z.ZodString;
120
120
  communityId: z.ZodString;
121
121
  kind: z.ZodEnum<{
122
- direct: "direct";
123
122
  group: "group";
123
+ direct: "direct";
124
124
  }>;
125
125
  status: z.ZodEnum<{
126
126
  pending: "pending";
@@ -170,8 +170,8 @@ declare const ChatsPage: z.ZodObject<{
170
170
  id: z.ZodString;
171
171
  communityId: z.ZodString;
172
172
  kind: z.ZodEnum<{
173
- direct: "direct";
174
173
  group: "group";
174
+ direct: "direct";
175
175
  }>;
176
176
  status: z.ZodEnum<{
177
177
  pending: "pending";
@@ -234,16 +234,21 @@ declare const ChatLiveEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
234
234
  type: z.ZodLiteral<"message.created">;
235
235
  chatId: z.ZodString;
236
236
  message: z.ZodObject<{
237
- orgId: z.ZodString;
238
237
  id: z.ZodString;
238
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
239
239
  communityId: z.ZodString;
240
+ body: z.ZodString;
241
+ mentions: z.ZodArray<z.ZodObject<{
242
+ orgUserId: z.ZodString;
243
+ name: z.ZodString;
244
+ }, z.core.$strict>>;
245
+ orgUserId: z.ZodString;
240
246
  createdAt: z.ZodCoercedDate<unknown>;
241
247
  updatedAt: z.ZodCoercedDate<unknown>;
242
- orgUserId: z.ZodString;
248
+ orgId: z.ZodString;
243
249
  chatId: z.ZodString;
244
- body: z.ZodString;
245
- replyToId: z.ZodNullable<z.ZodString>;
246
250
  clientId: z.ZodNullable<z.ZodUUID>;
251
+ replyToId: z.ZodNullable<z.ZodString>;
247
252
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
248
253
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
249
254
  sender: z.ZodObject<{
@@ -262,26 +267,26 @@ declare const ChatLiveEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
262
267
  assetId: z.ZodString;
263
268
  url: z.ZodString;
264
269
  }, z.core.$strict>>;
265
- reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
266
- mentions: z.ZodArray<z.ZodObject<{
267
- orgUserId: z.ZodString;
268
- name: z.ZodString;
269
- }, z.core.$strict>>;
270
270
  }, z.core.$strict>;
271
271
  }, z.core.$strict>, z.ZodObject<{
272
272
  type: z.ZodLiteral<"message.updated">;
273
273
  chatId: z.ZodString;
274
274
  message: z.ZodObject<{
275
- orgId: z.ZodString;
276
275
  id: z.ZodString;
276
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
277
277
  communityId: z.ZodString;
278
+ body: z.ZodString;
279
+ mentions: z.ZodArray<z.ZodObject<{
280
+ orgUserId: z.ZodString;
281
+ name: z.ZodString;
282
+ }, z.core.$strict>>;
283
+ orgUserId: z.ZodString;
278
284
  createdAt: z.ZodCoercedDate<unknown>;
279
285
  updatedAt: z.ZodCoercedDate<unknown>;
280
- orgUserId: z.ZodString;
286
+ orgId: z.ZodString;
281
287
  chatId: z.ZodString;
282
- body: z.ZodString;
283
- replyToId: z.ZodNullable<z.ZodString>;
284
288
  clientId: z.ZodNullable<z.ZodUUID>;
289
+ replyToId: z.ZodNullable<z.ZodString>;
285
290
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
286
291
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
287
292
  sender: z.ZodObject<{
@@ -300,11 +305,6 @@ declare const ChatLiveEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
300
305
  assetId: z.ZodString;
301
306
  url: z.ZodString;
302
307
  }, z.core.$strict>>;
303
- reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
304
- mentions: z.ZodArray<z.ZodObject<{
305
- orgUserId: z.ZodString;
306
- name: z.ZodString;
307
- }, z.core.$strict>>;
308
308
  }, z.core.$strict>;
309
309
  }, z.core.$strict>, z.ZodObject<{
310
310
  type: z.ZodLiteral<"message.deleted">;
@@ -326,8 +326,8 @@ declare const ChatLiveEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
326
326
  id: z.ZodString;
327
327
  communityId: z.ZodString;
328
328
  kind: z.ZodEnum<{
329
- direct: "direct";
330
329
  group: "group";
330
+ direct: "direct";
331
331
  }>;
332
332
  status: z.ZodEnum<{
333
333
  pending: "pending";
@@ -431,8 +431,8 @@ declare const MessageQueueEntry: z.ZodObject<{
431
431
  resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
432
432
  resolution: z.ZodNullable<z.ZodEnum<{
433
433
  dismissed: "dismissed";
434
- deleted: "deleted";
435
434
  locked: "locked";
435
+ deleted: "deleted";
436
436
  }>>;
437
437
  resolvedBy: z.ZodNullable<z.ZodString>;
438
438
  createdAt: z.ZodCoercedDate<unknown>;
@@ -443,8 +443,8 @@ declare const MessageQueueEntry: z.ZodObject<{
443
443
  id: z.ZodString;
444
444
  communityId: z.ZodString;
445
445
  kind: z.ZodEnum<{
446
- direct: "direct";
447
446
  group: "group";
447
+ direct: "direct";
448
448
  }>;
449
449
  status: z.ZodEnum<{
450
450
  pending: "pending";
@@ -507,8 +507,8 @@ declare const MessageQueue: z.ZodObject<{
507
507
  resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
508
508
  resolution: z.ZodNullable<z.ZodEnum<{
509
509
  dismissed: "dismissed";
510
- deleted: "deleted";
511
510
  locked: "locked";
511
+ deleted: "deleted";
512
512
  }>>;
513
513
  resolvedBy: z.ZodNullable<z.ZodString>;
514
514
  createdAt: z.ZodCoercedDate<unknown>;
@@ -519,8 +519,8 @@ declare const MessageQueue: z.ZodObject<{
519
519
  id: z.ZodString;
520
520
  communityId: z.ZodString;
521
521
  kind: z.ZodEnum<{
522
- direct: "direct";
523
522
  group: "group";
523
+ direct: "direct";
524
524
  }>;
525
525
  status: z.ZodEnum<{
526
526
  pending: "pending";
@@ -8,8 +8,8 @@ declare const Community: z.ZodObject<{
8
8
  slug: z.ZodString;
9
9
  description: z.ZodString;
10
10
  status: z.ZodEnum<{
11
- draft: "draft";
12
11
  published: "published";
12
+ draft: "draft";
13
13
  }>;
14
14
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
15
15
  settings: z.ZodObject<{
@@ -42,8 +42,8 @@ declare const CommunitiesQuery: z.ZodObject<{
42
42
  search: z.ZodOptional<z.ZodString>;
43
43
  sort: z.ZodOptional<z.ZodString>;
44
44
  status: z.ZodOptional<z.ZodEnum<{
45
- draft: "draft";
46
45
  published: "published";
46
+ draft: "draft";
47
47
  }>>;
48
48
  }, z.core.$strip>;
49
49
  declare const CommunitiesPage: z.ZodObject<{
@@ -55,8 +55,8 @@ declare const CommunitiesPage: z.ZodObject<{
55
55
  slug: z.ZodString;
56
56
  description: z.ZodString;
57
57
  status: z.ZodEnum<{
58
- draft: "draft";
59
58
  published: "published";
59
+ draft: "draft";
60
60
  }>;
61
61
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
62
62
  settings: z.ZodObject<{
@@ -95,8 +95,8 @@ declare const UpdateCommunity: z.ZodObject<{
95
95
  title: z.ZodOptional<z.ZodString>;
96
96
  description: z.ZodOptional<z.ZodString>;
97
97
  status: z.ZodOptional<z.ZodEnum<{
98
- draft: "draft";
99
98
  published: "published";
99
+ draft: "draft";
100
100
  }>>;
101
101
  thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
102
  }, z.core.$strict>;
@@ -154,6 +154,9 @@ declare const SpaceDetail: z.ZodObject<{
154
154
  reactions: z.ZodBoolean;
155
155
  requireReview: z.ZodBoolean;
156
156
  }, z.core.$strict>;
157
+ coverAssetId: z.ZodNullable<z.ZodString>;
158
+ backgroundAssetId: z.ZodNullable<z.ZodString>;
159
+ iconAssetId: z.ZodNullable<z.ZodString>;
157
160
  createdAt: z.ZodCoercedDate<unknown>;
158
161
  updatedAt: z.ZodCoercedDate<unknown>;
159
162
  topics: z.ZodArray<z.ZodObject<{
@@ -174,6 +177,9 @@ declare const SpaceDetail: z.ZodObject<{
174
177
  createdAt: z.ZodCoercedDate<unknown>;
175
178
  updatedAt: z.ZodCoercedDate<unknown>;
176
179
  }, z.core.$strict>>;
180
+ coverUrl: z.ZodNullable<z.ZodString>;
181
+ backgroundUrl: z.ZodNullable<z.ZodString>;
182
+ iconUrl: z.ZodNullable<z.ZodString>;
177
183
  }, z.core.$strict>;
178
184
  declare const SpaceMember: z.ZodObject<{
179
185
  orgId: z.ZodString;
@@ -182,15 +188,15 @@ declare const SpaceMember: z.ZodObject<{
182
188
  spaceId: z.ZodString;
183
189
  orgUserId: z.ZodString;
184
190
  status: z.ZodEnum<{
185
- requested: "requested";
186
- invited: "invited";
187
191
  active: "active";
188
192
  revoked: "revoked";
193
+ invited: "invited";
194
+ requested: "requested";
189
195
  }>;
190
196
  source: z.ZodEnum<{
197
+ manual: "manual";
191
198
  request: "request";
192
199
  invite: "invite";
193
- manual: "manual";
194
200
  }>;
195
201
  createdAt: z.ZodCoercedDate<unknown>;
196
202
  updatedAt: z.ZodCoercedDate<unknown>;
@@ -203,15 +209,15 @@ declare const SpaceMembersPage: z.ZodObject<{
203
209
  spaceId: z.ZodString;
204
210
  orgUserId: z.ZodString;
205
211
  status: z.ZodEnum<{
206
- requested: "requested";
207
- invited: "invited";
208
212
  active: "active";
209
213
  revoked: "revoked";
214
+ invited: "invited";
215
+ requested: "requested";
210
216
  }>;
211
217
  source: z.ZodEnum<{
218
+ manual: "manual";
212
219
  request: "request";
213
220
  invite: "invite";
214
- manual: "manual";
215
221
  }>;
216
222
  createdAt: z.ZodCoercedDate<unknown>;
217
223
  updatedAt: z.ZodCoercedDate<unknown>;
@@ -249,6 +255,9 @@ declare const UpdateSpace: z.ZodObject<{
249
255
  reactions: z.ZodOptional<z.ZodBoolean>;
250
256
  requireReview: z.ZodOptional<z.ZodBoolean>;
251
257
  }, z.core.$strict>>;
258
+ coverAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ backgroundAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ iconAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
261
  }, z.core.$strict>;
253
262
  declare const SetSpaceTopics: z.ZodObject<{
254
263
  topics: z.ZodArray<z.ZodObject<{
@@ -370,13 +379,16 @@ declare const LockedCommunitySpace: z.ZodObject<{
370
379
  by_invite: "by_invite";
371
380
  }>;
372
381
  standing: z.ZodEnum<{
382
+ none: "none";
383
+ member: "member";
384
+ invited: "invited";
373
385
  open: "open";
374
386
  requested: "requested";
375
- invited: "invited";
376
- member: "member";
377
387
  full: "full";
378
- none: "none";
379
388
  }>;
389
+ coverUrl: z.ZodNullable<z.ZodString>;
390
+ backgroundUrl: z.ZodNullable<z.ZodString>;
391
+ iconUrl: z.ZodNullable<z.ZodString>;
380
392
  locked: z.ZodLiteral<true>;
381
393
  }, z.core.$strip>;
382
394
  declare const OpenCommunitySpace: z.ZodObject<{
@@ -389,13 +401,16 @@ declare const OpenCommunitySpace: z.ZodObject<{
389
401
  by_invite: "by_invite";
390
402
  }>;
391
403
  standing: z.ZodEnum<{
404
+ none: "none";
405
+ member: "member";
406
+ invited: "invited";
392
407
  open: "open";
393
408
  requested: "requested";
394
- invited: "invited";
395
- member: "member";
396
409
  full: "full";
397
- none: "none";
398
410
  }>;
411
+ coverUrl: z.ZodNullable<z.ZodString>;
412
+ backgroundUrl: z.ZodNullable<z.ZodString>;
413
+ iconUrl: z.ZodNullable<z.ZodString>;
399
414
  locked: z.ZodLiteral<false>;
400
415
  description: z.ZodNullable<z.ZodString>;
401
416
  capacity: z.ZodNullable<z.ZodNumber>;
@@ -412,9 +427,9 @@ declare const OpenCommunitySpace: z.ZodObject<{
412
427
  id: z.ZodString;
413
428
  contentId: z.ZodString;
414
429
  type: z.ZodEnum<{
415
- community: "community";
416
- course: "course";
417
430
  download: "download";
431
+ course: "course";
432
+ community: "community";
418
433
  }>;
419
434
  title: z.ZodString;
420
435
  }, z.core.$strip>>;
@@ -436,13 +451,16 @@ declare const CommunityHomeSpace: z.ZodDiscriminatedUnion<[z.ZodObject<{
436
451
  by_invite: "by_invite";
437
452
  }>;
438
453
  standing: z.ZodEnum<{
454
+ none: "none";
455
+ member: "member";
456
+ invited: "invited";
439
457
  open: "open";
440
458
  requested: "requested";
441
- invited: "invited";
442
- member: "member";
443
459
  full: "full";
444
- none: "none";
445
460
  }>;
461
+ coverUrl: z.ZodNullable<z.ZodString>;
462
+ backgroundUrl: z.ZodNullable<z.ZodString>;
463
+ iconUrl: z.ZodNullable<z.ZodString>;
446
464
  locked: z.ZodLiteral<true>;
447
465
  }, z.core.$strip>, z.ZodObject<{
448
466
  id: z.ZodString;
@@ -454,13 +472,16 @@ declare const CommunityHomeSpace: z.ZodDiscriminatedUnion<[z.ZodObject<{
454
472
  by_invite: "by_invite";
455
473
  }>;
456
474
  standing: z.ZodEnum<{
475
+ none: "none";
476
+ member: "member";
477
+ invited: "invited";
457
478
  open: "open";
458
479
  requested: "requested";
459
- invited: "invited";
460
- member: "member";
461
480
  full: "full";
462
- none: "none";
463
481
  }>;
482
+ coverUrl: z.ZodNullable<z.ZodString>;
483
+ backgroundUrl: z.ZodNullable<z.ZodString>;
484
+ iconUrl: z.ZodNullable<z.ZodString>;
464
485
  locked: z.ZodLiteral<false>;
465
486
  description: z.ZodNullable<z.ZodString>;
466
487
  capacity: z.ZodNullable<z.ZodNumber>;
@@ -477,9 +498,9 @@ declare const CommunityHomeSpace: z.ZodDiscriminatedUnion<[z.ZodObject<{
477
498
  id: z.ZodString;
478
499
  contentId: z.ZodString;
479
500
  type: z.ZodEnum<{
480
- community: "community";
481
- course: "course";
482
501
  download: "download";
502
+ course: "course";
503
+ community: "community";
483
504
  }>;
484
505
  title: z.ZodString;
485
506
  }, z.core.$strip>>;
@@ -515,13 +536,16 @@ declare const CommunityHome: z.ZodObject<{
515
536
  by_invite: "by_invite";
516
537
  }>;
517
538
  standing: z.ZodEnum<{
539
+ none: "none";
540
+ member: "member";
541
+ invited: "invited";
518
542
  open: "open";
519
543
  requested: "requested";
520
- invited: "invited";
521
- member: "member";
522
544
  full: "full";
523
- none: "none";
524
545
  }>;
546
+ coverUrl: z.ZodNullable<z.ZodString>;
547
+ backgroundUrl: z.ZodNullable<z.ZodString>;
548
+ iconUrl: z.ZodNullable<z.ZodString>;
525
549
  locked: z.ZodLiteral<true>;
526
550
  }, z.core.$strip>, z.ZodObject<{
527
551
  id: z.ZodString;
@@ -533,13 +557,16 @@ declare const CommunityHome: z.ZodObject<{
533
557
  by_invite: "by_invite";
534
558
  }>;
535
559
  standing: z.ZodEnum<{
560
+ none: "none";
561
+ member: "member";
562
+ invited: "invited";
536
563
  open: "open";
537
564
  requested: "requested";
538
- invited: "invited";
539
- member: "member";
540
565
  full: "full";
541
- none: "none";
542
566
  }>;
567
+ coverUrl: z.ZodNullable<z.ZodString>;
568
+ backgroundUrl: z.ZodNullable<z.ZodString>;
569
+ iconUrl: z.ZodNullable<z.ZodString>;
543
570
  locked: z.ZodLiteral<false>;
544
571
  description: z.ZodNullable<z.ZodString>;
545
572
  capacity: z.ZodNullable<z.ZodNumber>;
@@ -556,9 +583,9 @@ declare const CommunityHome: z.ZodObject<{
556
583
  id: z.ZodString;
557
584
  contentId: z.ZodString;
558
585
  type: z.ZodEnum<{
559
- community: "community";
560
- course: "course";
561
586
  download: "download";
587
+ course: "course";
588
+ community: "community";
562
589
  }>;
563
590
  title: z.ZodString;
564
591
  }, z.core.$strip>>;
@@ -1,6 +1,6 @@
1
1
  import { ListQuery, OrgUserProfileSchema, PageQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { communityStatusSchema, communityViewSchema, createCommunityInputSchema, createSpaceInputSchema, dmSettingsSchema, idSchema, patchCommunitySettingsInputSchema, patchDmSettingsInputSchema, permissionSchema, setSpaceTopicsInputSchema, spaceDetailSchema, spaceMemberSchema, subscriptionViewSchema, updateCommunityInputSchema, updateSpaceInputSchema } from "@headless-lms/core/schemas";
3
+ import { communityStatusSchema, communityViewSchema, createCommunityInputSchema, createSpaceInputSchema, dmSettingsSchema, idSchema, patchCommunitySettingsInputSchema, patchDmSettingsInputSchema, permissionSchema, setSpaceTopicsInputSchema, spaceMemberSchema, spaceViewSchema, subscriptionViewSchema, updateCommunityInputSchema, updateSpaceInputSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/community.ts
5
5
  const Community = communityViewSchema;
6
6
  const CommunitiesQuery = ListQuery.extend({ status: communityStatusSchema.optional() });
@@ -10,7 +10,7 @@ const UpdateCommunity = updateCommunityInputSchema;
10
10
  const PatchDmSettings = patchDmSettingsInputSchema;
11
11
  const PatchCommunitySettings = patchCommunitySettingsInputSchema;
12
12
  const DmSettings = dmSettingsSchema;
13
- const SpaceDetail = spaceDetailSchema;
13
+ const SpaceDetail = spaceViewSchema;
14
14
  const SpaceMember = spaceMemberSchema;
15
15
  const SpaceMembersPage = paginated(SpaceMember);
16
16
  const CreateSpace = createSpaceInputSchema;
@@ -78,7 +78,10 @@ const CommunityHomeSpaceBase = z.object({
78
78
  "invited",
79
79
  "full",
80
80
  "none"
81
- ]).describe("Where the viewer stands with this space, and so which action it offers. `open`: the viewer can open it without joining (an all-members space, or the viewer opens every space). `member`: the viewer belongs to it. `requested`: the viewer asked to join and awaits a decision. `invited`: the viewer may accept or refuse an invitation. `full`: it is at capacity. `none`: none of these; ask to join a `by_request` space, or wait for an invitation to a `by_invite` one.")
81
+ ]).describe("Where the viewer stands with this space, and so which action it offers. `open`: the viewer can open it without joining (an all-members space, or the viewer opens every space). `member`: the viewer belongs to it. `requested`: the viewer asked to join and awaits a decision. `invited`: the viewer may accept or refuse an invitation. `full`: it is at capacity. `none`: none of these; ask to join a `by_request` space, or wait for an invitation to a `by_invite` one."),
82
+ coverUrl: z.string().nullable(),
83
+ backgroundUrl: z.string().nullable(),
84
+ iconUrl: z.string().nullable()
82
85
  });
83
86
  const LockedCommunitySpace = CommunityHomeSpaceBase.extend({ locked: z.literal(true).describe("The viewer cannot open this space. Only enough to request a place, accept an invite or contact the team is served; never its description, topics, links or settings") });
84
87
  const OpenCommunitySpace = CommunityHomeSpaceBase.extend({