@hed-hog/lms 0.0.355 → 0.0.358

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 (115) hide show
  1. package/dist/course/course-audio-transcription.service.d.ts.map +1 -1
  2. package/dist/course/course-audio-transcription.service.js +15 -7
  3. package/dist/course/course-audio-transcription.service.js.map +1 -1
  4. package/dist/course/course-operations-integration.service.d.ts +31 -0
  5. package/dist/course/course-operations-integration.service.d.ts.map +1 -1
  6. package/dist/course/course-operations-integration.service.js +286 -22
  7. package/dist/course/course-operations-integration.service.js.map +1 -1
  8. package/dist/course/course-operations.controller.d.ts +10 -0
  9. package/dist/course/course-operations.controller.d.ts.map +1 -0
  10. package/dist/course/course-operations.controller.js +67 -0
  11. package/dist/course/course-operations.controller.js.map +1 -0
  12. package/dist/course/course-structure.controller.d.ts +15 -1
  13. package/dist/course/course-structure.controller.d.ts.map +1 -1
  14. package/dist/course/course-structure.service.d.ts +25 -1
  15. package/dist/course/course-structure.service.d.ts.map +1 -1
  16. package/dist/course/course-structure.service.js +160 -24
  17. package/dist/course/course-structure.service.js.map +1 -1
  18. package/dist/course/course.module.d.ts.map +1 -1
  19. package/dist/course/course.module.js +4 -1
  20. package/dist/course/course.module.js.map +1 -1
  21. package/dist/course/course.service.d.ts +4 -2
  22. package/dist/course/course.service.d.ts.map +1 -1
  23. package/dist/course/course.service.js +61 -2
  24. package/dist/course/course.service.js.map +1 -1
  25. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +3 -0
  26. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
  27. package/dist/course/dto/create-course-structure-lesson.dto.js +15 -0
  28. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
  29. package/dist/course/dto/create-course-structure-session.dto.d.ts +1 -0
  30. package/dist/course/dto/create-course-structure-session.dto.d.ts.map +1 -1
  31. package/dist/course/dto/create-course-structure-session.dto.js +5 -0
  32. package/dist/course/dto/create-course-structure-session.dto.js.map +1 -1
  33. package/dist/course/dto/update-course-operations-config.dto.d.ts +6 -0
  34. package/dist/course/dto/update-course-operations-config.dto.d.ts.map +1 -0
  35. package/dist/course/dto/update-course-operations-config.dto.js +33 -0
  36. package/dist/course/dto/update-course-operations-config.dto.js.map +1 -0
  37. package/dist/course/lms-operations-task.subscriber.d.ts +13 -0
  38. package/dist/course/lms-operations-task.subscriber.d.ts.map +1 -0
  39. package/dist/course/lms-operations-task.subscriber.js +57 -0
  40. package/dist/course/lms-operations-task.subscriber.js.map +1 -0
  41. package/dist/enterprise/enterprise.service.js +1 -1
  42. package/dist/enterprise/enterprise.service.js.map +1 -1
  43. package/dist/enterprise/training/training-student.controller.d.ts +0 -95
  44. package/dist/enterprise/training/training-student.controller.d.ts.map +1 -1
  45. package/dist/enterprise/training/training-student.controller.js +1 -34
  46. package/dist/enterprise/training/training-student.controller.js.map +1 -1
  47. package/dist/enterprise/training/training-student.service.d.ts +63 -0
  48. package/dist/enterprise/training/training-student.service.d.ts.map +1 -1
  49. package/dist/enterprise/training/training-student.service.js +320 -4
  50. package/dist/enterprise/training/training-student.service.js.map +1 -1
  51. package/dist/instructor/instructor.service.d.ts.map +1 -1
  52. package/dist/instructor/instructor.service.js +12 -3
  53. package/dist/instructor/instructor.service.js.map +1 -1
  54. package/dist/lms.module.d.ts.map +1 -1
  55. package/dist/lms.module.js +2 -0
  56. package/dist/lms.module.js.map +1 -1
  57. package/dist/platforma/platforma.controller.d.ts +287 -0
  58. package/dist/platforma/platforma.controller.d.ts.map +1 -0
  59. package/dist/platforma/platforma.controller.js +147 -0
  60. package/dist/platforma/platforma.controller.js.map +1 -0
  61. package/hedhog/data/route.yaml +102 -9
  62. package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +2 -2
  63. package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +10 -13
  64. package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +26 -4
  65. package/hedhog/frontend/app/_lib/editor/types.ts.ejs +6 -0
  66. package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +447 -31
  67. package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +59 -47
  68. package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +201 -35
  69. package/hedhog/frontend/app/certificates/models/TemplateEditorPage.tsx.ejs +36 -5
  70. package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +2 -2
  71. package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +1 -1
  72. package/hedhog/frontend/app/courses/[id]/structure/_components/confirm-dialog.tsx.ejs +17 -6
  73. package/hedhog/frontend/app/courses/[id]/structure/_components/course-operations-tab.tsx.ejs +382 -0
  74. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +45 -8
  75. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +177 -67
  76. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +25 -60
  77. package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +1 -0
  78. package/hedhog/frontend/app/courses/[id]/structure/_components/store.ts.ejs +11 -0
  79. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-context-menu.tsx.ejs +22 -0
  80. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +79 -64
  81. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-session.tsx.ejs +31 -14
  82. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +4 -4
  83. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +39 -27
  84. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +24 -2
  85. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +41 -6
  86. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-query.ts.ejs +2 -2
  87. package/hedhog/frontend/app/courses/page.tsx.ejs +80 -103
  88. package/hedhog/frontend/app/enterprise/_components/enterprise-course-create-sheet.tsx.ejs +1 -1
  89. package/hedhog/frontend/app/enterprise/_components/enterprise-course-edit-sheet.tsx.ejs +2 -2
  90. package/hedhog/frontend/app/enterprise/page.tsx.ejs +18 -6
  91. package/hedhog/frontend/app/exams/[id]/page.tsx.ejs +5 -4
  92. package/hedhog/frontend/app/instructors/_components/instructor-form-sheet.tsx.ejs +16 -10
  93. package/hedhog/frontend/app/paths/page.tsx.ejs +1 -1
  94. package/hedhog/frontend/app/training/page.tsx.ejs +1 -1
  95. package/hedhog/frontend/messages/en.json +7 -2
  96. package/hedhog/frontend/messages/pt.json +7 -2
  97. package/hedhog/table/course_lesson.yaml +2 -2
  98. package/hedhog/table/course_module.yaml +3 -0
  99. package/package.json +8 -8
  100. package/src/course/course-audio-transcription.service.ts +21 -8
  101. package/src/course/course-operations-integration.service.ts +460 -22
  102. package/src/course/course-operations.controller.ts +45 -0
  103. package/src/course/course-structure.service.ts +209 -4
  104. package/src/course/course.module.ts +4 -1
  105. package/src/course/course.service.ts +67 -1
  106. package/src/course/dto/create-course-structure-lesson.dto.ts +17 -0
  107. package/src/course/dto/create-course-structure-session.dto.ts +13 -1
  108. package/src/course/dto/update-course-operations-config.dto.ts +16 -0
  109. package/src/course/lms-operations-task.subscriber.ts +44 -0
  110. package/src/enterprise/enterprise.service.ts +1 -1
  111. package/src/enterprise/training/training-student.controller.ts +3 -27
  112. package/src/enterprise/training/training-student.service.ts +350 -2
  113. package/src/instructor/instructor.service.ts +12 -3
  114. package/src/lms.module.ts +2 -0
  115. package/src/platforma/platforma.controller.ts +92 -0
