@headless-lms/server 0.1.0 → 0.2.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.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/dist/app/container.d.ts +7 -3
  3. package/dist/app/container.js +57 -26
  4. package/dist/app/container.js.map +1 -1
  5. package/dist/app/notifications.js +4 -1
  6. package/dist/app/notifications.js.map +1 -1
  7. package/dist/http/plugins/error-handler.d.ts +1 -1
  8. package/dist/http/plugins/error-handler.js +15 -4
  9. package/dist/http/plugins/error-handler.js.map +1 -1
  10. package/dist/http/plugins/openapi.js +25 -22
  11. package/dist/http/plugins/openapi.js.map +1 -1
  12. package/dist/http/routes/activities.js +34 -2
  13. package/dist/http/routes/activities.js.map +1 -1
  14. package/dist/http/routes/assets.js +4 -0
  15. package/dist/http/routes/assets.js.map +1 -1
  16. package/dist/http/routes/automations.js +32 -8
  17. package/dist/http/routes/automations.js.map +1 -1
  18. package/dist/http/routes/bundles.d.ts +7 -0
  19. package/dist/http/routes/bundles.js +170 -0
  20. package/dist/http/routes/bundles.js.map +1 -0
  21. package/dist/http/routes/course-analytics.d.ts +7 -0
  22. package/dist/http/routes/course-analytics.js +58 -0
  23. package/dist/http/routes/course-analytics.js.map +1 -0
  24. package/dist/http/routes/courses.js +8 -8
  25. package/dist/http/routes/courses.js.map +1 -1
  26. package/dist/http/routes/dashboard.js +2 -2
  27. package/dist/http/routes/dashboard.js.map +1 -1
  28. package/dist/http/routes/discussion.js +1 -1
  29. package/dist/http/routes/discussion.js.map +1 -1
  30. package/dist/http/routes/downloads.js +10 -10
  31. package/dist/http/routes/downloads.js.map +1 -1
  32. package/dist/http/routes/integrations.js.map +1 -1
  33. package/dist/http/routes/learn/assets.js +1 -1
  34. package/dist/http/routes/learn/assets.js.map +1 -1
  35. package/dist/http/routes/learn/comments.js +7 -7
  36. package/dist/http/routes/learn/comments.js.map +1 -1
  37. package/dist/http/routes/learn/courses.js +26 -3
  38. package/dist/http/routes/learn/courses.js.map +1 -1
  39. package/dist/http/routes/learn/downloads.js +3 -3
  40. package/dist/http/routes/learn/downloads.js.map +1 -1
  41. package/dist/http/routes/learn/org.js +2 -2
  42. package/dist/http/routes/learn/org.js.map +1 -1
  43. package/dist/http/routes/learn/progress.js +2 -2
  44. package/dist/http/routes/learn/progress.js.map +1 -1
  45. package/dist/http/routes/organizations.js.map +1 -1
  46. package/dist/http/routes/students.js +27 -6
  47. package/dist/http/routes/students.js.map +1 -1
  48. package/dist/http/routes/webhooks.d.ts +7 -0
  49. package/dist/http/routes/webhooks.js +159 -0
  50. package/dist/http/routes/webhooks.js.map +1 -0
  51. package/dist/http/routes.js +6 -0
  52. package/dist/http/routes.js.map +1 -1
  53. package/dist/http/schemas/activities.d.ts +34 -1
  54. package/dist/http/schemas/activities.js +7 -2
  55. package/dist/http/schemas/activities.js.map +1 -1
  56. package/dist/http/schemas/assets.d.ts +11 -7
  57. package/dist/http/schemas/assets.js.map +1 -1
  58. package/dist/http/schemas/automations.d.ts +75 -8
  59. package/dist/http/schemas/automations.js +13 -2
  60. package/dist/http/schemas/automations.js.map +1 -1
  61. package/dist/http/schemas/bundles.d.ts +63 -0
  62. package/dist/http/schemas/bundles.js +23 -0
  63. package/dist/http/schemas/bundles.js.map +1 -0
  64. package/dist/http/schemas/content.d.ts +18 -11
  65. package/dist/http/schemas/content.js +1 -2
  66. package/dist/http/schemas/content.js.map +1 -1
  67. package/dist/http/schemas/course-analytics.d.ts +29 -0
  68. package/dist/http/schemas/course-analytics.js +21 -0
  69. package/dist/http/schemas/course-analytics.js.map +1 -0
  70. package/dist/http/schemas/dashboard.js.map +1 -1
  71. package/dist/http/schemas/discussion.d.ts +9 -9
  72. package/dist/http/schemas/discussion.js.map +1 -1
  73. package/dist/http/schemas/downloads.d.ts +2 -0
  74. package/dist/http/schemas/downloads.js.map +1 -1
  75. package/dist/http/schemas/entitlements.d.ts +14 -6
  76. package/dist/http/schemas/entitlements.js +4 -2
  77. package/dist/http/schemas/entitlements.js.map +1 -1
  78. package/dist/http/schemas/index.d.ts +6 -4
  79. package/dist/http/schemas/index.js +6 -4
  80. package/dist/http/schemas/integrations.d.ts +4 -4
  81. package/dist/http/schemas/integrations.js.map +1 -1
  82. package/dist/http/schemas/invites.js +2 -1
  83. package/dist/http/schemas/invites.js.map +1 -1
  84. package/dist/http/schemas/learn.d.ts +11 -1
  85. package/dist/http/schemas/learn.js.map +1 -1
  86. package/dist/http/schemas/members.js.map +1 -1
  87. package/dist/http/schemas/organizations.js.map +1 -1
  88. package/dist/http/schemas/settings.js.map +1 -1
  89. package/dist/http/schemas/shared.d.ts +1 -0
  90. package/dist/http/schemas/shared.js +3 -1
  91. package/dist/http/schemas/shared.js.map +1 -1
  92. package/dist/http/schemas/students.d.ts +30 -2
  93. package/dist/http/schemas/students.js +21 -2
  94. package/dist/http/schemas/students.js.map +1 -1
  95. package/dist/http/server.js +4 -2
  96. package/dist/http/server.js.map +1 -1
  97. package/dist/index.d.ts +2 -2
  98. package/dist/index.js.map +1 -1
  99. package/dist/package.js +6 -0
  100. package/dist/package.js.map +1 -0
  101. package/package.json +5 -5
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  //#region src/http/schemas/assets.d.ts
3
3
  declare const AssetKind: z.ZodEnum<{
4
- download: "download";
5
4
  video: "video";
5
+ download: "download";
6
6
  content: "content";
7
7
  }>;
8
8
  type AssetKind = z.infer<typeof AssetKind>;
