@headless-lms/server 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/app/community-mail.d.ts +5 -3
- package/dist/app/community-mail.js +60 -12
- package/dist/app/community-mail.js.map +1 -1
- package/dist/app/container.d.ts +24 -3
- package/dist/app/container.js +102 -38
- package/dist/app/container.js.map +1 -1
- package/dist/app/notification-channels.js +1 -0
- package/dist/app/notification-channels.js.map +1 -1
- package/dist/app/notification-reads.d.ts +3 -3
- package/dist/app/notification-reads.js +7 -28
- package/dist/app/notification-reads.js.map +1 -1
- package/dist/app/platform.d.ts +14 -0
- package/dist/app/platform.js +14 -0
- package/dist/app/platform.js.map +1 -0
- package/dist/http/config.d.ts +4 -0
- package/dist/http/errors.js +9 -4
- package/dist/http/errors.js.map +1 -1
- package/dist/http/fastify.d.ts +8 -0
- package/dist/http/mcp/catalogue.d.ts +11 -9
- package/dist/http/mcp/catalogue.js +15 -21
- package/dist/http/mcp/catalogue.js.map +1 -1
- package/dist/http/mcp/challenge.js +3 -3
- package/dist/http/mcp/challenge.js.map +1 -1
- package/dist/http/mcp/route.js +7 -7
- package/dist/http/mcp/route.js.map +1 -1
- package/dist/http/mcp/test-support.d.ts +6 -5
- package/dist/http/mcp/test-support.js +32 -11
- package/dist/http/mcp/test-support.js.map +1 -1
- package/dist/http/mcp/tool.d.ts +3 -9
- package/dist/http/mcp/tool.js +14 -6
- package/dist/http/mcp/tool.js.map +1 -1
- package/dist/http/mcp/tools/automations.js +10 -20
- package/dist/http/mcp/tools/automations.js.map +1 -1
- package/dist/http/mcp/tools/catalog.js +25 -42
- package/dist/http/mcp/tools/catalog.js.map +1 -1
- package/dist/http/mcp/tools/comments.js +9 -19
- package/dist/http/mcp/tools/comments.js.map +1 -1
- package/dist/http/mcp/tools/communities.js +17 -32
- package/dist/http/mcp/tools/communities.js.map +1 -1
- package/dist/http/mcp/tools/community-members.js +9 -16
- package/dist/http/mcp/tools/community-members.js.map +1 -1
- package/dist/http/mcp/tools/community-moderation.js +13 -25
- package/dist/http/mcp/tools/community-moderation.js.map +1 -1
- package/dist/http/mcp/tools/courses.js +11 -21
- package/dist/http/mcp/tools/courses.js.map +1 -1
- package/dist/http/mcp/tools/events.d.ts +6 -0
- package/dist/http/mcp/tools/events.js +170 -0
- package/dist/http/mcp/tools/events.js.map +1 -0
- package/dist/http/mcp/tools/index.d.ts +5 -1
- package/dist/http/mcp/tools/index.js +45 -10
- package/dist/http/mcp/tools/index.js.map +1 -1
- package/dist/http/mcp/tools/organization.d.ts +6 -0
- package/dist/http/mcp/tools/organization.js +214 -0
- package/dist/http/mcp/tools/organization.js.map +1 -0
- package/dist/http/mcp/tools/people.js +30 -49
- package/dist/http/mcp/tools/people.js.map +1 -1
- package/dist/http/plugins/auth.js +37 -8
- package/dist/http/plugins/auth.js.map +1 -1
- package/dist/http/plugins/error-handler.d.ts +5 -1
- package/dist/http/plugins/error-handler.js +10 -2
- package/dist/http/plugins/error-handler.js.map +1 -1
- package/dist/http/plugins/openapi.js +18 -2
- package/dist/http/plugins/openapi.js.map +1 -1
- package/dist/http/plugins/platform.d.ts +7 -0
- package/dist/http/plugins/platform.js +13 -0
- package/dist/http/plugins/platform.js.map +1 -0
- package/dist/http/routes/access.js +54 -36
- package/dist/http/routes/access.js.map +1 -1
- package/dist/http/routes/activities.js +45 -45
- package/dist/http/routes/activities.js.map +1 -1
- package/dist/http/routes/assets.js +30 -65
- package/dist/http/routes/assets.js.map +1 -1
- package/dist/http/routes/automations.js +37 -42
- package/dist/http/routes/automations.js.map +1 -1
- package/dist/http/routes/bundles.js +33 -36
- package/dist/http/routes/bundles.js.map +1 -1
- package/dist/http/routes/communities.js +93 -145
- package/dist/http/routes/communities.js.map +1 -1
- package/dist/http/routes/community-moderation.js +83 -137
- package/dist/http/routes/community-moderation.js.map +1 -1
- package/dist/http/routes/course-analytics.js +32 -15
- package/dist/http/routes/course-analytics.js.map +1 -1
- package/dist/http/routes/courses.js +25 -32
- package/dist/http/routes/courses.js.map +1 -1
- package/dist/http/routes/dashboard.js +9 -9
- package/dist/http/routes/dashboard.js.map +1 -1
- package/dist/http/routes/discussion.js +21 -39
- package/dist/http/routes/discussion.js.map +1 -1
- package/dist/http/routes/downloads.js +41 -47
- package/dist/http/routes/downloads.js.map +1 -1
- package/dist/http/routes/entitlements.js +19 -23
- package/dist/http/routes/entitlements.js.map +1 -1
- package/dist/http/routes/events.d.ts +7 -0
- package/dist/http/routes/events.js +333 -0
- package/dist/http/routes/events.js.map +1 -0
- package/dist/http/routes/integrations.js +40 -73
- package/dist/http/routes/integrations.js.map +1 -1
- package/dist/http/routes/member/assets.js +10 -13
- package/dist/http/routes/member/assets.js.map +1 -1
- package/dist/http/routes/member/chats.js +170 -47
- package/dist/http/routes/member/chats.js.map +1 -1
- package/dist/http/routes/member/comments.js +65 -26
- package/dist/http/routes/member/comments.js.map +1 -1
- package/dist/http/routes/member/community.js +45 -52
- package/dist/http/routes/member/community.js.map +1 -1
- package/dist/http/routes/member/courses.js +12 -19
- package/dist/http/routes/member/courses.js.map +1 -1
- package/dist/http/routes/member/devices.js +9 -10
- package/dist/http/routes/member/devices.js.map +1 -1
- package/dist/http/routes/member/downloads.js +6 -9
- package/dist/http/routes/member/downloads.js.map +1 -1
- package/dist/http/routes/member/events.d.ts +7 -0
- package/dist/http/routes/member/events.js +386 -0
- package/dist/http/routes/member/events.js.map +1 -0
- package/dist/http/routes/member/files.js +88 -46
- package/dist/http/routes/member/files.js.map +1 -1
- package/dist/http/routes/member/index.js +2 -0
- package/dist/http/routes/member/index.js.map +1 -1
- package/dist/http/routes/member/notification-settings.js +15 -23
- package/dist/http/routes/member/notification-settings.js.map +1 -1
- package/dist/http/routes/member/notifications.js +16 -16
- package/dist/http/routes/member/notifications.js.map +1 -1
- package/dist/http/routes/member/org.js +5 -15
- package/dist/http/routes/member/org.js.map +1 -1
- package/dist/http/routes/member/posts.js +67 -68
- package/dist/http/routes/member/posts.js.map +1 -1
- package/dist/http/routes/member/profile.js +15 -6
- package/dist/http/routes/member/profile.js.map +1 -1
- package/dist/http/routes/member/progress.js +7 -11
- package/dist/http/routes/member/progress.js.map +1 -1
- package/dist/http/routes/organizations.js +319 -135
- package/dist/http/routes/organizations.js.map +1 -1
- package/dist/http/routes/platform.d.ts +7 -0
- package/dist/http/routes/platform.js +61 -0
- package/dist/http/routes/platform.js.map +1 -0
- package/dist/http/routes/students.js +12 -75
- package/dist/http/routes/students.js.map +1 -1
- package/dist/http/routes/webhooks.js +30 -39
- package/dist/http/routes/webhooks.js.map +1 -1
- package/dist/http/routes.js +9 -0
- package/dist/http/routes.js.map +1 -1
- package/dist/http/schemas/access.d.ts +346 -64
- package/dist/http/schemas/access.js +39 -12
- package/dist/http/schemas/access.js.map +1 -1
- package/dist/http/schemas/assets.d.ts +8 -3
- package/dist/http/schemas/assets.js +6 -5
- package/dist/http/schemas/assets.js.map +1 -1
- package/dist/http/schemas/automations.d.ts +4 -4
- package/dist/http/schemas/chats.d.ts +216 -37
- package/dist/http/schemas/chats.js +13 -4
- package/dist/http/schemas/chats.js.map +1 -1
- package/dist/http/schemas/community.d.ts +105 -31
- package/dist/http/schemas/community.js +25 -9
- package/dist/http/schemas/community.js.map +1 -1
- package/dist/http/schemas/course-analytics.d.ts +51 -1
- package/dist/http/schemas/course-analytics.js +19 -1
- package/dist/http/schemas/course-analytics.js.map +1 -1
- package/dist/http/schemas/dashboard.d.ts +1 -0
- package/dist/http/schemas/dashboard.js +2 -1
- package/dist/http/schemas/dashboard.js.map +1 -1
- package/dist/http/schemas/discussion.d.ts +22 -72
- package/dist/http/schemas/discussion.js +2 -2
- package/dist/http/schemas/discussion.js.map +1 -1
- package/dist/http/schemas/entitlements.d.ts +9 -12
- package/dist/http/schemas/entitlements.js +11 -5
- package/dist/http/schemas/entitlements.js.map +1 -1
- package/dist/http/schemas/events.d.ts +527 -0
- package/dist/http/schemas/events.js +64 -0
- package/dist/http/schemas/events.js.map +1 -0
- package/dist/http/schemas/files.d.ts +24 -5
- package/dist/http/schemas/files.js +15 -2
- package/dist/http/schemas/files.js.map +1 -1
- package/dist/http/schemas/index.d.ts +11 -9
- package/dist/http/schemas/index.js +11 -9
- package/dist/http/schemas/invites.d.ts +3 -47
- package/dist/http/schemas/invites.js +4 -25
- package/dist/http/schemas/invites.js.map +1 -1
- package/dist/http/schemas/member.d.ts +94 -7
- package/dist/http/schemas/member.js +7 -3
- package/dist/http/schemas/member.js.map +1 -1
- package/dist/http/schemas/members.d.ts +329 -65
- package/dist/http/schemas/members.js +67 -25
- package/dist/http/schemas/members.js.map +1 -1
- package/dist/http/schemas/notifications.d.ts +58 -54
- package/dist/http/schemas/platform.d.ts +38 -0
- package/dist/http/schemas/platform.js +19 -0
- package/dist/http/schemas/platform.js.map +1 -0
- package/dist/http/schemas/posts.d.ts +55 -35
- package/dist/http/schemas/posts.js +4 -4
- package/dist/http/schemas/posts.js.map +1 -1
- package/dist/http/schemas/profile.d.ts +1 -1
- package/dist/http/schemas/shared.d.ts +1 -11
- package/dist/http/schemas/shared.js +1 -10
- package/dist/http/schemas/shared.js.map +1 -1
- package/dist/http/schemas/students.d.ts +22 -0
- package/dist/http/schemas/students.js +3 -1
- package/dist/http/schemas/students.js.map +1 -1
- package/dist/http/scope.d.ts +9 -13
- package/dist/http/scope.js +29 -40
- package/dist/http/scope.js.map +1 -1
- package/dist/http/server.js +9 -0
- package/dist/http/server.js.map +1 -1
- package/dist/http/shutdown.d.ts +11 -0
- package/dist/http/shutdown.js +40 -0
- package/dist/http/shutdown.js.map +1 -0
- package/dist/http/sse.d.ts +19 -0
- package/dist/http/sse.js +104 -0
- package/dist/http/sse.js.map +1 -0
- package/dist/http/test-caller.d.ts +13 -0
- package/dist/http/test-caller.js +14 -0
- package/dist/http/test-caller.js.map +1 -0
- package/dist/http/well-known.js +2 -2
- package/dist/http/well-known.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/packages/server/package.js +1 -1
- package/package.json +7 -6
- package/dist/http/routes/member/actor.d.ts +0 -14
- package/dist/http/routes/member/actor.js +0 -11
- package/dist/http/routes/member/actor.js.map +0 -1
package/dist/http/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","names":[],"sources":["../../src/http/routes.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { Container } from '../app/container.js';\nimport { communitiesRoutes } from './routes/communities.js';\nimport { communityModerationRoutes } from './routes/community-moderation.js';\nimport { coursesRoutes } from './routes/courses.js';\nimport { downloadsRoutes } from './routes/downloads.js';\nimport { bundlesRoutes } from './routes/bundles.js';\nimport { memberRoutes } from './routes/member/index.js';\nimport { discussionRoutes } from './routes/discussion.js';\nimport { activitiesRoutes } from './routes/activities.js';\nimport { studentsRoutes } from './routes/students.js';\nimport { entitlementsRoutes } from './routes/entitlements.js';\nimport { automationsRoutes } from './routes/automations.js';\nimport { webhooksRoutes } from './routes/webhooks.js';\nimport { organizationsRoutes } from './routes/organizations.js';\nimport { dashboardRoutes } from './routes/dashboard.js';\nimport { courseAnalyticsRoutes } from './routes/course-analytics.js';\nimport { assetsRoutes } from './routes/assets.js';\nimport { integrationsRoutes } from './routes/integrations.js';\nimport { accessRoutes } from './routes/access.js';\n\nexport function registerRoutes(app: FastifyInstance, container: Container): void {\n app.get('/health', async () => ({ status: 'ok' }));\n\n app.register(async (instance) => {\n // instance.addHook('onRequest', instance.requireSession);\n await organizationsRoutes(instance, container);\n });\n\n app.register(async (instance) => {\n instance.addHook('onRequest', instance.requireOrgSession);\n await coursesRoutes(instance, container);\n await communitiesRoutes(instance, container);\n await communityModerationRoutes(instance, container);\n await downloadsRoutes(instance, container);\n await bundlesRoutes(instance, container);\n await memberRoutes(instance, container);\n await discussionRoutes(instance, container);\n await activitiesRoutes(instance, container);\n await studentsRoutes(instance, container);\n await entitlementsRoutes(instance, container);\n await automationsRoutes(instance, container);\n await webhooksRoutes(instance, container);\n await dashboardRoutes(instance, container);\n await courseAnalyticsRoutes(instance, container);\n await assetsRoutes(instance, container);\n await integrationsRoutes(instance, container);\n await accessRoutes(instance, container);\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.js","names":[],"sources":["../../src/http/routes.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { Container } from '../app/container.js';\nimport { communitiesRoutes } from './routes/communities.js';\nimport { communityModerationRoutes } from './routes/community-moderation.js';\nimport { coursesRoutes } from './routes/courses.js';\nimport { downloadsRoutes } from './routes/downloads.js';\nimport { eventsRoutes } from './routes/events.js';\nimport { bundlesRoutes } from './routes/bundles.js';\nimport { memberRoutes } from './routes/member/index.js';\nimport { discussionRoutes } from './routes/discussion.js';\nimport { activitiesRoutes } from './routes/activities.js';\nimport { studentsRoutes } from './routes/students.js';\nimport { entitlementsRoutes } from './routes/entitlements.js';\nimport { automationsRoutes } from './routes/automations.js';\nimport { webhooksRoutes } from './routes/webhooks.js';\nimport { organizationsRoutes } from './routes/organizations.js';\nimport { dashboardRoutes } from './routes/dashboard.js';\nimport { courseAnalyticsRoutes } from './routes/course-analytics.js';\nimport { assetsRoutes } from './routes/assets.js';\nimport { integrationsRoutes } from './routes/integrations.js';\nimport { accessRoutes } from './routes/access.js';\nimport { platformRoutes } from './routes/platform.js';\nimport { registerPlatformAuth } from './plugins/platform.js';\n\nexport function registerRoutes(app: FastifyInstance, container: Container): void {\n app.get('/health', async () => ({ status: 'ok' }));\n\n app.register(async (instance) => {\n // instance.addHook('onRequest', instance.requireSession);\n await organizationsRoutes(instance, container);\n });\n\n app.register(async (instance) => {\n instance.addHook('onRequest', instance.requireOrgSession);\n await coursesRoutes(instance, container);\n await communitiesRoutes(instance, container);\n await communityModerationRoutes(instance, container);\n await downloadsRoutes(instance, container);\n await eventsRoutes(instance, container);\n await bundlesRoutes(instance, container);\n await memberRoutes(instance, container);\n await discussionRoutes(instance, container);\n await activitiesRoutes(instance, container);\n await studentsRoutes(instance, container);\n await entitlementsRoutes(instance, container);\n await automationsRoutes(instance, container);\n await webhooksRoutes(instance, container);\n await dashboardRoutes(instance, container);\n await courseAnalyticsRoutes(instance, container);\n await assetsRoutes(instance, container);\n await integrationsRoutes(instance, container);\n await accessRoutes(instance, container);\n });\n\n const platform = container.platform;\n if (platform) {\n app.register(async (instance) => {\n registerPlatformAuth(instance, platform);\n await platformRoutes(instance, container);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,eAAe,KAAsB,WAA4B;CAC/E,IAAI,IAAI,WAAW,aAAa,EAAE,QAAQ,KAAK,EAAE;CAEjD,IAAI,SAAS,OAAO,aAAa;EAE/B,MAAM,oBAAoB,UAAU,SAAS;CAC/C,CAAC;CAED,IAAI,SAAS,OAAO,aAAa;EAC/B,SAAS,QAAQ,aAAa,SAAS,iBAAiB;EACxD,MAAM,cAAc,UAAU,SAAS;EACvC,MAAM,kBAAkB,UAAU,SAAS;EAC3C,MAAM,0BAA0B,UAAU,SAAS;EACnD,MAAM,gBAAgB,UAAU,SAAS;EACzC,MAAM,aAAa,UAAU,SAAS;EACtC,MAAM,cAAc,UAAU,SAAS;EACvC,MAAM,aAAa,UAAU,SAAS;EACtC,MAAM,iBAAiB,UAAU,SAAS;EAC1C,MAAM,iBAAiB,UAAU,SAAS;EAC1C,MAAM,eAAe,UAAU,SAAS;EACxC,MAAM,mBAAmB,UAAU,SAAS;EAC5C,MAAM,kBAAkB,UAAU,SAAS;EAC3C,MAAM,eAAe,UAAU,SAAS;EACxC,MAAM,gBAAgB,UAAU,SAAS;EACzC,MAAM,sBAAsB,UAAU,SAAS;EAC/C,MAAM,aAAa,UAAU,SAAS;EACtC,MAAM,mBAAmB,UAAU,SAAS;EAC5C,MAAM,aAAa,UAAU,SAAS;CACxC,CAAC;CAED,MAAM,WAAW,UAAU;CAC3B,IAAI,UACF,IAAI,SAAS,OAAO,aAAa;EAC/B,qBAAqB,UAAU,QAAQ;EACvC,MAAM,eAAe,UAAU,SAAS;CAC1C,CAAC;AAEL"}
|
|
@@ -1,69 +1,355 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/http/schemas/access.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
|
|
3
|
+
declare const Permission: z.ZodEnum<{
|
|
4
|
+
"organizations:read": "organizations:read";
|
|
5
|
+
"organizations:write": "organizations:write";
|
|
6
|
+
"api_keys:read": "api_keys:read";
|
|
7
|
+
"api_keys:write": "api_keys:write";
|
|
8
|
+
"api_keys:delete": "api_keys:delete";
|
|
9
|
+
"notification_categories:read": "notification_categories:read";
|
|
10
|
+
"notification_categories:write": "notification_categories:write";
|
|
11
|
+
"integrations:read": "integrations:read";
|
|
12
|
+
"integrations:write": "integrations:write";
|
|
13
|
+
"integrations:delete": "integrations:delete";
|
|
14
|
+
"analytics:read": "analytics:read";
|
|
15
|
+
"people:read": "people:read";
|
|
16
|
+
"people:write": "people:write";
|
|
17
|
+
"people:delete": "people:delete";
|
|
18
|
+
"roles:read": "roles:read";
|
|
19
|
+
"roles:write": "roles:write";
|
|
20
|
+
"roles:delete": "roles:delete";
|
|
21
|
+
"access:read": "access:read";
|
|
22
|
+
"access:write": "access:write";
|
|
23
|
+
"bundles:read": "bundles:read";
|
|
24
|
+
"bundles:write": "bundles:write";
|
|
25
|
+
"bundles:delete": "bundles:delete";
|
|
26
|
+
"media:read": "media:read";
|
|
27
|
+
"media:write": "media:write";
|
|
28
|
+
"media:delete": "media:delete";
|
|
29
|
+
"courses:read": "courses:read";
|
|
30
|
+
"courses:write": "courses:write";
|
|
31
|
+
"courses:delete": "courses:delete";
|
|
32
|
+
"courses:moderate": "courses:moderate";
|
|
33
|
+
"progress:read": "progress:read";
|
|
34
|
+
"downloads:read": "downloads:read";
|
|
35
|
+
"downloads:write": "downloads:write";
|
|
36
|
+
"downloads:delete": "downloads:delete";
|
|
37
|
+
"communities:read": "communities:read";
|
|
38
|
+
"communities:write": "communities:write";
|
|
39
|
+
"communities:delete": "communities:delete";
|
|
40
|
+
"communities:moderate": "communities:moderate";
|
|
41
|
+
"events:read": "events:read";
|
|
42
|
+
"events:write": "events:write";
|
|
43
|
+
"events:delete": "events:delete";
|
|
44
|
+
"automations:read": "automations:read";
|
|
45
|
+
"automations:write": "automations:write";
|
|
46
|
+
"automations:delete": "automations:delete";
|
|
47
|
+
}>;
|
|
48
|
+
declare const Level: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
|
|
49
|
+
course: "course";
|
|
50
|
+
download: "download";
|
|
51
|
+
community: "community";
|
|
52
|
+
event: "event";
|
|
53
|
+
}>>]>;
|
|
54
|
+
declare const PermissionDefinition: z.ZodObject<{
|
|
55
|
+
key: z.ZodEnum<{
|
|
56
|
+
"organizations:read": "organizations:read";
|
|
57
|
+
"organizations:write": "organizations:write";
|
|
58
|
+
"api_keys:read": "api_keys:read";
|
|
59
|
+
"api_keys:write": "api_keys:write";
|
|
60
|
+
"api_keys:delete": "api_keys:delete";
|
|
61
|
+
"notification_categories:read": "notification_categories:read";
|
|
62
|
+
"notification_categories:write": "notification_categories:write";
|
|
63
|
+
"integrations:read": "integrations:read";
|
|
64
|
+
"integrations:write": "integrations:write";
|
|
65
|
+
"integrations:delete": "integrations:delete";
|
|
66
|
+
"analytics:read": "analytics:read";
|
|
67
|
+
"people:read": "people:read";
|
|
68
|
+
"people:write": "people:write";
|
|
69
|
+
"people:delete": "people:delete";
|
|
70
|
+
"roles:read": "roles:read";
|
|
71
|
+
"roles:write": "roles:write";
|
|
72
|
+
"roles:delete": "roles:delete";
|
|
73
|
+
"access:read": "access:read";
|
|
74
|
+
"access:write": "access:write";
|
|
75
|
+
"bundles:read": "bundles:read";
|
|
76
|
+
"bundles:write": "bundles:write";
|
|
77
|
+
"bundles:delete": "bundles:delete";
|
|
78
|
+
"media:read": "media:read";
|
|
79
|
+
"media:write": "media:write";
|
|
80
|
+
"media:delete": "media:delete";
|
|
5
81
|
"courses:read": "courses:read";
|
|
6
82
|
"courses:write": "courses:write";
|
|
7
83
|
"courses:delete": "courses:delete";
|
|
84
|
+
"courses:moderate": "courses:moderate";
|
|
85
|
+
"progress:read": "progress:read";
|
|
8
86
|
"downloads:read": "downloads:read";
|
|
9
87
|
"downloads:write": "downloads:write";
|
|
10
88
|
"downloads:delete": "downloads:delete";
|
|
89
|
+
"communities:read": "communities:read";
|
|
90
|
+
"communities:write": "communities:write";
|
|
91
|
+
"communities:delete": "communities:delete";
|
|
92
|
+
"communities:moderate": "communities:moderate";
|
|
93
|
+
"events:read": "events:read";
|
|
94
|
+
"events:write": "events:write";
|
|
95
|
+
"events:delete": "events:delete";
|
|
96
|
+
"automations:read": "automations:read";
|
|
97
|
+
"automations:write": "automations:write";
|
|
98
|
+
"automations:delete": "automations:delete";
|
|
99
|
+
}>;
|
|
100
|
+
group: z.ZodString;
|
|
101
|
+
label: z.ZodString;
|
|
102
|
+
description: z.ZodString;
|
|
103
|
+
about: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
|
|
104
|
+
course: "course";
|
|
105
|
+
download: "download";
|
|
106
|
+
community: "community";
|
|
107
|
+
event: "event";
|
|
108
|
+
}>>]>;
|
|
109
|
+
implies: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
110
|
+
"organizations:read": "organizations:read";
|
|
111
|
+
"organizations:write": "organizations:write";
|
|
112
|
+
"api_keys:read": "api_keys:read";
|
|
113
|
+
"api_keys:write": "api_keys:write";
|
|
114
|
+
"api_keys:delete": "api_keys:delete";
|
|
115
|
+
"notification_categories:read": "notification_categories:read";
|
|
116
|
+
"notification_categories:write": "notification_categories:write";
|
|
117
|
+
"integrations:read": "integrations:read";
|
|
118
|
+
"integrations:write": "integrations:write";
|
|
119
|
+
"integrations:delete": "integrations:delete";
|
|
120
|
+
"analytics:read": "analytics:read";
|
|
121
|
+
"people:read": "people:read";
|
|
122
|
+
"people:write": "people:write";
|
|
123
|
+
"people:delete": "people:delete";
|
|
124
|
+
"roles:read": "roles:read";
|
|
125
|
+
"roles:write": "roles:write";
|
|
126
|
+
"roles:delete": "roles:delete";
|
|
127
|
+
"access:read": "access:read";
|
|
128
|
+
"access:write": "access:write";
|
|
11
129
|
"bundles:read": "bundles:read";
|
|
12
130
|
"bundles:write": "bundles:write";
|
|
13
131
|
"bundles:delete": "bundles:delete";
|
|
14
132
|
"media:read": "media:read";
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
133
|
+
"media:write": "media:write";
|
|
134
|
+
"media:delete": "media:delete";
|
|
135
|
+
"courses:read": "courses:read";
|
|
136
|
+
"courses:write": "courses:write";
|
|
137
|
+
"courses:delete": "courses:delete";
|
|
138
|
+
"courses:moderate": "courses:moderate";
|
|
139
|
+
"progress:read": "progress:read";
|
|
140
|
+
"downloads:read": "downloads:read";
|
|
141
|
+
"downloads:write": "downloads:write";
|
|
142
|
+
"downloads:delete": "downloads:delete";
|
|
143
|
+
"communities:read": "communities:read";
|
|
144
|
+
"communities:write": "communities:write";
|
|
145
|
+
"communities:delete": "communities:delete";
|
|
146
|
+
"communities:moderate": "communities:moderate";
|
|
147
|
+
"events:read": "events:read";
|
|
148
|
+
"events:write": "events:write";
|
|
149
|
+
"events:delete": "events:delete";
|
|
20
150
|
"automations:read": "automations:read";
|
|
21
151
|
"automations:write": "automations:write";
|
|
22
152
|
"automations:delete": "automations:delete";
|
|
23
|
-
|
|
24
|
-
|
|
153
|
+
}>>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
declare const PermissionDefinitionList: z.ZodArray<z.ZodObject<{
|
|
156
|
+
key: z.ZodEnum<{
|
|
157
|
+
"organizations:read": "organizations:read";
|
|
158
|
+
"organizations:write": "organizations:write";
|
|
159
|
+
"api_keys:read": "api_keys:read";
|
|
160
|
+
"api_keys:write": "api_keys:write";
|
|
161
|
+
"api_keys:delete": "api_keys:delete";
|
|
162
|
+
"notification_categories:read": "notification_categories:read";
|
|
163
|
+
"notification_categories:write": "notification_categories:write";
|
|
164
|
+
"integrations:read": "integrations:read";
|
|
165
|
+
"integrations:write": "integrations:write";
|
|
166
|
+
"integrations:delete": "integrations:delete";
|
|
167
|
+
"analytics:read": "analytics:read";
|
|
168
|
+
"people:read": "people:read";
|
|
169
|
+
"people:write": "people:write";
|
|
170
|
+
"people:delete": "people:delete";
|
|
171
|
+
"roles:read": "roles:read";
|
|
172
|
+
"roles:write": "roles:write";
|
|
173
|
+
"roles:delete": "roles:delete";
|
|
174
|
+
"access:read": "access:read";
|
|
175
|
+
"access:write": "access:write";
|
|
176
|
+
"bundles:read": "bundles:read";
|
|
177
|
+
"bundles:write": "bundles:write";
|
|
178
|
+
"bundles:delete": "bundles:delete";
|
|
179
|
+
"media:read": "media:read";
|
|
180
|
+
"media:write": "media:write";
|
|
181
|
+
"media:delete": "media:delete";
|
|
182
|
+
"courses:read": "courses:read";
|
|
183
|
+
"courses:write": "courses:write";
|
|
184
|
+
"courses:delete": "courses:delete";
|
|
185
|
+
"courses:moderate": "courses:moderate";
|
|
186
|
+
"progress:read": "progress:read";
|
|
187
|
+
"downloads:read": "downloads:read";
|
|
188
|
+
"downloads:write": "downloads:write";
|
|
189
|
+
"downloads:delete": "downloads:delete";
|
|
25
190
|
"communities:read": "communities:read";
|
|
26
191
|
"communities:write": "communities:write";
|
|
27
192
|
"communities:delete": "communities:delete";
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
193
|
+
"communities:moderate": "communities:moderate";
|
|
194
|
+
"events:read": "events:read";
|
|
195
|
+
"events:write": "events:write";
|
|
196
|
+
"events:delete": "events:delete";
|
|
197
|
+
"automations:read": "automations:read";
|
|
198
|
+
"automations:write": "automations:write";
|
|
199
|
+
"automations:delete": "automations:delete";
|
|
32
200
|
}>;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
201
|
+
group: z.ZodString;
|
|
202
|
+
label: z.ZodString;
|
|
203
|
+
description: z.ZodString;
|
|
204
|
+
about: z.ZodUnion<readonly [z.ZodLiteral<"org">, z.ZodLazy<z.ZodEnum<{
|
|
205
|
+
course: "course";
|
|
206
|
+
download: "download";
|
|
207
|
+
community: "community";
|
|
208
|
+
event: "event";
|
|
209
|
+
}>>]>;
|
|
210
|
+
implies: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
211
|
+
"organizations:read": "organizations:read";
|
|
212
|
+
"organizations:write": "organizations:write";
|
|
213
|
+
"api_keys:read": "api_keys:read";
|
|
214
|
+
"api_keys:write": "api_keys:write";
|
|
215
|
+
"api_keys:delete": "api_keys:delete";
|
|
216
|
+
"notification_categories:read": "notification_categories:read";
|
|
217
|
+
"notification_categories:write": "notification_categories:write";
|
|
218
|
+
"integrations:read": "integrations:read";
|
|
219
|
+
"integrations:write": "integrations:write";
|
|
220
|
+
"integrations:delete": "integrations:delete";
|
|
221
|
+
"analytics:read": "analytics:read";
|
|
222
|
+
"people:read": "people:read";
|
|
223
|
+
"people:write": "people:write";
|
|
224
|
+
"people:delete": "people:delete";
|
|
225
|
+
"roles:read": "roles:read";
|
|
226
|
+
"roles:write": "roles:write";
|
|
227
|
+
"roles:delete": "roles:delete";
|
|
228
|
+
"access:read": "access:read";
|
|
229
|
+
"access:write": "access:write";
|
|
230
|
+
"bundles:read": "bundles:read";
|
|
231
|
+
"bundles:write": "bundles:write";
|
|
232
|
+
"bundles:delete": "bundles:delete";
|
|
233
|
+
"media:read": "media:read";
|
|
234
|
+
"media:write": "media:write";
|
|
235
|
+
"media:delete": "media:delete";
|
|
37
236
|
"courses:read": "courses:read";
|
|
38
237
|
"courses:write": "courses:write";
|
|
39
238
|
"courses:delete": "courses:delete";
|
|
239
|
+
"courses:moderate": "courses:moderate";
|
|
240
|
+
"progress:read": "progress:read";
|
|
40
241
|
"downloads:read": "downloads:read";
|
|
41
242
|
"downloads:write": "downloads:write";
|
|
42
243
|
"downloads:delete": "downloads:delete";
|
|
244
|
+
"communities:read": "communities:read";
|
|
245
|
+
"communities:write": "communities:write";
|
|
246
|
+
"communities:delete": "communities:delete";
|
|
247
|
+
"communities:moderate": "communities:moderate";
|
|
248
|
+
"events:read": "events:read";
|
|
249
|
+
"events:write": "events:write";
|
|
250
|
+
"events:delete": "events:delete";
|
|
251
|
+
"automations:read": "automations:read";
|
|
252
|
+
"automations:write": "automations:write";
|
|
253
|
+
"automations:delete": "automations:delete";
|
|
254
|
+
}>>>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
declare const ViewerPermissions: z.ZodObject<{
|
|
257
|
+
orgRole: z.ZodObject<{
|
|
258
|
+
key: z.ZodString;
|
|
259
|
+
name: z.ZodString;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
isOwner: z.ZodBoolean;
|
|
262
|
+
org: z.ZodArray<z.ZodEnum<{
|
|
263
|
+
"organizations:read": "organizations:read";
|
|
264
|
+
"organizations:write": "organizations:write";
|
|
265
|
+
"api_keys:read": "api_keys:read";
|
|
266
|
+
"api_keys:write": "api_keys:write";
|
|
267
|
+
"api_keys:delete": "api_keys:delete";
|
|
268
|
+
"notification_categories:read": "notification_categories:read";
|
|
269
|
+
"notification_categories:write": "notification_categories:write";
|
|
270
|
+
"integrations:read": "integrations:read";
|
|
271
|
+
"integrations:write": "integrations:write";
|
|
272
|
+
"integrations:delete": "integrations:delete";
|
|
273
|
+
"analytics:read": "analytics:read";
|
|
274
|
+
"people:read": "people:read";
|
|
275
|
+
"people:write": "people:write";
|
|
276
|
+
"people:delete": "people:delete";
|
|
277
|
+
"roles:read": "roles:read";
|
|
278
|
+
"roles:write": "roles:write";
|
|
279
|
+
"roles:delete": "roles:delete";
|
|
280
|
+
"access:read": "access:read";
|
|
281
|
+
"access:write": "access:write";
|
|
43
282
|
"bundles:read": "bundles:read";
|
|
44
283
|
"bundles:write": "bundles:write";
|
|
45
284
|
"bundles:delete": "bundles:delete";
|
|
46
285
|
"media:read": "media:read";
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
286
|
+
"media:write": "media:write";
|
|
287
|
+
"media:delete": "media:delete";
|
|
288
|
+
"courses:read": "courses:read";
|
|
289
|
+
"courses:write": "courses:write";
|
|
290
|
+
"courses:delete": "courses:delete";
|
|
291
|
+
"courses:moderate": "courses:moderate";
|
|
292
|
+
"progress:read": "progress:read";
|
|
293
|
+
"downloads:read": "downloads:read";
|
|
294
|
+
"downloads:write": "downloads:write";
|
|
295
|
+
"downloads:delete": "downloads:delete";
|
|
296
|
+
"communities:read": "communities:read";
|
|
297
|
+
"communities:write": "communities:write";
|
|
298
|
+
"communities:delete": "communities:delete";
|
|
299
|
+
"communities:moderate": "communities:moderate";
|
|
300
|
+
"events:read": "events:read";
|
|
301
|
+
"events:write": "events:write";
|
|
302
|
+
"events:delete": "events:delete";
|
|
52
303
|
"automations:read": "automations:read";
|
|
53
304
|
"automations:write": "automations:write";
|
|
54
305
|
"automations:delete": "automations:delete";
|
|
55
|
-
|
|
56
|
-
|
|
306
|
+
}>>;
|
|
307
|
+
content: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodEnum<{
|
|
308
|
+
"organizations:read": "organizations:read";
|
|
309
|
+
"organizations:write": "organizations:write";
|
|
310
|
+
"api_keys:read": "api_keys:read";
|
|
311
|
+
"api_keys:write": "api_keys:write";
|
|
312
|
+
"api_keys:delete": "api_keys:delete";
|
|
313
|
+
"notification_categories:read": "notification_categories:read";
|
|
314
|
+
"notification_categories:write": "notification_categories:write";
|
|
315
|
+
"integrations:read": "integrations:read";
|
|
316
|
+
"integrations:write": "integrations:write";
|
|
317
|
+
"integrations:delete": "integrations:delete";
|
|
318
|
+
"analytics:read": "analytics:read";
|
|
319
|
+
"people:read": "people:read";
|
|
320
|
+
"people:write": "people:write";
|
|
321
|
+
"people:delete": "people:delete";
|
|
322
|
+
"roles:read": "roles:read";
|
|
323
|
+
"roles:write": "roles:write";
|
|
324
|
+
"roles:delete": "roles:delete";
|
|
325
|
+
"access:read": "access:read";
|
|
326
|
+
"access:write": "access:write";
|
|
327
|
+
"bundles:read": "bundles:read";
|
|
328
|
+
"bundles:write": "bundles:write";
|
|
329
|
+
"bundles:delete": "bundles:delete";
|
|
330
|
+
"media:read": "media:read";
|
|
331
|
+
"media:write": "media:write";
|
|
332
|
+
"media:delete": "media:delete";
|
|
333
|
+
"courses:read": "courses:read";
|
|
334
|
+
"courses:write": "courses:write";
|
|
335
|
+
"courses:delete": "courses:delete";
|
|
336
|
+
"courses:moderate": "courses:moderate";
|
|
337
|
+
"progress:read": "progress:read";
|
|
338
|
+
"downloads:read": "downloads:read";
|
|
339
|
+
"downloads:write": "downloads:write";
|
|
340
|
+
"downloads:delete": "downloads:delete";
|
|
57
341
|
"communities:read": "communities:read";
|
|
58
342
|
"communities:write": "communities:write";
|
|
59
343
|
"communities:delete": "communities:delete";
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
344
|
+
"communities:moderate": "communities:moderate";
|
|
345
|
+
"events:read": "events:read";
|
|
346
|
+
"events:write": "events:write";
|
|
347
|
+
"events:delete": "events:delete";
|
|
348
|
+
"automations:read": "automations:read";
|
|
349
|
+
"automations:write": "automations:write";
|
|
350
|
+
"automations:delete": "automations:delete";
|
|
351
|
+
}>>>;
|
|
352
|
+
}, z.core.$strip>;
|
|
67
353
|
declare const ConnectedApp: z.ZodObject<{
|
|
68
354
|
clientId: z.ZodString;
|
|
69
355
|
name: z.ZodString;
|
|
@@ -85,62 +371,58 @@ declare const ApiKey: z.ZodObject<{
|
|
|
85
371
|
id: z.ZodString;
|
|
86
372
|
name: z.ZodNullable<z.ZodString>;
|
|
87
373
|
start: z.ZodNullable<z.ZodString>;
|
|
88
|
-
|
|
374
|
+
role: z.ZodNullable<z.ZodObject<{
|
|
375
|
+
key: z.ZodString;
|
|
376
|
+
name: z.ZodNullable<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>>;
|
|
89
378
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
90
379
|
lastUsedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
380
|
+
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
91
381
|
}, z.core.$strip>;
|
|
92
382
|
declare const ApiKeyList: z.ZodArray<z.ZodObject<{
|
|
93
383
|
id: z.ZodString;
|
|
94
384
|
name: z.ZodNullable<z.ZodString>;
|
|
95
385
|
start: z.ZodNullable<z.ZodString>;
|
|
96
|
-
|
|
386
|
+
role: z.ZodNullable<z.ZodObject<{
|
|
387
|
+
key: z.ZodString;
|
|
388
|
+
name: z.ZodNullable<z.ZodString>;
|
|
389
|
+
}, z.core.$strip>>;
|
|
97
390
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
98
391
|
lastUsedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
392
|
+
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
99
393
|
}, z.core.$strip>>;
|
|
100
394
|
declare const CreatedApiKey: z.ZodObject<{
|
|
101
395
|
id: z.ZodString;
|
|
102
396
|
name: z.ZodNullable<z.ZodString>;
|
|
103
397
|
start: z.ZodNullable<z.ZodString>;
|
|
104
|
-
|
|
398
|
+
role: z.ZodNullable<z.ZodObject<{
|
|
399
|
+
key: z.ZodString;
|
|
400
|
+
name: z.ZodNullable<z.ZodString>;
|
|
401
|
+
}, z.core.$strip>>;
|
|
105
402
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
106
403
|
lastUsedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
404
|
+
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
107
405
|
key: z.ZodString;
|
|
108
406
|
}, z.core.$strip>;
|
|
407
|
+
declare const ApiKeyName: z.ZodString;
|
|
109
408
|
declare const CreateApiKey: z.ZodObject<{
|
|
110
409
|
name: z.ZodString;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"courses:write": "courses:write";
|
|
114
|
-
"courses:delete": "courses:delete";
|
|
115
|
-
"downloads:read": "downloads:read";
|
|
116
|
-
"downloads:write": "downloads:write";
|
|
117
|
-
"downloads:delete": "downloads:delete";
|
|
118
|
-
"bundles:read": "bundles:read";
|
|
119
|
-
"bundles:write": "bundles:write";
|
|
120
|
-
"bundles:delete": "bundles:delete";
|
|
121
|
-
"media:read": "media:read";
|
|
122
|
-
"students:read": "students:read";
|
|
123
|
-
"students:invite": "students:invite";
|
|
124
|
-
"access:read": "access:read";
|
|
125
|
-
"access:write": "access:write";
|
|
126
|
-
"analytics:read": "analytics:read";
|
|
127
|
-
"automations:read": "automations:read";
|
|
128
|
-
"automations:write": "automations:write";
|
|
129
|
-
"automations:delete": "automations:delete";
|
|
130
|
-
"comments:read": "comments:read";
|
|
131
|
-
"comments:moderate": "comments:moderate";
|
|
132
|
-
"communities:read": "communities:read";
|
|
133
|
-
"communities:write": "communities:write";
|
|
134
|
-
"communities:delete": "communities:delete";
|
|
135
|
-
"community_members:read": "community_members:read";
|
|
136
|
-
"community_members:write": "community_members:write";
|
|
137
|
-
"community_moderation:read": "community_moderation:read";
|
|
138
|
-
"community_moderation:write": "community_moderation:write";
|
|
139
|
-
}>>;
|
|
410
|
+
role: z.ZodString;
|
|
411
|
+
expiresInDays: z.ZodOptional<z.ZodNumber>;
|
|
140
412
|
}, z.core.$strip>;
|
|
141
413
|
declare const ApiKeyIdParam: z.ZodObject<{
|
|
142
414
|
id: z.ZodString;
|
|
143
415
|
}, z.core.$strip>;
|
|
416
|
+
declare const ApiKeyRole: z.ZodObject<{
|
|
417
|
+
key: z.ZodString;
|
|
418
|
+
name: z.ZodString;
|
|
419
|
+
description: z.ZodString;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
declare const ApiKeyRoleList: z.ZodArray<z.ZodObject<{
|
|
422
|
+
key: z.ZodString;
|
|
423
|
+
name: z.ZodString;
|
|
424
|
+
description: z.ZodString;
|
|
425
|
+
}, z.core.$strip>>;
|
|
144
426
|
//#endregion
|
|
145
|
-
export { ApiKey, ApiKeyIdParam, ApiKeyList, ClientIdParam, ConnectedApp, ConnectedAppList, CreateApiKey, CreatedApiKey,
|
|
427
|
+
export { ApiKey, ApiKeyIdParam, ApiKeyList, ApiKeyName, ApiKeyRole, ApiKeyRoleList, ClientIdParam, ConnectedApp, ConnectedAppList, CreateApiKey, CreatedApiKey, Level, Permission, PermissionDefinition, PermissionDefinitionList, ViewerPermissions };
|
|
146
428
|
//# sourceMappingURL=access.d.ts.map
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import { ACCESS_SCOPES } from "@headless-lms/core/organizations";
|
|
2
1
|
import { z } from "zod";
|
|
2
|
+
import { levelSchema, permissionSchema } from "@headless-lms/core/schemas";
|
|
3
3
|
//#region src/http/schemas/access.ts
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const Permission = permissionSchema;
|
|
5
|
+
const Level = levelSchema;
|
|
6
|
+
const PermissionDefinition = z.object({
|
|
7
|
+
key: permissionSchema,
|
|
8
|
+
group: z.string(),
|
|
9
|
+
label: z.string(),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
about: levelSchema,
|
|
12
|
+
implies: z.array(permissionSchema).optional()
|
|
13
|
+
});
|
|
14
|
+
const PermissionDefinitionList = z.array(PermissionDefinition);
|
|
15
|
+
const ViewerPermissions = z.object({
|
|
16
|
+
orgRole: z.object({
|
|
17
|
+
key: z.string(),
|
|
18
|
+
name: z.string()
|
|
19
|
+
}),
|
|
20
|
+
isOwner: z.boolean(),
|
|
21
|
+
org: z.array(permissionSchema),
|
|
22
|
+
content: z.record(z.string(), z.array(permissionSchema))
|
|
7
23
|
});
|
|
8
|
-
const ScopeOptionList = z.array(ScopeOption);
|
|
9
24
|
const ConnectedApp = z.object({
|
|
10
25
|
clientId: z.string(),
|
|
11
26
|
name: z.string(),
|
|
@@ -18,19 +33,31 @@ const ClientIdParam = z.object({ clientId: z.string() });
|
|
|
18
33
|
const ApiKey = z.object({
|
|
19
34
|
id: z.string(),
|
|
20
35
|
name: z.string().nullable(),
|
|
21
|
-
start: z.string().nullable(),
|
|
22
|
-
|
|
36
|
+
start: z.string().nullable().describe("The first characters of the key, for telling keys apart"),
|
|
37
|
+
role: z.object({
|
|
38
|
+
key: z.string(),
|
|
39
|
+
name: z.string().nullable().describe("Null when the organization no longer has the role")
|
|
40
|
+
}).nullable().describe("The role whose permissions the key holds, limited to its creator's"),
|
|
23
41
|
createdAt: z.coerce.date(),
|
|
24
|
-
lastUsedAt: z.coerce.date().nullable()
|
|
42
|
+
lastUsedAt: z.coerce.date().nullable(),
|
|
43
|
+
expiresAt: z.coerce.date().nullable().describe("Null for a key that does not expire")
|
|
25
44
|
});
|
|
26
45
|
const ApiKeyList = z.array(ApiKey);
|
|
27
|
-
const CreatedApiKey = ApiKey.extend({ key: z.string() });
|
|
46
|
+
const CreatedApiKey = ApiKey.extend({ key: z.string().describe("The key itself. Returned once, never again") });
|
|
47
|
+
const ApiKeyName = z.string().trim().min(1).max(80);
|
|
28
48
|
const CreateApiKey = z.object({
|
|
29
|
-
name:
|
|
30
|
-
|
|
49
|
+
name: ApiKeyName,
|
|
50
|
+
role: z.string().min(1).describe("The key of one of the organization's roles"),
|
|
51
|
+
expiresInDays: z.number().int().min(1).max(365).optional().describe("Days until the key stops working. Leave out for a key that does not expire")
|
|
31
52
|
});
|
|
32
53
|
const ApiKeyIdParam = z.object({ id: z.string() });
|
|
54
|
+
const ApiKeyRole = z.object({
|
|
55
|
+
key: z.string(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
description: z.string()
|
|
58
|
+
});
|
|
59
|
+
const ApiKeyRoleList = z.array(ApiKeyRole);
|
|
33
60
|
//#endregion
|
|
34
|
-
export { ApiKey, ApiKeyIdParam, ApiKeyList, ClientIdParam, ConnectedApp, ConnectedAppList, CreateApiKey, CreatedApiKey,
|
|
61
|
+
export { ApiKey, ApiKeyIdParam, ApiKeyList, ApiKeyName, ApiKeyRole, ApiKeyRoleList, ClientIdParam, ConnectedApp, ConnectedAppList, CreateApiKey, CreatedApiKey, Level, Permission, PermissionDefinition, PermissionDefinitionList, ViewerPermissions };
|
|
35
62
|
|
|
36
63
|
//# sourceMappingURL=access.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","names":[],"sources":["../../../src/http/schemas/access.ts"],"sourcesContent":["import { z } from 'zod';\nimport {
|
|
1
|
+
{"version":3,"file":"access.js","names":[],"sources":["../../../src/http/schemas/access.ts"],"sourcesContent":["import { z } from 'zod';\nimport { levelSchema, permissionSchema } from '@headless-lms/core/schemas';\n\nexport const Permission = permissionSchema;\nexport const Level = levelSchema;\n\nexport const PermissionDefinition = z.object({\n key: permissionSchema,\n group: z.string(),\n label: z.string(),\n description: z.string(),\n about: levelSchema,\n implies: z.array(permissionSchema).optional(),\n});\nexport const PermissionDefinitionList = z.array(PermissionDefinition);\n\nexport const ViewerPermissions = z.object({\n orgRole: z.object({ key: z.string(), name: z.string() }),\n isOwner: z.boolean(),\n org: z.array(permissionSchema),\n content: z.record(z.string(), z.array(permissionSchema)),\n});\n\nexport const ConnectedApp = z.object({\n clientId: z.string(),\n name: z.string(),\n iconUrl: z.string().nullable(),\n scopes: z.array(z.string()),\n connectedAt: z.coerce.date(),\n});\nexport const ConnectedAppList = z.array(ConnectedApp);\nexport const ClientIdParam = z.object({ clientId: z.string() });\n\nexport const ApiKey = z.object({\n id: z.string(),\n name: z.string().nullable(),\n start: z.string().nullable().describe('The first characters of the key, for telling keys apart'),\n role: z\n .object({\n key: z.string(),\n name: z.string().nullable().describe('Null when the organization no longer has the role'),\n })\n .nullable()\n .describe(\"The role whose permissions the key holds, limited to its creator's\"),\n createdAt: z.coerce.date(),\n lastUsedAt: z.coerce.date().nullable(),\n expiresAt: z.coerce.date().nullable().describe('Null for a key that does not expire'),\n});\nexport const ApiKeyList = z.array(ApiKey);\nexport const CreatedApiKey = ApiKey.extend({\n key: z.string().describe('The key itself. Returned once, never again'),\n});\nexport const ApiKeyName = z.string().trim().min(1).max(80);\nexport const CreateApiKey = z.object({\n name: ApiKeyName,\n role: z.string().min(1).describe(\"The key of one of the organization's roles\"),\n expiresInDays: z\n .number()\n .int()\n .min(1)\n .max(365)\n .optional()\n .describe('Days until the key stops working. Leave out for a key that does not expire'),\n});\nexport const ApiKeyIdParam = z.object({ id: z.string() });\nexport const ApiKeyRole = z.object({ key: z.string(), name: z.string(), description: z.string() });\nexport const ApiKeyRoleList = z.array(ApiKeyRole);\n"],"mappings":";;;AAGA,MAAa,aAAa;AAC1B,MAAa,QAAQ;AAErB,MAAa,uBAAuB,EAAE,OAAO;CAC3C,KAAK;CACL,OAAO,EAAE,OAAO;CAChB,OAAO,EAAE,OAAO;CAChB,aAAa,EAAE,OAAO;CACtB,OAAO;CACP,SAAS,EAAE,MAAM,gBAAgB,CAAC,CAAC,SAAS;AAC9C,CAAC;AACD,MAAa,2BAA2B,EAAE,MAAM,oBAAoB;AAEpE,MAAa,oBAAoB,EAAE,OAAO;CACxC,SAAS,EAAE,OAAO;EAAE,KAAK,EAAE,OAAO;EAAG,MAAM,EAAE,OAAO;CAAE,CAAC;CACvD,SAAS,EAAE,QAAQ;CACnB,KAAK,EAAE,MAAM,gBAAgB;CAC7B,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACzD,CAAC;AAED,MAAa,eAAe,EAAE,OAAO;CACnC,UAAU,EAAE,OAAO;CACnB,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;CAC1B,aAAa,EAAE,OAAO,KAAK;AAC7B,CAAC;AACD,MAAa,mBAAmB,EAAE,MAAM,YAAY;AACpD,MAAa,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAE9D,MAAa,SAAS,EAAE,OAAO;CAC7B,IAAI,EAAE,OAAO;CACb,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,yDAAyD;CAC/F,MAAM,EACH,OAAO;EACN,KAAK,EAAE,OAAO;EACd,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,mDAAmD;CAC1F,CAAC,CAAC,CACD,SAAS,CAAC,CACV,SAAS,oEAAoE;CAChF,WAAW,EAAE,OAAO,KAAK;CACzB,YAAY,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACrC,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,qCAAqC;AACtF,CAAC;AACD,MAAa,aAAa,EAAE,MAAM,MAAM;AACxC,MAAa,gBAAgB,OAAO,OAAO,EACzC,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,4CAA4C,EACvE,CAAC;AACD,MAAa,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;AACzD,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,4CAA4C;CAC7E,eAAe,EACZ,OAAO,CAAC,CACR,IAAI,CAAC,CACL,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,CAAC,CACV,SAAS,4EAA4E;AAC1F,CAAC;AACD,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACxD,MAAa,aAAa,EAAE,OAAO;CAAE,KAAK,EAAE,OAAO;CAAG,MAAM,EAAE,OAAO;CAAG,aAAa,EAAE,OAAO;AAAE,CAAC;AACjG,MAAa,iBAAiB,EAAE,MAAM,UAAU"}
|
|
@@ -24,11 +24,12 @@ declare const Asset: z.ZodObject<{
|
|
|
24
24
|
pending: "pending";
|
|
25
25
|
ready: "ready";
|
|
26
26
|
}>;
|
|
27
|
+
contentType: z.ZodString;
|
|
28
|
+
contentId: z.ZodNullable<z.ZodString>;
|
|
27
29
|
orgId: z.ZodString;
|
|
28
30
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
29
31
|
uploadedBy: z.ZodString;
|
|
30
32
|
filename: z.ZodString;
|
|
31
|
-
contentType: z.ZodString;
|
|
32
33
|
size: z.ZodNumber;
|
|
33
34
|
kind: z.ZodEnum<{
|
|
34
35
|
image: "image";
|
|
@@ -59,6 +60,7 @@ declare const AssetsQuery: z.ZodObject<{
|
|
|
59
60
|
library: "library";
|
|
60
61
|
member: "member";
|
|
61
62
|
}>>;
|
|
63
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
62
64
|
}, z.core.$strip>;
|
|
63
65
|
type AssetsQuery = z.infer<typeof AssetsQuery>;
|
|
64
66
|
declare const AssetsPage: z.ZodObject<{
|
|
@@ -69,11 +71,12 @@ declare const AssetsPage: z.ZodObject<{
|
|
|
69
71
|
pending: "pending";
|
|
70
72
|
ready: "ready";
|
|
71
73
|
}>;
|
|
74
|
+
contentType: z.ZodString;
|
|
75
|
+
contentId: z.ZodNullable<z.ZodString>;
|
|
72
76
|
orgId: z.ZodString;
|
|
73
77
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
74
78
|
uploadedBy: z.ZodString;
|
|
75
79
|
filename: z.ZodString;
|
|
76
|
-
contentType: z.ZodString;
|
|
77
80
|
size: z.ZodNumber;
|
|
78
81
|
kind: z.ZodEnum<{
|
|
79
82
|
image: "image";
|
|
@@ -100,6 +103,7 @@ type AssetIdParam = z.infer<typeof AssetIdParam>;
|
|
|
100
103
|
declare const RequestUpload: z.ZodObject<{
|
|
101
104
|
filename: z.ZodString;
|
|
102
105
|
contentType: z.ZodString;
|
|
106
|
+
contentId: z.ZodOptional<z.ZodString>;
|
|
103
107
|
}, z.core.$strip>;
|
|
104
108
|
type RequestUpload = z.infer<typeof RequestUpload>;
|
|
105
109
|
declare const RequestMemberUpload: z.ZodObject<{
|
|
@@ -119,11 +123,12 @@ declare const UploadTicket: z.ZodObject<{
|
|
|
119
123
|
pending: "pending";
|
|
120
124
|
ready: "ready";
|
|
121
125
|
}>;
|
|
126
|
+
contentType: z.ZodString;
|
|
127
|
+
contentId: z.ZodNullable<z.ZodString>;
|
|
122
128
|
orgId: z.ZodString;
|
|
123
129
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
124
130
|
uploadedBy: z.ZodString;
|
|
125
131
|
filename: z.ZodString;
|
|
126
|
-
contentType: z.ZodString;
|
|
127
132
|
size: z.ZodNumber;
|
|
128
133
|
kind: z.ZodEnum<{
|
|
129
134
|
image: "image";
|