academe-kit 0.3.7 → 0.3.8

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.
@@ -7,7 +7,7 @@ export { Spinner } from "./components/ui/spinner";
7
7
  export { AcademeAuthProvider, useAcademeAuth, } from "./context/SecurityProvider";
8
8
  export type { AcademeKeycloakContextProps, SecurityProviderProps, KeycloakUser, SecurityContextType, AcademeUser, } from "./context/SecurityProvider/types";
9
9
  export { createAcademeApiClient } from "./services";
10
- export type { AcademeApiClient } from "./services";
10
+ export type { AcademeApiClient, AcademeServices } from "./services";
11
11
  export { cn } from "./lib/utils";
12
12
  import "./index.css";
13
13
  import "./styles/globals.css";
@@ -0,0 +1,132 @@
1
+ import type { AcademeApiClient } from './index';
2
+ export declare function createAuthService(apiClient: AcademeApiClient): {
3
+ /**
4
+ * Generate TheMembers JWT token for authenticated user
5
+ * @description Generates a signed JWT token for TheMembers platform authentication.
6
+ * This endpoint requires the user to be already authenticated with Keycloak.
7
+ */
8
+ getToken(): Promise<import("openapi-fetch").FetchResponse<{
9
+ parameters: {
10
+ query?: never;
11
+ header?: never;
12
+ path?: never;
13
+ cookie?: never;
14
+ };
15
+ requestBody?: never;
16
+ responses: {
17
+ 200: {
18
+ headers: {
19
+ [name: string]: unknown;
20
+ };
21
+ content: {
22
+ "application/json": {
23
+ status?: string;
24
+ data?: {
25
+ token?: string;
26
+ user?: {
27
+ email?: string;
28
+ name?: string;
29
+ sub?: string;
30
+ };
31
+ };
32
+ };
33
+ };
34
+ };
35
+ 400: {
36
+ headers: {
37
+ [name: string]: unknown;
38
+ };
39
+ content: {
40
+ "application/json": {
41
+ status?: string;
42
+ message?: string;
43
+ };
44
+ };
45
+ };
46
+ 401: {
47
+ headers: {
48
+ [name: string]: unknown;
49
+ };
50
+ content: {
51
+ "application/json": {
52
+ status?: string;
53
+ message?: string;
54
+ };
55
+ };
56
+ };
57
+ 500: {
58
+ headers: {
59
+ [name: string]: unknown;
60
+ };
61
+ content: {
62
+ "application/json": {
63
+ status?: string;
64
+ message?: string;
65
+ };
66
+ };
67
+ };
68
+ };
69
+ }, import("openapi-fetch").FetchOptions<{
70
+ parameters: {
71
+ query?: never;
72
+ header?: never;
73
+ path?: never;
74
+ cookie?: never;
75
+ };
76
+ requestBody?: never;
77
+ responses: {
78
+ 200: {
79
+ headers: {
80
+ [name: string]: unknown;
81
+ };
82
+ content: {
83
+ "application/json": {
84
+ status?: string;
85
+ data?: {
86
+ token?: string;
87
+ user?: {
88
+ email?: string;
89
+ name?: string;
90
+ sub?: string;
91
+ };
92
+ };
93
+ };
94
+ };
95
+ };
96
+ 400: {
97
+ headers: {
98
+ [name: string]: unknown;
99
+ };
100
+ content: {
101
+ "application/json": {
102
+ status?: string;
103
+ message?: string;
104
+ };
105
+ };
106
+ };
107
+ 401: {
108
+ headers: {
109
+ [name: string]: unknown;
110
+ };
111
+ content: {
112
+ "application/json": {
113
+ status?: string;
114
+ message?: string;
115
+ };
116
+ };
117
+ };
118
+ 500: {
119
+ headers: {
120
+ [name: string]: unknown;
121
+ };
122
+ content: {
123
+ "application/json": {
124
+ status?: string;
125
+ message?: string;
126
+ };
127
+ };
128
+ };
129
+ };
130
+ }> | undefined, `${string}/${string}`>>;
131
+ };
132
+ export type AuthService = ReturnType<typeof createAuthService>;
@@ -0,0 +1,221 @@
1
+ import type { AcademeApiClient } from './index';
2
+ import type { components } from '../types/academe-api';
3
+ type CreateCertificateDto = components['schemas']['CreateCertificateDto'];
4
+ type UpdateCertificateDto = components['schemas']['UpdateCertificateDto'];
5
+ export declare function createCertificateService(apiClient: AcademeApiClient): {
6
+ /**
7
+ * List all certificates
8
+ */
9
+ getAll(): Promise<import("openapi-fetch").FetchResponse<{
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ requestBody?: never;
17
+ responses: {
18
+ 200: {
19
+ headers: {
20
+ [name: string]: unknown;
21
+ };
22
+ content: {
23
+ "application/json": {
24
+ status?: string;
25
+ data?: components["schemas"]["Certificate"][];
26
+ };
27
+ };
28
+ };
29
+ 401: components["responses"]["Unauthorized"];
30
+ 500: components["responses"]["ServerError"];
31
+ };
32
+ }, import("openapi-fetch").FetchOptions<{
33
+ parameters: {
34
+ query?: never;
35
+ header?: never;
36
+ path?: never;
37
+ cookie?: never;
38
+ };
39
+ requestBody?: never;
40
+ responses: {
41
+ 200: {
42
+ headers: {
43
+ [name: string]: unknown;
44
+ };
45
+ content: {
46
+ "application/json": {
47
+ status?: string;
48
+ data?: components["schemas"]["Certificate"][];
49
+ };
50
+ };
51
+ };
52
+ 401: components["responses"]["Unauthorized"];
53
+ 500: components["responses"]["ServerError"];
54
+ };
55
+ }> | undefined, `${string}/${string}`>>;
56
+ /**
57
+ * Get certificate by ID
58
+ */
59
+ getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
60
+ parameters: {
61
+ query?: never;
62
+ header?: never;
63
+ path: {
64
+ id: components["parameters"]["id"];
65
+ };
66
+ cookie?: never;
67
+ };
68
+ requestBody?: never;
69
+ responses: {
70
+ 200: {
71
+ headers: {
72
+ [name: string]: unknown;
73
+ };
74
+ content: {
75
+ "application/json": {
76
+ status?: string;
77
+ data?: components["schemas"]["Certificate"];
78
+ };
79
+ };
80
+ };
81
+ 400: components["responses"]["BadRequest"];
82
+ 401: components["responses"]["Unauthorized"];
83
+ 404: components["responses"]["NotFound"];
84
+ 500: components["responses"]["ServerError"];
85
+ };
86
+ }, {
87
+ params: {
88
+ path: {
89
+ id: string;
90
+ };
91
+ };
92
+ }, `${string}/${string}`>>;
93
+ /**
94
+ * Create a new certificate
95
+ */
96
+ create(data: CreateCertificateDto): Promise<import("openapi-fetch").FetchResponse<{
97
+ parameters: {
98
+ query?: never;
99
+ header?: never;
100
+ path?: never;
101
+ cookie?: never;
102
+ };
103
+ requestBody: {
104
+ content: {
105
+ "application/json": components["schemas"]["CreateCertificateDto"];
106
+ };
107
+ };
108
+ responses: {
109
+ 201: {
110
+ headers: {
111
+ [name: string]: unknown;
112
+ };
113
+ content: {
114
+ "application/json": {
115
+ status?: string;
116
+ data?: components["schemas"]["Certificate"];
117
+ message?: string;
118
+ };
119
+ };
120
+ };
121
+ 400: components["responses"]["BadRequest"];
122
+ 401: components["responses"]["Unauthorized"];
123
+ 500: components["responses"]["ServerError"];
124
+ };
125
+ }, {
126
+ body: {
127
+ userId: string;
128
+ quizAttemptId?: string;
129
+ certificateTemplateId: string;
130
+ certificateNumber: string;
131
+ url?: string;
132
+ };
133
+ }, `${string}/${string}`>>;
134
+ /**
135
+ * Update certificate
136
+ */
137
+ update(id: string, data: UpdateCertificateDto): Promise<import("openapi-fetch").FetchResponse<{
138
+ parameters: {
139
+ query?: never;
140
+ header?: never;
141
+ path: {
142
+ id: components["parameters"]["id"];
143
+ };
144
+ cookie?: never;
145
+ };
146
+ requestBody: {
147
+ content: {
148
+ "application/json": components["schemas"]["UpdateCertificateDto"];
149
+ };
150
+ };
151
+ responses: {
152
+ 200: {
153
+ headers: {
154
+ [name: string]: unknown;
155
+ };
156
+ content: {
157
+ "application/json": {
158
+ status?: string;
159
+ data?: components["schemas"]["Certificate"];
160
+ message?: string;
161
+ };
162
+ };
163
+ };
164
+ 400: components["responses"]["BadRequest"];
165
+ 401: components["responses"]["Unauthorized"];
166
+ 404: components["responses"]["NotFound"];
167
+ 500: components["responses"]["ServerError"];
168
+ };
169
+ }, {
170
+ params: {
171
+ path: {
172
+ id: string;
173
+ };
174
+ };
175
+ body: {
176
+ quizAttemptId?: string;
177
+ certificateTemplateId?: string;
178
+ certificateNumber?: string;
179
+ url?: string;
180
+ };
181
+ }, `${string}/${string}`>>;
182
+ /**
183
+ * Delete certificate
184
+ */
185
+ delete(id: string): Promise<import("openapi-fetch").FetchResponse<{
186
+ parameters: {
187
+ query?: never;
188
+ header?: never;
189
+ path: {
190
+ id: components["parameters"]["id"];
191
+ };
192
+ cookie?: never;
193
+ };
194
+ requestBody?: never;
195
+ responses: {
196
+ 200: {
197
+ headers: {
198
+ [name: string]: unknown;
199
+ };
200
+ content: {
201
+ "application/json": {
202
+ status?: string;
203
+ message?: string;
204
+ };
205
+ };
206
+ };
207
+ 400: components["responses"]["BadRequest"];
208
+ 401: components["responses"]["Unauthorized"];
209
+ 404: components["responses"]["NotFound"];
210
+ 500: components["responses"]["ServerError"];
211
+ };
212
+ }, {
213
+ params: {
214
+ path: {
215
+ id: string;
216
+ };
217
+ };
218
+ }, `${string}/${string}`>>;
219
+ };
220
+ export type CertificateService = ReturnType<typeof createCertificateService>;
221
+ export {};
@@ -1,7 +1,7 @@
1
- import type { AcademeApiClient } from './index';
2
- import type { components } from '../types/academe-api';
3
- type CreateClassroomDto = components['schemas']['CreateClassroomDto'];
4
- type UpdateClassroomDto = components['schemas']['UpdateClassroomDto'];
1
+ import type { AcademeApiClient } from "./index";
2
+ import type { components } from "../types/academe-api";
3
+ type CreateClassroomDto = components["schemas"]["CreateClassroomDto"];
4
+ type UpdateClassroomDto = components["schemas"]["UpdateClassroomDto"];
5
5
  type GetClassroomsByInstitutionParams = {
6
6
  page?: number;
7
7
  limit?: number;
@@ -142,6 +142,57 @@ export declare function createClassroomService(apiClient: AcademeApiClient): {
142
142
  query: GetClassroomsByInstitutionParams | undefined;
143
143
  };
144
144
  }, `${string}/${string}`>>;