@@ -1867,7 +1867,7 @@
1867
1867
  - where:
1868
1868
  slug: lms-instructor
1869
1869
 
1870
- - url: /lms/enterprise/training/student
1870
+ - url: /lms/platforma
1871
1871
  method: GET
1872
1872
  relations:
1873
1873
  role:
@@ -1878,7 +1878,7 @@
1878
1878
  - where:
1879
1879
  slug: lms-student
1880
1880
 
1881
- - url: /lms/enterprise/training/student/class-groups
1881
+ - url: /lms/platforma/dashboard
1882
1882
  method: GET
1883
1883
  relations:
1884
1884
  role:
@@ -1889,7 +1889,7 @@
1889
1889
  - where:
1890
1890
  slug: lms-student
1891
1891
 
1892
- - url: /lms/enterprise/training/student/class-groups/:id
1892
+ - url: /lms/platforma/courses
1893
1893
  method: GET
1894
1894
  relations:
1895
1895
  role:
@@ -1900,7 +1900,7 @@
1900
1900
  - where:
1901
1901
  slug: lms-student
1902
1902
 
1903
- - url: /lms/enterprise/training/student/class-groups/:id/sessions
1903
+ - url: /lms/platforma/notifications
1904
1904
  method: GET
1905
1905
  relations:
1906
1906
  role:
@@ -1911,7 +1911,7 @@
1911
1911
  - where:
1912
1912
  slug: lms-student