@@ -16,8 +16,8 @@ declare const Asset: z.ZodObject<{
16
16
  id: z.ZodString;
17
17
  key: z.ZodString;
18
18
  kind: z.ZodEnum<{
19
- download: "download";
20
19
  video: "video";
20
+ download: "download";
21
21
  content: "content";
22
22
  }>;
23
23
  filename: z.ZodString;
@@ -29,6 +29,7 @@ declare const Asset: z.ZodObject<{
29
29
  }>;
30
30
  uploadedBy: z.ZodString;
31
31
  createdAt: z.ZodCoercedDate<unknown>;
32
+ updatedAt: z.ZodCoercedDate<unknown>;
32
33
  }, z.core.$strict>;
33
34
  type Asset = z.infer<typeof Asset>;
34
35
  declare const AssetsQuery: z.ZodObject<{
@@ -37,8 +38,8 @@ declare const AssetsQuery: z.ZodObject<{
37
38
  search: z.ZodOptional<z.ZodString>;
38
39
  sort: z.ZodOptional<z.ZodString>;
39
40
  kind: z.ZodOptional<z.ZodEnum<{
40
- download: "download";
41
41
  video: "video";
42
+ download: "download";
42
43
  content: "content";
43
44
  }>>;
44
45
  }, z.core.$strip>;
@@ -49,8 +50,8 @@ declare const AssetsPage: z.ZodObject<{
49
50
  id: z.ZodString;
50
51
  key: z.ZodString;
51
52
  kind: z.ZodEnum<{
52
- download: "download";
53
53
  video: "video";
54
+ download: "download";
54
55
  content: "content";
55
56
  }>;
56
57
  filename: z.ZodString;
@@ -62,6 +63,7 @@ declare const AssetsPage: z.ZodObject<{
62
63
  }>;
63
64
  uploadedBy: z.ZodString;
64
65
  createdAt: z.ZodCoercedDate<unknown>;
66
+ updatedAt: z.ZodCoercedDate<unknown>;
65
67
  }, z.core.$strict>>;
66
68
  total: z.ZodNumber;
67
69
  page: z.ZodNumber;
@@ -77,8 +79,8 @@ declare const RequestUpload: z.ZodObject<{
77
79
  filename: z.ZodString;
78
80
  contentType: z.ZodString;
79
81
  kind: z.ZodEnum<{
80
- download: "download";
81
82
  video: "video";
83
+ download: "download";
82
84
  content: "content";
83
85
  }>;
84
86
  }, z.core.$strip>;
@@ -89,8 +91,8 @@ declare const UploadTicket: z.ZodObject<{
89
91
  id: z.ZodString;
90
92
  key: z.ZodString;
91
93
  kind: z.ZodEnum<{
92
- download: "download";
93
94
  video: "video";
95
+ download: "download";
94
96
  content: "content";
95
97
  }>;
96
98
  filename: z.ZodString;
@@ -102,6 +104,7 @@ declare const UploadTicket: z.ZodObject<{
102
104
  }>;
103
105
  uploadedBy: z.ZodString;
104
106
  createdAt: z.ZodCoercedDate<unknown>;
107
+ updatedAt: z.ZodCoercedDate<unknown>;
105
108
  }, z.core.$strict>;
106
109
  uploadUrl: z.ZodString;
107
110
  method: z.ZodLiteral<"PUT">;
@@ -121,8 +124,8 @@ declare const DownloadTicket: z.ZodObject<{
121
124
  id: z.ZodString;
122
125
  key: z.ZodString;
123
126
  kind: z.ZodEnum<{
124
- download: "download";
125
127
  video: "video";
128
+ download: "download";
126
129
  content: "content";
127
130
  }>;
128
131
  filename: z.ZodString;
@@ -134,6 +137,7 @@ declare const DownloadTicket: z.ZodObject<{
134
137
  }>;
135
138
  uploadedBy: z.ZodString;
136
139
  createdAt: z.ZodCoercedDate<unknown>;
140
+ updatedAt: z.ZodCoercedDate<unknown>;
137
141
  }, z.core.$strict>;
138
142
  }, z.core.$strict>;
139
143
  type DownloadTicket = z.infer<typeof DownloadTicket>;