145
+ getBySeatCode(seatCodeId: string): Promise<import("openapi-fetch").FetchResponse<{
146
+ parameters: {
147
+ query?: {
148
+ includeUserCount?: boolean;
149
+ };
150
+ header?: never;
151
+ path: {
152
+ seatCodeId: string;
153
+ };
154
+ cookie?: never;
155
+ };
156
+ requestBody?: never;
157
+ responses: {
158
+ 200: {
159
+ headers: {
160
+ [name: string]: unknown;
161
+ };
162
+ content: {
163
+ "application/json": {
164
+ status?: string;
165
+ data?: (components["schemas"]["InstitutionClassroom"] & {
166
+ userCount?: number;
167
+ })[];
168
+ };
169
+ };
170
+ };
171
+ 400: {
172
+ headers: {
173
+ [name: string]: unknown;
174
+ };
175
+ content: {
176
+ "application/json": components["schemas"]["Error"];
177
+ };
178
+ };
179
+ 404: {
180
+ headers: {
181
+ [name: string]: unknown;
182
+ };
183
+ content: {
184
+ "application/json": components["schemas"]["Error"];
185
+ };
186
+ };
187
+ 500: components["responses"]["ServerError"];
188
+ };
189
+ }, {
190
+ params: {
191
+ path: {
192
+ seatCodeId: string;
193
+ };
194
+ };
195
+ }, `${string}/${string}`>>;
145
196
  /**
146
197
  * Create a new classroom
147
198
  */