1913
1913
 
1914
- - url: /lms/enterprise/training/student/class-groups/:id/materials
1914
+ - url: /lms/platforma/notifications/unread-count
1915
1915
  method: GET
1916
1916
  relations:
1917
1917
  role:
@@ -1922,8 +1922,19 @@
1922
1922
  - where:
1923
1923
  slug: lms-student
1924
1924
 
1925
- - url: /lms/enterprise/training/student/class-groups/:id/my-evaluations
1926
- method: GET
1925
+ - url: /lms/platforma/notifications/read-all
1926
+ method: PATCH
1927
+ relations:
1928
+ role:
1929
+ - where:
1930
+ slug: admin
1931
+ - where:
1932
+ slug: admin-lms
1933
+ - where:
1934
+ slug: lms-student
1935
+
1936
+ - url: /lms/platforma/notifications/:id/read
1937
+ method: PATCH
1927
1938
  relations:
1928
1939
  role:
1929
1940
  - where:
@@ -1933,7 +1944,7 @@
1933
1944
  - where:
1934
1945
  slug: lms-student
1935
1946
 
1936
- - url: /lms/enterprise/training/student/streak
1947
+ - url: /lms/platforma/streak
1937
1948
  method: GET
1938
1949
  relations:
1939
1950
  role:
@@ -1944,7 +1955,7 @@
1944
1955
  - where:
1945
1956
  slug: lms-student
1946
1957
 
1947
- - url: /lms/enterprise/training/student/streak/activities
1958
+ - url: /lms/platforma/streak/activities
1948
1959
  method: POST
1949
1960
  relations:
1950
1961
  role:
@@ -1955,6 +1966,61 @@
1955
1966
  - where:
1956
1967
  slug: lms-student
1957
1968
 
1969
+ - url: /lms/enterprise/training/student/class-groups
1970
+ method: GET
1971
+ relations:
1972
+ role:
1973
+ - where:
1974
+ slug: admin
1975
+ - where:
1976
+ slug: admin-lms
1977
+ - where:
1978
+ slug: lms-student
1979
+
1980
+ - url: /lms/enterprise/training/student/class-groups/:id
1981
+ method: GET
1982
+ relations:
1983
+ role:
1984
+ - where:
1985
+ slug: admin
1986
+ - where:
1987
+ slug: admin-lms
1988
+ - where:
1989
+ slug: lms-student
1990
+
1991
+ - url: /lms/enterprise/training/student/class-groups/:id/sessions
1992
+ method: GET
1993
+ relations:
1994
+ role:
1995
+ - where:
1996
+ slug: admin
1997
+ - where:
1998
+ slug: admin-lms
1999
+ - where:
2000
+ slug: lms-student
2001
+
2002
+ - url: /lms/enterprise/training/student/class-groups/:id/materials
2003
+ method: GET
2004
+ relations:
2005
+ role:
2006
+ - where:
2007
+ slug: admin
2008
+ - where:
2009
+ slug: admin-lms
2010
+ - where:
2011
+ slug: lms-student
2012
+
2013
+ - url: /lms/enterprise/training/student/class-groups/:id/my-evaluations
2014
+ method: GET
2015
+ relations:
2016
+ role:
2017
+ - where:
2018
+ slug: admin
2019
+ - where:
2020
+ slug: admin-lms
2021
+ - where:
2022
+ slug: lms-student
2023
+
1958
2024
  - url: /lms/enterprise/training/admin/students
1959
2025
  method: GET
1960
2026
  relations:
@@ -4311,3 +4377,30 @@
4311
4377
  slug: admin
4312
4378
  - where:
4313
4379
  slug: admin-lms
4380
+
4381
+ - url: /lms/courses/:id/operations
4382
+ method: GET
4383
+ relations:
4384
+ role:
4385
+ - where:
4386
+ slug: admin
4387
+ - where:
4388
+ slug: admin-lms
4389
+
4390
+ - url: /lms/courses/:id/operations
4391
+ method: PATCH
4392
+ relations:
4393
+ role:
4394
+ - where:
4395
+ slug: admin
4396
+ - where:
4397
+ slug: admin-lms
4398
+
4399
+ - url: /lms/courses/:id/operations/recreate-tasks
4400
+ method: POST
4401
+ relations:
4402
+ role:
4403
+ - where:
4404
+ slug: admin
4405
+ - where:
4406
+ slug: admin-lms
@@ -365,7 +365,7 @@ function toApiCourseLevel(level: CourseSheetFormValues['nivel']) {
365
365
  }
366
366
 