@@ -1 +1 @@
1
- {"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["// Assets (media library) resource schemas. An Asset is a tracked object in\n// private storage; files are uploaded via a presigned PUT and served via a\n// presigned GET. Domain objects (e.g. a lesson) reference an asset by id.\n// The Asset payload shape is owned by @headless-lms/core/schemas; route-local\n// schemas define endpoint-only concerns such as params and pagination.\nimport { z } from \"zod\";\nimport {\n assetKindSchema,\n assetSchema,\n assetStatusSchema,\n downloadTicketSchema,\n uploadTicketSchema,\n} from \"@headless-lms/core/schemas\";\nimport { ListQuery, paginated } from \"./shared.js\";\n\nexport const AssetKind = assetKindSchema;\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetSchema;\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({ kind: AssetKind.optional() });\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\n/** Register an asset and get a presigned upload URL. */\nexport const RequestUpload = z.object({\n filename: z.string().min(1),\n contentType: z.string().min(1),\n kind: AssetKind,\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const UploadTicket = uploadTicketSchema;\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n\n/** Optional override of the download filename (Content-Disposition). */\nexport const RequestDownload = z.object({ filename: z.string().optional() });\nexport type RequestDownload = z.infer<typeof RequestDownload>;\n\nexport const DownloadTicket = downloadTicketSchema;\nexport type DownloadTicket = z.infer<typeof DownloadTicket>;\n"],"mappings":";;;;AAeA,MAAa,YAAY;AAGzB,MAAa,cAAc;AAG3B,MAAa,QAAQ;AAGrB,MAAa,cAAc,UAAU,OAAO,EAAE,MAAM,UAAU,SAAS,EAAE,CAAC;AAG1E,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;AAIvD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC7B,MAAM;AACR,CAAC;AAGD,MAAa,eAAe;;AAI5B,MAAa,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AAG3E,MAAa,iBAAiB"}
1
+ {"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["// Assets (media library) resource schemas. An Asset is a tracked object in\n// private storage; files are uploaded via a presigned PUT and served via a\n// presigned GET. Domain objects (e.g. a lesson) reference an asset by id.\n// The Asset payload shape is owned by @headless-lms/core/schemas; route-local\n// schemas define endpoint-only concerns such as params and pagination.\nimport { z } from 'zod';\nimport {\n assetKindSchema,\n assetSchema,\n assetStatusSchema,\n downloadTicketSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const AssetKind = assetKindSchema;\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetSchema;\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({ kind: AssetKind.optional() });\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\n/** Register an asset and get a presigned upload URL. */\nexport const RequestUpload = z.object({\n filename: z.string().min(1),\n contentType: z.string().min(1),\n kind: AssetKind,\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const UploadTicket = uploadTicketSchema;\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n\n/** Optional override of the download filename (Content-Disposition). */\nexport const RequestDownload = z.object({ filename: z.string().optional() });\nexport type RequestDownload = z.infer<typeof RequestDownload>;\n\nexport const DownloadTicket = downloadTicketSchema;\nexport type DownloadTicket = z.infer<typeof DownloadTicket>;\n"],"mappings":";;;;AAeA,MAAa,YAAY;AAGzB,MAAa,cAAc;AAG3B,MAAa,QAAQ;AAGrB,MAAa,cAAc,UAAU,OAAO,EAAE,MAAM,UAAU,SAAS,EAAE,CAAC;AAG1E,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;AAIvD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC7B,MAAM;AACR,CAAC;AAGD,MAAa,eAAe;;AAI5B,MAAa,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AAG3E,MAAa,iBAAiB"}
@@ -9,12 +9,21 @@ type AutomationAction = z.infer<typeof AutomationAction>;
9
9
  /** A domain event type, e.g. `entitlement.created`. */
10
10
  declare const AutomationTrigger: z.ZodString;
11
11
  type AutomationTrigger = z.infer<typeof AutomationTrigger>;
12
+ declare const AutomationKind: z.ZodEnum<{
13
+ workflow: "workflow";
14
+ webhook: "webhook";
15
+ }>;
16
+ type AutomationKind = z.infer<typeof AutomationKind>;
12
17
  declare const Automation: z.ZodObject<{
13
18
  orgId: z.ZodString;
14
19
  id: z.ZodString;
15
20
  name: z.ZodString;
21
+ kind: z.ZodEnum<{
22
+ workflow: "workflow";
23
+ webhook: "webhook";
24
+ }>;
16
25
  description: z.ZodNullable<z.ZodString>;
17
- trigger: z.ZodString;
26
+ triggers: z.ZodArray<z.ZodString>;
18
27
  actions: z.ZodArray<z.ZodObject<{
19
28
  type: z.ZodString;
20
29
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
@@ -24,10 +33,17 @@ declare const Automation: z.ZodObject<{
24
33
  updatedAt: z.ZodCoercedDate<unknown>;
25
34
  }, z.core.$strict>;
26
35
  type Automation = z.infer<typeof Automation>;
36
+ declare const AutomationsQuery: z.ZodObject<{
37
+ kind: z.ZodOptional<z.ZodEnum<{
38
+ workflow: "workflow";
39
+ webhook: "webhook";
40
+ }>>;
41
+ }, z.core.$strict>;
42
+ type AutomationsQuery = z.infer<typeof AutomationsQuery>;
27
43
  declare const CreateAutomationBody: z.ZodObject<{
28
44
  name: z.ZodString;
29
45
  description: z.ZodOptional<z.ZodString>;
30
- trigger: z.ZodString;
46
+ triggers: z.ZodArray<z.ZodString>;
31
47
  actions: z.ZodArray<z.ZodObject<{
32
48
  type: z.ZodString;
33
49
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
@@ -37,7 +53,7 @@ type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;
37
53
  declare const UpdateAutomationBody: z.ZodObject<{
38
54
  name: z.ZodOptional<z.ZodString>;
39
55
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
40
- trigger: z.ZodOptional<z.ZodString>;
56
+ triggers: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
57
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
58
  type: z.ZodString;
43
59
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
@@ -49,6 +65,11 @@ declare const AutomationIdParam: z.ZodObject<{
49
65
  id: z.ZodString;
50
66
  }, z.core.$strip>;
51
67
  type AutomationIdParam = z.infer<typeof AutomationIdParam>;
68
+ declare const AutomationRunParams: z.ZodObject<{
69
+ id: z.ZodString;
70
+ runId: z.ZodString;
71
+ }, z.core.$strip>;
72
+ type AutomationRunParams = z.infer<typeof AutomationRunParams>;
52
73
  /** An action an automation can use: a built-in type (`sendEmail`) or a loaded
53
74
  * integration's own (`<integrationId>.<actionId>`). */
54
75
  declare const AvailableAction: z.ZodObject<{
@@ -62,13 +83,15 @@ type AvailableAction = z.infer<typeof AvailableAction>;
62
83
  declare const AvailableTriggers: z.ZodObject<{
63
84
  triggers: z.ZodArray<z.ZodObject<{
64
85
  type: z.ZodString;
86
+ label: z.ZodString;
87
+ category: z.ZodString;
65
88
  description: z.ZodString;
66
89
  }, z.core.$strict>>;
67
90
  }, z.core.$strict>;
68
91
  type AvailableTriggers = z.infer<typeof AvailableTriggers>;
69
92
  declare const AutomationRunStatus: z.ZodEnum<{
70
- completed: "completed";
71
93
  running: "running";
94
+ completed: "completed";
72
95
  failed: "failed";
73
96
  }>;
74
97
  type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;
@@ -90,8 +113,8 @@ declare const AutomationRun: z.ZodObject<{
90
113
  eventId: z.ZodString;
91
114
  event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
92
115
  status: z.ZodEnum<{
93
- completed: "completed";
94
116
  running: "running";
117
+ completed: "completed";
95
118
  failed: "failed";
96
119
  }>;
97
120
  actionResults: z.ZodArray<z.ZodObject<{
@@ -105,6 +128,8 @@ declare const AutomationRun: z.ZodObject<{
105
128
  }, z.core.$strict>>;
106
129
  startedAt: z.ZodCoercedDate<unknown>;
107
130
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
131
+ createdAt: z.ZodCoercedDate<unknown>;
132
+ updatedAt: z.ZodCoercedDate<unknown>;
108
133
  }, z.core.$strict>;
109
134
  type AutomationRun = z.infer<typeof AutomationRun>;
110
135
  declare const AutomationRunsQuery: z.ZodObject<{
@@ -113,8 +138,8 @@ declare const AutomationRunsQuery: z.ZodObject<{
113
138
  search: z.ZodOptional<z.ZodString>;
114
139
  sort: z.ZodOptional<z.ZodString>;
115
140
  status: z.ZodOptional<z.ZodEnum<{
116
- completed: "completed";
117
141
  running: "running";
142
+ completed: "completed";
118
143
  failed: "failed";
119
144
  }>>;
120
145
  }, z.core.$strip>;
@@ -128,8 +153,8 @@ declare const AutomationRunsPage: z.ZodObject<{
128
153
  eventId: z.ZodString;
129
154
  event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
130
155
  status: z.ZodEnum<{
131
- completed: "completed";
132
156
  running: "running";
157
+ completed: "completed";
133
158
  failed: "failed";
134
159
  }>;
135
160
  actionResults: z.ZodArray<z.ZodObject<{
@@ -143,12 +168,54 @@ declare const AutomationRunsPage: z.ZodObject<{
143
168
  }, z.core.$strict>>;
144
169
  startedAt: z.ZodCoercedDate<unknown>;
145
170
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
171
+ createdAt: z.ZodCoercedDate<unknown>;
172
+ updatedAt: z.ZodCoercedDate<unknown>;
146
173
  }, z.core.$strict>>;
147
174
  total: z.ZodNumber;
148
175
  page: z.ZodNumber;
149
176
  pageSize: z.ZodNumber;
150
177
  }, z.core.$strip>;
151
178
  type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;
179
+ declare const Webhook: z.ZodObject<{
180
+ orgId: z.ZodString;
181
+ id: z.ZodString;
182
+ url: z.ZodString;
183
+ events: z.ZodArray<z.ZodString>;
184
+ description: z.ZodNullable<z.ZodString>;
185
+ enabled: z.ZodBoolean;
186
+ createdAt: z.ZodCoercedDate<unknown>;
187
+ updatedAt: z.ZodCoercedDate<unknown>;
188
+ }, z.core.$strict>;
189
+ type Webhook = z.infer<typeof Webhook>;
190
+ declare const CreatedWebhook: z.ZodObject<{
191
+ orgId: z.ZodString;
192
+ id: z.ZodString;
193
+ url: z.ZodString;
194
+ events: z.ZodArray<z.ZodString>;
195
+ description: z.ZodNullable<z.ZodString>;
196
+ enabled: z.ZodBoolean;
197
+ createdAt: z.ZodCoercedDate<unknown>;
198
+ updatedAt: z.ZodCoercedDate<unknown>;
199
+ secret: z.ZodString;
200
+ }, z.core.$strict>;
201
+ type CreatedWebhook = z.infer<typeof CreatedWebhook>;
202
+ declare const CreateWebhookBody: z.ZodObject<{
203
+ url: z.ZodURL;
204
+ events: z.ZodArray<z.ZodString>;
205
+ description: z.ZodOptional<z.ZodString>;
206
+ }, z.core.$strict>;
207
+ type CreateWebhookBody = z.infer<typeof CreateWebhookBody>;
208
+ declare const UpdateWebhookBody: z.ZodObject<{
209
+ url: z.ZodOptional<z.ZodURL>;
210
+ events: z.ZodOptional<z.ZodArray<z.ZodString>>;
211
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
212
+ enabled: z.ZodOptional<z.ZodBoolean>;
213
+ }, z.core.$strict>;
214
+ type UpdateWebhookBody = z.infer<typeof UpdateWebhookBody>;
215
+ declare const WebhookSecret: z.ZodObject<{
216
+ secret: z.ZodString;
217
+ }, z.core.$strict>;
218
+ type WebhookSecret = z.infer<typeof WebhookSecret>;
152
219
  //#endregion
153
- export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationRun, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableTriggers, CreateAutomationBody, UpdateAutomationBody };
220
+ export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationKind, AutomationRun, AutomationRunParams, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableTriggers, CreateAutomationBody, CreateWebhookBody, CreatedWebhook, UpdateAutomationBody, UpdateWebhookBody, Webhook, WebhookSecret };
154
221
  //# sourceMappingURL=automations.d.ts.map
@@ -1,15 +1,21 @@
1
1
  import { ListQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema } from "@headless-lms/core/schemas";
3
+ import { automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationSchema, automationTriggerSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/automations.ts
5
5
  /** One step of an automation: which action, and its input per that action's inputSchema. */
6
6
  const AutomationAction = automationActionSchema;
7
7
  /** A domain event type, e.g. `entitlement.created`. */
8
8
  const AutomationTrigger = automationTriggerSchema;
9
+ const AutomationKind = automationKindSchema;
9
10
  const Automation = automationSchema;
11
+ const AutomationsQuery = automationsQuerySchema;
10
12
  const CreateAutomationBody = createAutomationInputSchema;
11
13
  const UpdateAutomationBody = updateAutomationInputSchema;
12
14
  const AutomationIdParam = z.object({ id: z.string() });
15
+ const AutomationRunParams = z.object({
16
+ id: z.string(),
17
+ runId: z.string()
18
+ });
13
19
  /** An action an automation can use: a built-in type (`sendEmail`) or a loaded
14
20
  * integration's own (`<integrationId>.<actionId>`). */
15
21
  const AvailableAction = availableActionSchema;
@@ -20,7 +26,12 @@ const AutomationActionResult = automationActionResultSchema;
20
26
  const AutomationRun = automationRunSchema;
21
27
  const AutomationRunsQuery = ListQuery.extend({ status: AutomationRunStatus.optional() });
22
28
  const AutomationRunsPage = paginated(AutomationRun);
29
+ const Webhook = webhookSchema;
30
+ const CreatedWebhook = createdWebhookSchema;
31
+ const CreateWebhookBody = createWebhookInputSchema;
32
+ const UpdateWebhookBody = updateWebhookInputSchema;
33
+ const WebhookSecret = webhookSecretSchema;
23
34
  //#endregion
24
- export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationRun, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableTriggers, CreateAutomationBody, UpdateAutomationBody };
35
+ export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationKind, AutomationRun, AutomationRunParams, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableTriggers, CreateAutomationBody, CreateWebhookBody, CreatedWebhook, UpdateAutomationBody, UpdateWebhookBody, Webhook, WebhookSecret };
25
36
 
26
37
  //# sourceMappingURL=automations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automations.js","names":[],"sources":["../../../src/http/schemas/automations.ts"],"sourcesContent":["// Automations resource schemas. An automation matches a trigger (a domain\n// event type) against enabled rules and runs an ordered list of actions;\n// every run is recorded. Payload shapes are owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as params and pagination envelopes.\nimport { z } from \"zod\";\nimport {\n automationActionResultSchema,\n automationActionSchema,\n automationRunSchema,\n automationRunStatusSchema,\n automationSchema,\n automationTriggerSchema,\n availableActionSchema,\n availableTriggersSchema,\n createAutomationInputSchema,\n updateAutomationInputSchema,\n} from \"@headless-lms/core/schemas\";\nimport { ListQuery, paginated } from \"./shared.js\";\n\n/** One step of an automation: which action, and its input per that action's inputSchema. */\nexport const AutomationAction = automationActionSchema;\nexport type AutomationAction = z.infer<typeof AutomationAction>;\n\n/** A domain event type, e.g. `entitlement.created`. */\nexport const AutomationTrigger = automationTriggerSchema;\nexport type AutomationTrigger = z.infer<typeof AutomationTrigger>;\n\nexport const Automation = automationSchema;\nexport type Automation = z.infer<typeof Automation>;\n\nexport const CreateAutomationBody = createAutomationInputSchema;\nexport type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;\n\nexport const UpdateAutomationBody = updateAutomationInputSchema;\nexport type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;\n\nexport const AutomationIdParam = z.object({ id: z.string() });\nexport type AutomationIdParam = z.infer<typeof AutomationIdParam>;\n\n/** An action an automation can use: a built-in type (`sendEmail`) or a loaded\n * integration's own (`<integrationId>.<actionId>`). */\nexport const AvailableAction = availableActionSchema;\nexport type AvailableAction = z.infer<typeof AvailableAction>;\n\n/** Which domain events an automation can react to. */\nexport const AvailableTriggers = availableTriggersSchema;\nexport type AvailableTriggers = z.infer<typeof AvailableTriggers>;\n\nexport const AutomationRunStatus = automationRunStatusSchema;\nexport type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;\n\nexport const AutomationActionResult = automationActionResultSchema;\nexport type AutomationActionResult = z.infer<typeof AutomationActionResult>;\n\nexport const AutomationRun = automationRunSchema;\nexport type AutomationRun = z.infer<typeof AutomationRun>;\n\nexport const AutomationRunsQuery = ListQuery.extend({\n status: AutomationRunStatus.optional(),\n});\nexport type AutomationRunsQuery = z.infer<typeof AutomationRunsQuery>;\n\nexport const AutomationRunsPage = paginated(AutomationRun);\nexport type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;\n"],"mappings":";;;;;AAqBA,MAAa,mBAAmB;;AAIhC,MAAa,oBAAoB;AAGjC,MAAa,aAAa;AAG1B,MAAa,uBAAuB;AAGpC,MAAa,uBAAuB;AAGpC,MAAa,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;AAK5D,MAAa,kBAAkB;;AAI/B,MAAa,oBAAoB;AAGjC,MAAa,sBAAsB;AAGnC,MAAa,yBAAyB;AAGtC,MAAa,gBAAgB;AAG7B,MAAa,sBAAsB,UAAU,OAAO,EAClD,QAAQ,oBAAoB,SAAS,EACvC,CAAC;AAGD,MAAa,qBAAqB,UAAU,aAAa"}
1
+ {"version":3,"file":"automations.js","names":[],"sources":["../../../src/http/schemas/automations.ts"],"sourcesContent":["// Automations resource schemas. An automation matches a trigger (a domain\n// event type) against enabled rules and runs an ordered list of actions;\n// every run is recorded. Payload shapes are owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as params and pagination envelopes.\nimport { z } from 'zod';\nimport {\n automationActionResultSchema,\n automationActionSchema,\n automationKindSchema,\n automationRunSchema,\n automationRunStatusSchema,\n automationSchema,\n automationTriggerSchema,\n automationsQuerySchema,\n availableActionSchema,\n availableTriggersSchema,\n createAutomationInputSchema,\n createdWebhookSchema,\n createWebhookInputSchema,\n updateAutomationInputSchema,\n updateWebhookInputSchema,\n webhookSchema,\n webhookSecretSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\n/** One step of an automation: which action, and its input per that action's inputSchema. */\nexport const AutomationAction = automationActionSchema;\nexport type AutomationAction = z.infer<typeof AutomationAction>;\n\n/** A domain event type, e.g. `entitlement.created`. */\nexport const AutomationTrigger = automationTriggerSchema;\nexport type AutomationTrigger = z.infer<typeof AutomationTrigger>;\n\nexport const AutomationKind = automationKindSchema;\nexport type AutomationKind = z.infer<typeof AutomationKind>;\n\nexport const Automation = automationSchema;\nexport type Automation = z.infer<typeof Automation>;\n\nexport const AutomationsQuery = automationsQuerySchema;\nexport type AutomationsQuery = z.infer<typeof AutomationsQuery>;\n\nexport const CreateAutomationBody = createAutomationInputSchema;\nexport type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;\n\nexport const UpdateAutomationBody = updateAutomationInputSchema;\nexport type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;\n\nexport const AutomationIdParam = z.object({ id: z.string() });\nexport type AutomationIdParam = z.infer<typeof AutomationIdParam>;\n\nexport const AutomationRunParams = z.object({ id: z.string(), runId: z.string() });\nexport type AutomationRunParams = z.infer<typeof AutomationRunParams>;\n\n/** An action an automation can use: a built-in type (`sendEmail`) or a loaded\n * integration's own (`<integrationId>.<actionId>`). */\nexport const AvailableAction = availableActionSchema;\nexport type AvailableAction = z.infer<typeof AvailableAction>;\n\n/** Which domain events an automation can react to. */\nexport const AvailableTriggers = availableTriggersSchema;\nexport type AvailableTriggers = z.infer<typeof AvailableTriggers>;\n\nexport const AutomationRunStatus = automationRunStatusSchema;\nexport type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;\n\nexport const AutomationActionResult = automationActionResultSchema;\nexport type AutomationActionResult = z.infer<typeof AutomationActionResult>;\n\nexport const AutomationRun = automationRunSchema;\nexport type AutomationRun = z.infer<typeof AutomationRun>;\n\nexport const AutomationRunsQuery = ListQuery.extend({\n status: AutomationRunStatus.optional(),\n});\nexport type AutomationRunsQuery = z.infer<typeof AutomationRunsQuery>;\n\nexport const AutomationRunsPage = paginated(AutomationRun);\nexport type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;\n\nexport const Webhook = webhookSchema;\nexport type Webhook = z.infer<typeof Webhook>;\n\nexport const CreatedWebhook = createdWebhookSchema;\nexport type CreatedWebhook = z.infer<typeof CreatedWebhook>;\n\nexport const CreateWebhookBody = createWebhookInputSchema;\nexport type CreateWebhookBody = z.infer<typeof CreateWebhookBody>;\n\nexport const UpdateWebhookBody = updateWebhookInputSchema;\nexport type UpdateWebhookBody = z.infer<typeof UpdateWebhookBody>;\n\nexport const WebhookSecret = webhookSecretSchema;\nexport type WebhookSecret = z.infer<typeof WebhookSecret>;\n"],"mappings":";;;;;AA4BA,MAAa,mBAAmB;;AAIhC,MAAa,oBAAoB;AAGjC,MAAa,iBAAiB;AAG9B,MAAa,aAAa;AAG1B,MAAa,mBAAmB;AAGhC,MAAa,uBAAuB;AAGpC,MAAa,uBAAuB;AAGpC,MAAa,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAG5D,MAAa,sBAAsB,EAAE,OAAO;CAAE,IAAI,EAAE,OAAO;CAAG,OAAO,EAAE,OAAO;AAAE,CAAC;;;AAKjF,MAAa,kBAAkB;;AAI/B,MAAa,oBAAoB;AAGjC,MAAa,sBAAsB;AAGnC,MAAa,yBAAyB;AAGtC,MAAa,gBAAgB;AAG7B,MAAa,sBAAsB,UAAU,OAAO,EAClD,QAAQ,oBAAoB,SAAS,EACvC,CAAC;AAGD,MAAa,qBAAqB,UAAU,aAAa;AAGzD,MAAa,UAAU;AAGvB,MAAa,iBAAiB;AAG9B,MAAa,oBAAoB;AAGjC,MAAa,oBAAoB;AAGjC,MAAa,gBAAgB"}
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/bundles.d.ts
3
+ declare const Bundle: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ name: z.ZodString;
7
+ createdAt: z.ZodCoercedDate<unknown>;
8
+ updatedAt: z.ZodCoercedDate<unknown>;
9
+ }, z.core.$strict>;
10
+ type Bundle = z.infer<typeof Bundle>;
11
+ declare const BundleItem: z.ZodObject<{
12
+ orgId: z.ZodString;
13
+ bundleId: z.ZodString;
14
+ contentId: z.ZodString;
15
+ createdAt: z.ZodCoercedDate<unknown>;
16
+ updatedAt: z.ZodCoercedDate<unknown>;
17
+ }, z.core.$strict>;
18
+ type BundleItem = z.infer<typeof BundleItem>;
19
+ declare const CreateBundle: z.ZodObject<{
20
+ name: z.ZodString;
21
+ contentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strip>;
23
+ type CreateBundle = z.infer<typeof CreateBundle>;
24
+ declare const UpdateBundle: z.ZodObject<{
25
+ name: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ type UpdateBundle = z.infer<typeof UpdateBundle>;
28
+ declare const BundlesQuery: z.ZodObject<{
29
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
31
+ search: z.ZodOptional<z.ZodString>;
32
+ sort: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ type BundlesQuery = z.infer<typeof BundlesQuery>;
35
+ declare const BundlesPage: z.ZodObject<{
36
+ rows: z.ZodArray<z.ZodObject<{
37
+ orgId: z.ZodString;
38
+ id: z.ZodString;
39
+ name: z.ZodString;
40
+ createdAt: z.ZodCoercedDate<unknown>;
41
+ updatedAt: z.ZodCoercedDate<unknown>;
42
+ }, z.core.$strict>>;
43
+ total: z.ZodNumber;
44
+ page: z.ZodNumber;
45
+ pageSize: z.ZodNumber;
46
+ }, z.core.$strip>;
47
+ type BundlesPage = z.infer<typeof BundlesPage>;
48
+ declare const AddBundleItem: z.ZodObject<{
49
+ contentId: z.ZodString;
50
+ }, z.core.$strip>;
51
+ type AddBundleItem = z.infer<typeof AddBundleItem>;
52
+ declare const BundleIdParam: z.ZodObject<{
53
+ bundleId: z.ZodString;
54
+ }, z.core.$strip>;
55
+ type BundleIdParam = z.infer<typeof BundleIdParam>;
56
+ declare const BundleItemParams: z.ZodObject<{
57
+ bundleId: z.ZodString;
58
+ contentId: z.ZodString;
59
+ }, z.core.$strip>;
60
+ type BundleItemParams = z.infer<typeof BundleItemParams>;
61
+ //#endregion
62
+ export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
63
+ //# sourceMappingURL=bundles.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { ListQuery, paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { bundleItemSchema, bundleSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/bundles.ts
5
+ const Bundle = bundleSchema;
6
+ const BundleItem = bundleItemSchema;
7
+ const CreateBundle = z.object({
8
+ name: z.string().min(1),
9
+ contentIds: z.array(z.string()).optional()
10
+ });
11
+ const UpdateBundle = z.object({ name: z.string().min(1).optional() });
12
+ const BundlesQuery = ListQuery;
13
+ const BundlesPage = paginated(Bundle);
14
+ const AddBundleItem = z.object({ contentId: z.string() });
15
+ const BundleIdParam = z.object({ bundleId: z.string() });
16
+ const BundleItemParams = z.object({
17
+ bundleId: z.string(),
18
+ contentId: z.string()
19
+ });
20
+ //#endregion
21
+ export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
22
+
23
+ //# sourceMappingURL=bundles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/schemas/bundles.ts"],"sourcesContent":["// Bundles resource schemas — a named grouping of content items. The Fastify\n// routes validate requests/responses against these, the OpenAPI spec is built\n// from them, and the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport { bundleItemSchema, bundleSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const Bundle = bundleSchema;\nexport type Bundle = z.infer<typeof Bundle>;\n\nexport const BundleItem = bundleItemSchema;\nexport type BundleItem = z.infer<typeof BundleItem>;\n\nexport const CreateBundle = z.object({\n name: z.string().min(1),\n contentIds: z.array(z.string()).optional(),\n});\nexport type CreateBundle = z.infer<typeof CreateBundle>;\n\nexport const UpdateBundle = z.object({\n name: z.string().min(1).optional(),\n});\nexport type UpdateBundle = z.infer<typeof UpdateBundle>;\n\nexport const BundlesQuery = ListQuery;\nexport type BundlesQuery = z.infer<typeof BundlesQuery>;\n\nexport const BundlesPage = paginated(Bundle);\nexport type BundlesPage = z.infer<typeof BundlesPage>;\n\nexport const AddBundleItem = z.object({\n contentId: z.string(),\n});\nexport type AddBundleItem = z.infer<typeof AddBundleItem>;\n\nexport const BundleIdParam = z.object({ bundleId: z.string() });\nexport type BundleIdParam = z.infer<typeof BundleIdParam>;\n\nexport const BundleItemParams = z.object({\n bundleId: z.string(),\n contentId: z.string(),\n});\nexport type BundleItemParams = z.infer<typeof BundleItemParams>;\n"],"mappings":";;;;AAOA,MAAa,SAAS;AAGtB,MAAa,aAAa;AAG1B,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;AAC3C,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EACnC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACnC,CAAC;AAGD,MAAa,eAAe;AAG5B,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EACpC,WAAW,EAAE,OAAO,EACtB,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAG9D,MAAa,mBAAmB,EAAE,OAAO;CACvC,UAAU,EAAE,OAAO;CACnB,WAAW,EAAE,OAAO;AACtB,CAAC"}
@@ -38,7 +38,15 @@ declare const Course: z.ZodObject<{
38
38
  }>;
39
39
  category: z.ZodString;
40
40
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
41
- settings: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
41
+ settings: z.ZodObject<{
42
+ transcriptDownloads: z.ZodBoolean;
43
+ comments: z.ZodOptional<z.ZodObject<{
44
+ enabled: z.ZodBoolean;
45
+ threaded: z.ZodBoolean;
46
+ requireReview: z.ZodBoolean;
47
+ reactions: z.ZodBoolean;
48
+ }, z.core.$strict>>;
49
+ }, z.core.$strict>;
42
50
  createdAt: z.ZodCoercedDate<unknown>;
43
51
  updatedAt: z.ZodCoercedDate<unknown>;
44
52
  }, z.core.$strict>;
@@ -58,15 +66,6 @@ declare const UpdateCourse: z.ZodObject<{
58
66
  published: "published";
59
67
  }>>;
60
68
  thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
- settings: z.ZodOptional<z.ZodObject<{
62
- transcriptDownloads: z.ZodOptional<z.ZodBoolean>;
63
- comments: z.ZodOptional<z.ZodOptional<z.ZodObject<{
64
- enabled: z.ZodBoolean;
65
- threaded: z.ZodBoolean;
66
- requireReview: z.ZodBoolean;
67
- reactions: z.ZodBoolean;
68
- }, z.core.$strict>>>;
69
- }, z.core.$strict>>;
70
69
  }, z.core.$strip>;
71
70
  type UpdateCourse = z.infer<typeof UpdateCourse>;
72
71
  declare const CoursesQuery: z.ZodObject<{
@@ -95,7 +94,15 @@ declare const CoursesPage: z.ZodObject<{
95
94
  }>;
96
95
  category: z.ZodString;
97
96
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
98
- settings: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
97
+ settings: z.ZodObject<{
98
+ transcriptDownloads: z.ZodBoolean;
99
+ comments: z.ZodOptional<z.ZodObject<{
100
+ enabled: z.ZodBoolean;
101
+ threaded: z.ZodBoolean;
102
+ requireReview: z.ZodBoolean;
103
+ reactions: z.ZodBoolean;
104
+ }, z.core.$strict>>;
105
+ }, z.core.$strict>;
99
106
  createdAt: z.ZodCoercedDate<unknown>;
100
107
  updatedAt: z.ZodCoercedDate<unknown>;
101
108
  }, z.core.$strict>>;
@@ -14,8 +14,7 @@ const CreateCourse = z.object({
14
14
  const UpdateCourse = CreateCourse.partial().extend({
15
15
  status: CourseStatus.optional(),
16
16
  /** null clears the cover. */
17
- thumbnailAssetId: z.string().nullable().optional(),
18
- settings: CourseSettings.partial().optional()
17
+ thumbnailAssetId: z.string().nullable().optional()
19
18
  });
20
19
  const CoursesQuery = ListQuery.extend({
21
20
  status: CourseStatus.optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from \"zod\";\nimport {\n courseSchema,\n courseSettingsSchema,\n courseStatusSchema,\n} from \"@headless-lms/core/schemas\";\nimport { ListQuery, paginated } from \"./shared.js\";\n\nexport const CourseStatus = courseStatusSchema;\nexport type CourseStatus = z.infer<typeof CourseStatus>;\n\nexport const CourseSettings = courseSettingsSchema;\nexport type CourseSettings = z.infer<typeof CourseSettings>;\n\nexport const PatchCourseSettings = CourseSettings.partial();\nexport type PatchCourseSettings = z.infer<typeof PatchCourseSettings>;\n\nexport const Course = courseSchema;\nexport type Course = z.infer<typeof Course>;\n\nexport const CreateCourse = z.object({\n title: z.string().min(1),\n description: z.string().default(\"\"),\n category: z.string().default(\"\"),\n});\nexport type CreateCourse = z.infer<typeof CreateCourse>;\n\nexport const UpdateCourse = CreateCourse.partial().extend({\n status: CourseStatus.optional(),\n /** null clears the cover. */\n thumbnailAssetId: z.string().nullable().optional(),\n settings: CourseSettings.partial().optional(),\n});\nexport type UpdateCourse = z.infer<typeof UpdateCourse>;\n\nexport const CoursesQuery = ListQuery.extend({\n status: CourseStatus.optional(),\n category: z.string().optional(),\n});\nexport type CoursesQuery = z.infer<typeof CoursesQuery>;\n\nexport const CoursesPage = paginated(Course);\nexport type CoursesPage = z.infer<typeof CoursesPage>;\n\nexport const CourseIdParam = z.object({ id: z.string() });\nexport type CourseIdParam = z.infer<typeof CourseIdParam>;\n"],"mappings":";;;;AAWA,MAAa,eAAe;AAG5B,MAAa,iBAAiB;AAG9B,MAAa,sBAAsB,eAAe,QAAQ;AAG1D,MAAa,SAAS;AAGtB,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACvB,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;AACjC,CAAC;AAGD,MAAa,eAAe,aAAa,QAAQ,CAAC,CAAC,OAAO;CACxD,QAAQ,aAAa,SAAS;;CAE9B,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACjD,UAAU,eAAe,QAAQ,CAAC,CAAC,SAAS;AAC9C,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,QAAQ,aAAa,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from 'zod';\nimport { courseSchema, courseSettingsSchema, courseStatusSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const CourseStatus = courseStatusSchema;\nexport type CourseStatus = z.infer<typeof CourseStatus>;\n\nexport const CourseSettings = courseSettingsSchema;\nexport type CourseSettings = z.infer<typeof CourseSettings>;\n\nexport const PatchCourseSettings = CourseSettings.partial();\nexport type PatchCourseSettings = z.infer<typeof PatchCourseSettings>;\n\nexport const Course = courseSchema;\nexport type Course = z.infer<typeof Course>;\n\nexport const CreateCourse = z.object({\n title: z.string().min(1),\n description: z.string().default(''),\n category: z.string().default(''),\n});\nexport type CreateCourse = z.infer<typeof CreateCourse>;\n\nexport const UpdateCourse = CreateCourse.partial().extend({\n status: CourseStatus.optional(),\n /** null clears the cover. */\n thumbnailAssetId: z.string().nullable().optional(),\n});\nexport type UpdateCourse = z.infer<typeof UpdateCourse>;\n\nexport const CoursesQuery = ListQuery.extend({\n status: CourseStatus.optional(),\n category: z.string().optional(),\n});\nexport type CoursesQuery = z.infer<typeof CoursesQuery>;\n\nexport const CoursesPage = paginated(Course);\nexport type CoursesPage = z.infer<typeof CoursesPage>;\n\nexport const CourseIdParam = z.object({ id: z.string() });\nexport type CourseIdParam = z.infer<typeof CourseIdParam>;\n"],"mappings":";;;;AAOA,MAAa,eAAe;AAG5B,MAAa,iBAAiB;AAG9B,MAAa,sBAAsB,eAAe,QAAQ;AAG1D,MAAa,SAAS;AAGtB,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACvB,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;AACjC,CAAC;AAGD,MAAa,eAAe,aAAa,QAAQ,CAAC,CAAC,OAAO;CACxD,QAAQ,aAAa,SAAS;;CAE9B,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACnD,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,QAAQ,aAAa,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/course-analytics.d.ts
3
+ declare const CourseActivityEngagement: z.ZodObject<{
4
+ activityId: z.ZodString;
5
+ title: z.ZodString;
6
+ moduleId: z.ZodString;
7
+ moduleTitle: z.ZodString;
8
+ started: z.ZodNumber;
9
+ completed: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ type CourseActivityEngagement = z.infer<typeof CourseActivityEngagement>;
12
+ declare const CourseAnalytics: z.ZodObject<{
13
+ enrolled: z.ZodNumber;
14
+ started: z.ZodNumber;
15
+ completed: z.ZodNumber;
16
+ avgProgress: z.ZodNumber;
17
+ activities: z.ZodArray<z.ZodObject<{
18
+ activityId: z.ZodString;
19
+ title: z.ZodString;
20
+ moduleId: z.ZodString;
21
+ moduleTitle: z.ZodString;
22
+ started: z.ZodNumber;
23
+ completed: z.ZodNumber;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ type CourseAnalytics = z.infer<typeof CourseAnalytics>;
27
+ //#endregion
28
+ export { CourseActivityEngagement, CourseAnalytics };
29
+ //# sourceMappingURL=course-analytics.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/course-analytics.ts
3
+ const CourseActivityEngagement = z.object({
4
+ activityId: z.string(),
5
+ title: z.string(),
6
+ moduleId: z.string(),
7
+ moduleTitle: z.string(),
8
+ started: z.number().int(),
9
+ completed: z.number().int()
10
+ });
11
+ const CourseAnalytics = z.object({
12
+ enrolled: z.number().int(),
13
+ started: z.number().int(),
14
+ completed: z.number().int(),
15
+ avgProgress: z.number().int(),
16
+ activities: z.array(CourseActivityEngagement)
17
+ });
18
+ //#endregion
19
+ export { CourseActivityEngagement, CourseAnalytics };
20
+
21
+ //# sourceMappingURL=course-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-analytics.js","names":[],"sources":["../../../src/http/schemas/course-analytics.ts"],"sourcesContent":["// Per-course analytics resource schemas.\nimport { z } from 'zod';\n\nexport const CourseActivityEngagement = z.object({\n activityId: z.string(),\n title: z.string(),\n moduleId: z.string(),\n moduleTitle: z.string(),\n started: z.number().int(),\n completed: z.number().int(),\n});\nexport type CourseActivityEngagement = z.infer<typeof CourseActivityEngagement>;\n\nexport const CourseAnalytics = z.object({\n enrolled: z.number().int(),\n started: z.number().int(),\n completed: z.number().int(),\n avgProgress: z.number().int(),\n activities: z.array(CourseActivityEngagement),\n});\nexport type CourseAnalytics = z.infer<typeof CourseAnalytics>;\n"],"mappings":";;AAGA,MAAa,2BAA2B,EAAE,OAAO;CAC/C,YAAY,EAAE,OAAO;CACrB,OAAO,EAAE,OAAO;CAChB,UAAU,EAAE,OAAO;CACnB,aAAa,EAAE,OAAO;CACtB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI;AAC5B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI;CACzB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI;CAC1B,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI;CAC5B,YAAY,EAAE,MAAM,wBAAwB;AAC9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/http/schemas/dashboard.ts"],"sourcesContent":["// Dashboard / overview resource schemas.\nimport { z } from \"zod\";\n\nexport const OverviewStats = z.object({\n publishedCourses: z.number().int(),\n draftCourses: z.number().int(),\n activeStudents: z.number().int(),\n expiringSoon: z.number().int(),\n});\nexport type OverviewStats = z.infer<typeof OverviewStats>;\n\nexport const EnrollmentPoint = z.object({\n date: z.string(),\n count: z.number().int(),\n});\nexport type EnrollmentPoint = z.infer<typeof EnrollmentPoint>;\n\nexport const EnrollmentSeries = z.array(EnrollmentPoint);\nexport type EnrollmentSeries = z.infer<typeof EnrollmentSeries>;\n\nexport const EnrollmentSeriesQuery = z.object({\n days: z.coerce.number().int().min(1).max(365).default(30),\n});\nexport type EnrollmentSeriesQuery = z.infer<typeof EnrollmentSeriesQuery>;\n"],"mappings":";;AAGA,MAAa,gBAAgB,EAAE,OAAO;CACpC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI;CACjC,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;CAC7B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI;CAC/B,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;AAC/B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;AACxB,CAAC;AAGD,MAAa,mBAAmB,EAAE,MAAM,eAAe;AAGvD,MAAa,wBAAwB,EAAE,OAAO,EAC5C,MAAM,EAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,EAC1D,CAAC"}
1
+ {"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/http/schemas/dashboard.ts"],"sourcesContent":["// Dashboard / overview resource schemas.\nimport { z } from 'zod';\n\nexport const OverviewStats = z.object({\n publishedCourses: z.number().int(),\n draftCourses: z.number().int(),\n activeStudents: z.number().int(),\n expiringSoon: z.number().int(),\n});\nexport type OverviewStats = z.infer<typeof OverviewStats>;\n\nexport const EnrollmentPoint = z.object({\n date: z.string(),\n count: z.number().int(),\n});\nexport type EnrollmentPoint = z.infer<typeof EnrollmentPoint>;\n\nexport const EnrollmentSeries = z.array(EnrollmentPoint);\nexport type EnrollmentSeries = z.infer<typeof EnrollmentSeries>;\n\nexport const EnrollmentSeriesQuery = z.object({\n days: z.coerce.number().int().min(1).max(365).default(30),\n});\nexport type EnrollmentSeriesQuery = z.infer<typeof EnrollmentSeriesQuery>;\n"],"mappings":";;AAGA,MAAa,gBAAgB,EAAE,OAAO;CACpC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI;CACjC,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;CAC7B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI;CAC/B,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;AAC/B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;AACxB,CAAC;AAGD,MAAa,mBAAmB,EAAE,MAAM,eAAe;AAGvD,MAAa,wBAAwB,EAAE,OAAO,EAC5C,MAAM,EAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,EAC1D,CAAC"}