academe-kit 0.15.0 → 0.16.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.
@@ -203,14 +203,17 @@ export declare function createUserService(apiClient: AcademeApiClient): {
203
203
  body: {
204
204
  firstName: string;
205
205
  lastName: string;
206
- email: string;
206
+ email?: string | null;
207
+ username?: string | null;
207
208
  password: string;
208
209
  phone?: string | null;
209
- document: string;
210
+ document?: string | null;
210
211
  gender?: "male" | "female" | "other" | null;
211
212
  birthdate?: string | null;
212
213
  groupId?: string | null;
213
214
  institutionId?: string | null;
215
+ institutionClassroomId?: string | null;
216
+ userCreationRequestsGroupId?: string | null;
214
217
  seatCodeId?: string | null;
215
218
  guardianId?: string | null;
216
219
  guardian?: components["schemas"]["CreateGuardianInlineDto"];
@@ -248,20 +251,61 @@ export declare function createUserService(apiClient: AcademeApiClient): {
248
251
  body: {
249
252
  firstName: string;
250
253
  lastName: string;
251
- email: string;
254
+ email?: string | null;
255
+ username?: string | null;
252
256
  password: string;
253
257
  phone?: string | null;
254
- document: string;
258
+ document?: string | null;
255
259
  gender?: "male" | "female" | "other" | null;
256
260
  birthdate?: string | null;
257
261
  groupId?: string | null;
258
262
  institutionId?: string | null;
263
+ institutionClassroomId?: string | null;
264
+ userCreationRequestsGroupId?: string | null;
259
265
  seatCodeId?: string | null;
260
266
  guardianId?: string | null;
261
267
  guardian?: components["schemas"]["CreateGuardianInlineDto"];
262
268
  avatarFileId?: string | null;
263
269
  };
264
270
  }, `${string}/${string}`>>;
271
+ /**
272
+ * Consulta o status de uma criação assíncrona de usuário, a partir do
273
+ * requestId devolvido pelo POST /users. Traz o `username` (login) gerado
274
+ * pelo worker — útil quando o usuário foi criado sem email.
275
+ */
276
+ getUserCreationRequest(requestId: string): Promise<import("openapi-fetch").FetchResponse<{
277
+ parameters: {
278
+ query?: never;
279
+ header?: never;
280
+ path: {
281
+ requestId: string;
282
+ };
283
+ cookie?: never;
284
+ };
285
+ requestBody?: never;
286
+ responses: {
287
+ 200: {
288
+ headers: {
289
+ [name: string]: unknown;
290
+ };
291
+ content: {
292
+ "application/json": {
293
+ status?: string;
294
+ data?: components["schemas"]["UserCreationRequest"];
295
+ };
296
+ };
297
+ };
298
+ 401: components["responses"]["Unauthorized"];
299
+ 404: components["responses"]["NotFound"];
300
+ 500: components["responses"]["ServerError"];
301
+ };
302
+ }, {
303
+ params: {
304
+ path: {
305
+ requestId: string;
306
+ };
307
+ };
308
+ }, `${string}/${string}`>>;
265
309
  /**
266
310
  * Update user information
267
311
  */
@@ -9235,7 +9235,7 @@ export interface paths {
9235
9235
  };
9236
9236
  requestBody?: never;
9237
9237
  responses: {
9238
- /** @description provider, embedUrl, videoExternalId, startTimeSeconds, durationSeconds, progress */
9238
+ /** @description provider, embedUrl, videoExternalId, startTimeSeconds, durationSeconds, progress e `ambient` (mídia do Ambient Glow — spriteUrlTemplate com placeholder `{n}`, thumbnailUrl e metadados da grade de seek; null quando o provider não é panda) */
9239
9239
  200: {
9240
9240
  headers: {
9241
9241
  [name: string]: unknown;
@@ -13819,6 +13819,407 @@ export interface paths {
13819
13819
  };
13820
13820
  trace?: never;
13821
13821
  };
13822
+ "/studio/state": {
13823
+ parameters: {
13824
+ query?: never;
13825
+ header?: never;
13826
+ path?: never;
13827
+ cookie?: never;
13828
+ };
13829
+ /** Estado do Estúdio (publicado + MEUS rascunhos mesclados) */
13830
+ get: {
13831
+ parameters: {
13832
+ query?: {
13833
+ /** @description Escola do contexto (hero da escola + preview) */
13834
+ institutionId?: string;
13835
+ };
13836
+ header?: never;
13837
+ path?: never;
13838
+ cookie?: never;
13839
+ };
13840
+ requestBody?: never;
13841
+ responses: {
13842
+ /** @description hero{global,institution,myDrafts} + playlists[{id,draft,items,meta{state,hasMyDraft,stale,othersDrafts}}] + layout{order,hasMyDraft} + myDraftCount */
13843
+ 200: {
13844
+ headers: {
13845
+ [name: string]: unknown;
13846
+ };
13847
+ content?: never;
13848
+ };
13849
+ /** @description Não é staff */
13850
+ 403: {
13851
+ headers: {
13852
+ [name: string]: unknown;
13853
+ };
13854
+ content?: never;
13855
+ };
13856
+ };
13857
+ };
13858
+ put?: never;
13859
+ post?: never;
13860
+ delete?: never;
13861
+ options?: never;
13862
+ head?: never;
13863
+ patch?: never;
13864
+ trace?: never;
13865
+ };
13866
+ "/studio/drafts/playlist/{id}": {
13867
+ parameters: {
13868
+ query?: never;
13869
+ header?: never;
13870
+ path?: never;
13871
+ cookie?: never;
13872
+ };
13873
+ get?: never;
13874
+ /** Upsert do MEU rascunho de uma playlist (id pode ser de playlist nova — isNew) */
13875
+ put: {
13876
+ parameters: {
13877
+ query?: never;
13878
+ header?: never;
13879
+ path: {
13880
+ id: string;
13881
+ };
13882
+ cookie?: never;
13883
+ };
13884
+ requestBody: {
13885
+ content: {
13886
+ "application/json": {
13887
+ /** @enum {string} */
13888
+ op?: "upsert" | "delete";
13889
+ isNew?: boolean;
13890
+ playlist?: {
13891
+ title?: string;
13892
+ subtitle?: string | null;
13893
+ /** @enum {string} */
13894
+ status?: "draft" | "published";
13895
+ /** @enum {string} */
13896
+ source?: "curated" | "continue_watching" | "trending" | "watchlist" | "recent" | "continue_playlist";
13897
+ /** @enum {string} */
13898
+ variant?: "common" | "featured";
13899
+ /** @enum {string} */
13900
+ cardOrientation?: "horizontal" | "vertical" | "square" | "fullImage";
13901
+ itemsPerViewDesktop?: number;
13902
+ itemsPerViewMobile?: number;
13903
+ autoplay?: boolean;
13904
+ isGlobal?: boolean;
13905
+ };
13906
+ targets?: {
13907
+ institutionId?: string;
13908
+ organizationId?: string;
13909
+ }[];
13910
+ groupIds?: string[];
13911
+ /** @description ordem do array = position */
13912
+ items?: {
13913
+ courseId?: string;
13914
+ courseModuleId?: string;
13915
+ courseModuleLessonId?: string;
13916
+ }[];
13917
+ };
13918
+ };
13919
+ };
13920
+ responses: {
13921
+ /** @description Rascunho salvo (não altera o publicado) */
13922
+ 200: {
13923
+ headers: {
13924
+ [name: string]: unknown;
13925
+ };
13926
+ content?: never;
13927
+ };
13928
+ };
13929
+ };
13930
+ post?: never;
13931
+ delete?: never;
13932
+ options?: never;
13933
+ head?: never;
13934
+ patch?: never;
13935
+ trace?: never;
13936
+ };
13937
+ "/studio/drafts/hero": {
13938
+ parameters: {
13939
+ query?: never;
13940
+ header?: never;
13941
+ path?: never;
13942
+ cookie?: never;
13943
+ };
13944
+ get?: never;
13945
+ /** Upsert do MEU rascunho do hero (institutionId no body; ausente = global) */
13946
+ put: {
13947
+ parameters: {
13948
+ query?: never;
13949
+ header?: never;
13950
+ path?: never;
13951
+ cookie?: never;
13952
+ };
13953
+ requestBody: {
13954
+ content: {
13955
+ "application/json": {
13956
+ /** Format: uuid */
13957
+ institutionId?: string | null;
13958
+ /** @enum {string} */
13959
+ op?: "upsert" | "delete";
13960
+ hero?: {
13961
+ eyebrow?: string | null;
13962
+ title?: string;
13963
+ subtitle?: string | null;
13964
+ ctaLabel?: string | null;
13965
+ ctaUrl?: string | null;
13966
+ /** @enum {string} */
13967
+ mediaType?: "gradient" | "image" | "video";
13968
+ mediaUrl?: string | null;
13969
+ mediaLoop?: boolean;
13970
+ };
13971
+ };
13972
+ };
13973
+ };
13974
+ responses: {
13975
+ /** @description Rascunho salvo */
13976
+ 200: {
13977
+ headers: {
13978
+ [name: string]: unknown;
13979
+ };
13980
+ content?: never;
13981
+ };
13982
+ };
13983
+ };
13984
+ post?: never;
13985
+ delete?: never;
13986
+ options?: never;
13987
+ head?: never;
13988
+ patch?: never;
13989
+ trace?: never;
13990
+ };
13991
+ "/studio/drafts/layout": {
13992
+ parameters: {
13993
+ query?: never;
13994
+ header?: never;
13995
+ path?: never;
13996
+ cookie?: never;
13997
+ };
13998
+ get?: never;
13999
+ /** Upsert do MEU rascunho de ordem das rails (lista completa de ids) */
14000
+ put: {
14001
+ parameters: {
14002
+ query?: never;
14003
+ header?: never;
14004
+ path?: never;
14005
+ cookie?: never;
14006
+ };
14007
+ requestBody: {
14008
+ content: {
14009
+ "application/json": {
14010
+ order?: string[];
14011
+ };
14012
+ };
14013
+ };
14014
+ responses: {
14015
+ /** @description Rascunho salvo */
14016
+ 200: {
14017
+ headers: {
14018
+ [name: string]: unknown;
14019
+ };
14020
+ content?: never;
14021
+ };
14022
+ };
14023
+ };
14024
+ post?: never;
14025
+ delete?: never;
14026
+ options?: never;
14027
+ head?: never;
14028
+ patch?: never;
14029
+ trace?: never;
14030
+ };
14031
+ "/studio/drafts/{entityType}/{entityId}": {
14032
+ parameters: {
14033
+ query?: never;
14034
+ header?: never;
14035
+ path?: never;
14036
+ cookie?: never;
14037
+ };
14038
+ get?: never;
14039
+ put?: never;
14040
+ post?: never;
14041
+ /** Desfaz UM rascunho meu (playlist/hero por entidade) */
14042
+ delete: {
14043
+ parameters: {
14044
+ query?: never;
14045
+ header?: never;
14046
+ path: {
14047
+ entityType: "playlist" | "hero" | "layout";
14048
+ entityId: string;
14049
+ };
14050
+ cookie?: never;
14051
+ };
14052
+ requestBody?: never;
14053
+ responses: {
14054
+ /** @description { deleted: n } */
14055
+ 200: {
14056
+ headers: {
14057
+ [name: string]: unknown;
14058
+ };
14059
+ content?: never;
14060
+ };
14061
+ };
14062
+ };
14063
+ options?: never;
14064
+ head?: never;
14065
+ patch?: never;
14066
+ trace?: never;
14067
+ };
14068
+ "/studio/discard": {
14069
+ parameters: {
14070
+ query?: never;
14071
+ header?: never;
14072
+ path?: never;
14073
+ cookie?: never;
14074
+ };
14075
+ get?: never;
14076
+ put?: never;
14077
+ /** Descarta TODOS os meus rascunhos */
14078
+ post: {
14079
+ parameters: {
14080
+ query?: never;
14081
+ header?: never;
14082
+ path?: never;
14083
+ cookie?: never;
14084
+ };
14085
+ requestBody?: never;
14086
+ responses: {
14087
+ /** @description { discarded: n } */
14088
+ 200: {
14089
+ headers: {
14090
+ [name: string]: unknown;
14091
+ };
14092
+ content?: never;
14093
+ };
14094
+ };
14095
+ };
14096
+ delete?: never;
14097
+ options?: never;
14098
+ head?: never;
14099
+ patch?: never;
14100
+ trace?: never;
14101
+ };
14102
+ "/studio/publish": {
14103
+ parameters: {
14104
+ query?: never;
14105
+ header?: never;
14106
+ path?: never;
14107
+ cookie?: never;
14108
+ };
14109
+ get?: never;
14110
+ put?: never;
14111
+ /** Publica atomicamente os MEUS rascunhos (playlists+layout+heroes); nunca os de outro editor */
14112
+ post: {
14113
+ parameters: {
14114
+ query?: never;
14115
+ header?: never;
14116
+ path?: never;
14117
+ cookie?: never;
14118
+ };
14119
+ requestBody?: never;
14120
+ responses: {
14121
+ /** @description { applied{...}, warnings[] (staleness/missing) } */
14122
+ 200: {
14123
+ headers: {
14124
+ [name: string]: unknown;
14125
+ };
14126
+ content?: never;
14127
+ };
14128
+ /** @description Nenhuma alteração para publicar */
14129
+ 409: {
14130
+ headers: {
14131
+ [name: string]: unknown;
14132
+ };
14133
+ content?: never;
14134
+ };
14135
+ /** @description Falha (ex. conteúdo excluído) — nada foi aplicado */
14136
+ 422: {
14137
+ headers: {
14138
+ [name: string]: unknown;
14139
+ };
14140
+ content?: never;
14141
+ };
14142
+ };
14143
+ };
14144
+ delete?: never;
14145
+ options?: never;
14146
+ head?: never;
14147
+ patch?: never;
14148
+ trace?: never;
14149
+ };
14150
+ "/studio/catalog": {
14151
+ parameters: {
14152
+ query?: never;
14153
+ header?: never;
14154
+ path?: never;
14155
+ cookie?: never;
14156
+ };
14157
+ /** Busca de conteúdo p/ o picker (cursos/módulos/aulas, com flag published) */
14158
+ get: {
14159
+ parameters: {
14160
+ query?: {
14161
+ q?: string;
14162
+ kind?: "course" | "module" | "lesson";
14163
+ limit?: number;
14164
+ offset?: number;
14165
+ };
14166
+ header?: never;
14167
+ path?: never;
14168
+ cookie?: never;
14169
+ };
14170
+ requestBody?: never;
14171
+ responses: {
14172
+ /** @description { counts{courses,modules,lessons}, results[{kind,id,courseId,title,subtitle,coverUrl,published}] } */
14173
+ 200: {
14174
+ headers: {
14175
+ [name: string]: unknown;
14176
+ };
14177
+ content?: never;
14178
+ };
14179
+ };
14180
+ };
14181
+ put?: never;
14182
+ post?: never;
14183
+ delete?: never;
14184
+ options?: never;
14185
+ head?: never;
14186
+ patch?: never;
14187
+ trace?: never;
14188
+ };
14189
+ "/studio/audiences": {
14190
+ parameters: {
14191
+ query?: never;
14192
+ header?: never;
14193
+ path?: never;
14194
+ cookie?: never;
14195
+ };
14196
+ /** Chips de escopo do drawer (escolas, organizações e perfis) */
14197
+ get: {
14198
+ parameters: {
14199
+ query?: never;
14200
+ header?: never;
14201
+ path?: never;
14202
+ cookie?: never;
14203
+ };
14204
+ requestBody?: never;
14205
+ responses: {
14206
+ /** @description { institutions[], organizations[], groups[] } */
14207
+ 200: {
14208
+ headers: {
14209
+ [name: string]: unknown;
14210
+ };
14211
+ content?: never;
14212
+ };
14213
+ };
14214
+ };
14215
+ put?: never;
14216
+ post?: never;
14217
+ delete?: never;
14218
+ options?: never;
14219
+ head?: never;
14220
+ patch?: never;
14221
+ trace?: never;
14222
+ };
13822
14223
  "/submissions": {
13823
14224
  parameters: {
13824
14225
  query?: never;
@@ -16459,6 +16860,92 @@ export interface paths {
16459
16860
  patch?: never;
16460
16861
  trace?: never;
16461
16862
  };
16863
+ "/users/{id}/courses/{courseId}/lessons": {
16864
+ parameters: {
16865
+ query?: never;
16866
+ header?: never;
16867
+ path?: never;
16868
+ cookie?: never;
16869
+ };
16870
+ /**
16871
+ * Drill-down por aula de um curso para um aluno (drawer do backoffice)
16872
+ * @description Lista as aulas publicadas do curso na ordem de módulo/aula, com o progresso consolidado (user_lesson_progress_v2) e o agregado de sessões por aula. watchedRanges são os intervalos do vídeo efetivamente assistidos (merged), para o heatmap de cobertura. Só leitura — nenhuma migration.
16873
+ */
16874
+ get: {
16875
+ parameters: {
16876
+ query?: never;
16877
+ header?: never;
16878
+ path: {
16879
+ /** @description id do aluno */
16880
+ id: string;
16881
+ courseId: string;
16882
+ };
16883
+ cookie?: never;
16884
+ };
16885
+ requestBody?: never;
16886
+ responses: {
16887
+ /** @description Aulas do curso com progresso do aluno */
16888
+ 200: {
16889
+ headers: {
16890
+ [name: string]: unknown;
16891
+ };
16892
+ content: {
16893
+ "application/json": {
16894
+ /** @example success */
16895
+ status?: string;
16896
+ data?: {
16897
+ /** Format: uuid */
16898
+ courseId?: string;
16899
+ courseTitle?: string;
16900
+ totalLessons?: number;
16901
+ completedLessons?: number;
16902
+ hoursWatched?: number;
16903
+ avgPlaybackRate?: number | null;
16904
+ modules?: {
16905
+ /** Format: uuid */
16906
+ moduleId?: string;
16907
+ title?: string;
16908
+ position?: number;
16909
+ lessons?: {
16910
+ /** Format: uuid */
16911
+ lessonId?: string;
16912
+ title?: string;
16913
+ position?: number;
16914
+ durationSeconds?: number;
16915
+ completed?: boolean;
16916
+ /** Format: date-time */
16917
+ completedAt?: string | null;
16918
+ positionSeconds?: number;
16919
+ watchedSeconds?: number;
16920
+ watchedPct?: number;
16921
+ /** Format: date-time */
16922
+ lastActivityAt?: string | null;
16923
+ sessions?: number;
16924
+ ranges?: number[][];
16925
+ }[];
16926
+ }[];
16927
+ };
16928
+ };
16929
+ };
16930
+ };
16931
+ /** @description Curso não encontrado */
16932
+ 404: {
16933
+ headers: {
16934
+ [name: string]: unknown;
16935
+ };
16936
+ content?: never;
16937
+ };
16938
+ 500: components["responses"]["ServerError"];
16939
+ };
16940
+ };
16941
+ put?: never;
16942
+ post?: never;
16943
+ delete?: never;
16944
+ options?: never;
16945
+ head?: never;
16946
+ patch?: never;
16947
+ trace?: never;
16948
+ };
16462
16949
  "/vitrine/home": {
16463
16950
  parameters: {
16464
16951
  query?: never;
@@ -16705,7 +17192,12 @@ export interface components {
16705
17192
  * Format: email
16706
17193
  * @example john.doe@example.com
16707
17194
  */
16708
- email: string;
17195
+ email: string | null;
17196
+ /**
17197
+ * @description Login do usuário (gerado quando não informado)
17198
+ * @example johndoe
17199
+ */
17200
+ username?: string;
16709
17201
  /** @example +5511999999999 */
16710
17202
  phone?: string | null;
16711
17203
  /** @example 12345678901 */
@@ -16905,9 +17397,15 @@ export interface components {
16905
17397
  lastName: string;
16906
17398
  /**
16907
17399
  * Format: email
17400
+ * @description Optional. When omitted, the user logs in with the generated username
16908
17401
  * @example john.doe@example.com
16909
17402
  */
16910
- email: string;
17403
+ email?: string | null;
17404
+ /**
17405
+ * @description Optional. Auto-generated from firstName + lastName when omitted
17406
+ * @example johndoe
17407
+ */
17408
+ username?: string | null;
16911
17409
  /**
16912
17410
  * @description Password for the user's Keycloak account
16913
17411
  * @example SecurePassword123!
@@ -16916,7 +17414,7 @@ export interface components {
16916
17414
  /** @example +5511999999999 */
16917
17415
  phone?: string | null;
16918
17416
  /** @example 12345678901 */
16919
- document: string;
17417
+ document?: string | null;
16920
17418
  /**
16921
17419
  * @example male
16922
17420
  * @enum {string|null}
@@ -16939,6 +17437,18 @@ export interface components {
16939
17437
  * @example 550e8400-e29b-41d4-a716-446655440001
16940
17438
  */
16941
17439
  institutionId?: string | null;
17440
+ /**
17441
+ * Format: uuid
17442
+ * @description Optional classroom ID to enroll the user (requires groupId)
17443
+ * @example 550e8400-e29b-41d4-a716-446655440003
17444
+ */
17445
+ institutionClassroomId?: string | null;
17446
+ /**
17447
+ * Format: uuid
17448
+ * @description Optional ID that groups this request with other creation requests
17449
+ * @example 550e8400-e29b-41d4-a716-446655440004
17450
+ */
17451
+ userCreationRequestsGroupId?: string | null;
16942
17452
  /**
16943
17453
  * Format: uuid
16944
17454
  * @description Seat code ID to register the user
@@ -17068,7 +17578,12 @@ export interface components {
17068
17578
  * Format: email
17069
17579
  * @example john.doe@example.com
17070
17580
  */
17071
- email?: string;
17581
+ email?: string | null;
17582
+ /**
17583
+ * @description Login do usuário (gerado quando não informado)
17584
+ * @example johndoe
17585
+ */
17586
+ username?: string;
17072
17587
  /** @example +5511999999999 */
17073
17588
  phone?: string | null;
17074
17589
  /** @example 12345678901 */
@@ -19258,9 +19773,11 @@ export interface components {
19258
19773
  requestId?: string;
19259
19774
  /**
19260
19775
  * Format: email
19261
- * @description Email of the user being created
19776
+ * @description Email of the user being created (optional)
19262
19777
  */
19263
- email?: string;
19778
+ email?: string | null;
19779
+ /** @description Login of the created user, generated by the worker when not provided (available after processing) */
19780
+ username?: string | null;
19264
19781
  /**
19265
19782
  * @description Current status of the creation request
19266
19783
  * @enum {string}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "academe-kit",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "description": "Official React SDK for Academe ecosystem - Authentication, protected routes, API services, and UI components for educational management applications",
6
6
  "main": "dist/index.cjs",
@@ -22,7 +22,8 @@
22
22
  "dev": "storybook dev -p 6006",
23
23
  "build": "rollup -c",
24
24
  "build:watch": "rollup -c --watch",
25
- "build-storybook": "storybook build",
25
+ "build-storybook": "storybook build && cp storybook-static/llms.txt storybook-static/llms-full.txt",
26
+ "serve-storybook": "serve storybook-static -l ${PORT:-6006}",
26
27
  "storybook": "storybook dev -p 6006",
27
28
  "generate:api-types": "npx openapi-typescript http://localhost:3002/api/openapi.json -o ./src/types/academe-api.ts"
28
29
  },
@@ -79,6 +80,7 @@
79
80
  "rollup-plugin-dts": "^6.1.0",
80
81
  "rollup-plugin-peer-deps-external": "^2.2.4",
81
82
  "rollup-plugin-postcss": "^4.0.2",
83
+ "serve": "^14.2.4",
82
84
  "storybook": "^8.0.0",
83
85
  "tailwindcss": "^3.4.1",
84
86
  "tslib": "^2.6.2",