367
367
  function toApiCourseStatus(status: CourseSheetFormValues['status']) {
368
- if (status === 'ativo') return 'published';
368
+ if (status === 'publicado') return 'published';
369
369
  if (status === 'rascunho') return 'draft';
370
370
  return 'archived';
371
371
  }
@@ -377,7 +377,7 @@ function toCourseFormLevel(level?: string): CourseSheetFormValues['nivel'] {
377
377
  }
378
378
 
379
379
  function toCourseFormStatus(status?: string): CourseSheetFormValues['status'] {
380
- if (status === 'published') return 'ativo';
380
+ if (status === 'published') return 'publicado';
381
381
  if (status === 'archived') return 'arquivado';
382
382
  return 'rascunho';
383
383
  }
@@ -9,19 +9,15 @@ import {
9
9
  CommandItem,
10
10
  CommandList,
11
11
  } from '@/components/ui/command';
12
- import {
13
- Field,
14
- FieldDescription,
15
- FieldError,
16
- FieldLabel,
17
- } from '@/components/ui/field';
18
12
  import { EntityPicker } from '@/components/ui/entity-picker';
13
+ import { Field, FieldError, FieldLabel } from '@/components/ui/field';
19
14
  import { Input } from '@/components/ui/input';
20
15
  import {
21
16
  Popover,
22
17
  PopoverContent,
23
18
  PopoverTrigger,
24
19
  } from '@/components/ui/popover';
20
+ import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
25
21
  import {
26
22
  Select,
27
23
  SelectContent,
@@ -36,7 +32,6 @@ import {
36
32
  SheetHeader,
37
33
  SheetTitle,
38
34
  } from '@/components/ui/sheet';
39
- import { ResizableSheetContent } from '@/components/ui/resizable-sheet-content';
40
35
  import { Textarea } from '@/components/ui/textarea';
41
36
  import { useApp, useQuery } from '@hed-hog/next-app-provider';
42
37
  import {
@@ -235,7 +230,7 @@ export function getCourseSheetSchema(t: (key: string) => string) {
235
230
  tituloComercial: z.string().optional(),
236
231
  descricao: z.string().optional(),
237
232
  nivel: z.enum(['iniciante', 'intermediario', 'avancado']).optional(),
238
- status: z.enum(['ativo', 'rascunho', 'arquivado']).optional(),
233
+ status: z.enum(['publicado', 'rascunho', 'arquivado']).optional(),
239
234
  offeringType: z.enum(['on_demand', 'agendado', 'hibrido']).optional(),
240
235
  categorias: z.array(z.string()).optional(),
241
236
  operationsProjectId: z.string().optional(),
@@ -252,7 +247,7 @@ export type CourseSheetFormValues = {
252
247
  tituloComercial: string;
253
248
  descricao: string;
254
249
  nivel: 'iniciante' | 'intermediario' | 'avancado';
255
- status: 'ativo' | 'rascunho' | 'arquivado';
250
+ status: 'publicado' | 'rascunho' | 'arquivado';
256
251
  offeringType: 'on_demand' | 'agendado' | 'hibrido';
257
252
  categorias: string[];
258
253
  operationsProjectId: string;
@@ -624,7 +619,9 @@ export function CourseFormSheet({
624
619
  </Select>
625
620
  )}
626
621
  />
627
- <FieldError>{form.formState.errors.offeringType?.message}</FieldError>
622
+ <FieldError>
623
+ {form.formState.errors.offeringType?.message}
624
+ </FieldError>
628
625
  </Field>
629
626
  </div>
630
627
 
@@ -719,8 +716,8 @@ export function CourseFormSheet({
719
716
  />
720
717
  </SelectTrigger>
721
718
  <SelectContent>
722
- <SelectItem value="ativo">
723
- {t('status.active')}
719
+ <SelectItem value="publicado">
720
+ {t('status.published')}
724
721
  </SelectItem>
725
722
  <SelectItem value="rascunho">
726
723
  {t('status.draft')}
@@ -959,7 +956,7 @@ export function CourseFormSheet({
959
956
  </Button>
960
957
  </SheetFooter>
961
958
  </form>
962
- </ResizableSheetContent>
959
+ </ResizableSheetContent>
963
960
  </Sheet>
964
961
  );
965
962
  }
@@ -45,6 +45,8 @@ export function fabricObjToFull(fObj: any): TemplateObject {
45
45
  const type: TemplateObject['type'] = fObj._tplType ?? 'shape';
46
46
  const key: string | undefined = fObj._tplKey;
47
47
  const shape: 'rect' | 'line' | undefined = fObj._tplShape;
48
+ const isQrPlaceholder =
49
+ type === 'field' && key === 'qrCode' && fObj._tplQrPlaceholder === true;
48
50
 
49
51
  const obj: TemplateObject = {
50
52
  ...partial,
@@ -56,7 +58,7 @@ export function fabricObjToFull(fObj: any): TemplateObject {
56
58
  };
57
59
 
58
60
  /* text */
59
- if (type === 'field' || type === 'staticText') {
61
+ if ((type === 'field' || type === 'staticText') && !isQrPlaceholder) {
60
62
  obj.text = fObj.text ?? '';
61
63
  obj.textStyle = {
62
64
  fontFamily: fObj.fontFamily ?? 'Inter',
@@ -179,7 +181,21 @@ export function createFabricFromTemplate(
179
181
 
180
182
  let fObj: any = null;
181
183
 
182
- if (tObj.type === 'field' || tObj.type === 'staticText') {
184
+ if (tObj.type === 'field' && tObj.key === 'qrCode') {
185
+ const qrSize = Math.max(Math.min(w || 180, 420), 80);
186
+ fObj = new fabric.Rect({
187
+ ...common,
188
+ width: qrSize,
189
+ height: qrSize,
190
+ fill: '#f8fafc',
191
+ stroke: '#64748b',
192
+ strokeWidth: 1.5,
193
+ strokeDashArray: [6, 4],
194
+ rx: 4,
195
+ ry: 4,
196
+ });
197
+ fObj._tplQrPlaceholder = true;
198
+ } else if (tObj.type === 'field' || tObj.type === 'staticText') {
183
199
  const ts = tObj.textStyle;
184
200
  const fabricProps: Record<string, any> = {
185
201
  ...common,
@@ -234,10 +250,16 @@ export function createFabricFromTemplate(
234
250
  } else if (tObj.type === 'image') {
235
251
  const isCoursePlaceholder =
236
252
  tObj.key === 'courseLogo' || tObj.key === 'courseBanner';
253
+ const isCourseLogo = tObj.key === 'courseLogo';
254
+ const logoSize = Math.max(w || 0, h || 0, 180);
237
255
  fObj = new fabric.Rect({
238
256
  ...common,
239
- width: w || (tObj.key === 'courseBanner' ? 420 : 150),
240
- height: h || (tObj.key === 'courseBanner' ? 140 : 150),
257
+ width: isCourseLogo
258
+ ? logoSize
259
+ : w || (tObj.key === 'courseBanner' ? 420 : 150),
260
+ height: isCourseLogo
261
+ ? logoSize
262
+ : h || (tObj.key === 'courseBanner' ? 140 : 150),
241
263
  fill: '#e2e8f0',
242
264
  stroke: '#cbd5e1',
243
265
  strokeWidth: 1,
@@ -51,6 +51,7 @@ export const CANVAS_H = 1131;
51
51
  export const FIELD_KEYS = [
52
52
  'studentName',
53
53
  'courseName',
54
+ 'scheduledClassName',
54
55
  'startDate',
55
56
  'endDate',
56
57
  'workloadHours',
@@ -66,6 +67,7 @@ export type FieldKey = (typeof FIELD_KEYS)[number];
66
67
  export const FIELD_LABELS: Record<FieldKey, string> = {
67
68
  studentName: 'Nome do Aluno',
68
69
  courseName: 'Nome do Curso',
70
+ scheduledClassName: 'Nome da Turma Agendada',
69
71
  startDate: 'Data Início',
70
72
  endDate: 'Data Fim',
71
73
  workloadHours: 'Carga Horária',
@@ -92,6 +94,7 @@ export function getObjectLabel(obj: TemplateObject): string {
92
94
  const fieldLabelMap: Record<string, string> = {
93
95
  studentName: 'Nome do Aluno',
94
96
  courseName: 'Nome do Curso',
97
+ scheduledClassName: 'Nome da Turma Agendada',
95
98
  startDate: 'Data Início',
96
99
  endDate: 'Data Fim',
97
100
  workloadHours: 'Carga Horária',
@@ -106,6 +109,9 @@ export function getObjectLabel(obj: TemplateObject): string {
106
109
 
107
110
  switch (obj.type) {
108
111
  case 'field':
112
+ if (obj.key === 'qrCode') {
113
+ return 'Image: QR Code';
114
+ }
109
115
  return `Field: ${fieldLabelMap[obj.key ?? ''] ?? obj.key ?? '?'}`;
110
116
  case 'staticText':
111
117
  return `Text: ${(obj.text ?? 'Texto').slice(0, 20)}`;