academe-kit 0.3.7 → 0.3.9

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.
@@ -0,0 +1,225 @@
1
+ import type { AcademeApiClient } from "./index";
2
+ import type { components } from "../types/academe-api";
3
+ type CreateProductBody = components["schemas"]["CreateProductDto"];
4
+ type UpdateProductDto = components["schemas"]["UpdateProductDto"];
5
+ type GetProductsParams = {
6
+ name?: string;
7
+ search?: string;
8
+ page?: number;
9
+ limit?: number;
10
+ };
11
+ export declare function createProductService(apiClient: AcademeApiClient): {
12
+ /**
13
+ * List all products with optional filters
14
+ */
15
+ getProducts(params?: GetProductsParams): Promise<import("openapi-fetch").FetchResponse<{
16
+ parameters: {
17
+ query?: {
18
+ name?: string;
19
+ search?: string;
20
+ page?: number;
21
+ limit?: number;
22
+ };
23
+ header?: never;
24
+ path?: never;
25
+ cookie?: never;
26
+ };
27
+ requestBody?: never;
28
+ responses: {
29
+ 200: {
30
+ headers: {
31
+ [name: string]: unknown;
32
+ };
33
+ content: {
34
+ "application/json": {
35
+ status?: string;
36
+ data?: components["schemas"]["Product"][];
37
+ meta?: {
38
+ total?: number;
39
+ page?: number;
40
+ limit?: number;
41
+ totalPages?: number;
42
+ };
43
+ };
44
+ };
45
+ };
46
+ 401: components["responses"]["Unauthorized"];
47
+ 500: components["responses"]["ServerError"];
48
+ };
49
+ }, {
50
+ params: {
51
+ query: GetProductsParams | undefined;
52
+ };
53
+ }, `${string}/${string}`>>;
54
+ /**
55
+ * Get product by ID
56
+ */
57
+ getProductById(id: string): Promise<import("openapi-fetch").FetchResponse<{
58
+ parameters: {
59
+ query?: never;
60
+ header?: never;
61
+ path: {
62
+ id: string;
63
+ };
64
+ cookie?: never;
65
+ };
66
+ requestBody?: never;
67
+ responses: {
68
+ 200: {
69
+ headers: {
70
+ [name: string]: unknown;
71
+ };
72
+ content: {
73
+ "application/json": {
74
+ status?: string;
75
+ data?: components["schemas"]["Product"];
76
+ };
77
+ };
78
+ };
79
+ 400: components["responses"]["BadRequest"];
80
+ 401: components["responses"]["Unauthorized"];
81
+ 404: components["responses"]["NotFound"];
82
+ 500: components["responses"]["ServerError"];
83
+ };
84
+ }, {
85
+ params: {
86
+ path: {
87
+ id: string;
88
+ };
89
+ };
90
+ }, `${string}/${string}`>>;
91
+ /**
92
+ * Create a new product
93
+ */
94
+ createProduct(body: CreateProductBody): Promise<import("openapi-fetch").FetchResponse<{
95
+ parameters: {
96
+ query?: never;
97
+ header?: never;
98
+ path?: never;
99
+ cookie?: never;
100
+ };
101
+ requestBody: {
102
+ content: {
103
+ "application/json": components["schemas"]["CreateProductDto"];
104
+ };
105
+ };
106
+ responses: {
107
+ 201: {
108
+ headers: {
109
+ [name: string]: unknown;
110
+ };
111
+ content: {
112
+ "application/json": {
113
+ status?: string;
114
+ data?: components["schemas"]["Product"];
115
+ };
116
+ };
117
+ };
118
+ 400: components["responses"]["BadRequest"];
119
+ 401: components["responses"]["Unauthorized"];
120
+ 409: {
121
+ headers: {
122
+ [name: string]: unknown;
123
+ };
124
+ content: {
125
+ "application/json": {
126
+ status?: string;
127
+ message?: string;
128
+ };
129
+ };
130
+ };
131
+ 500: components["responses"]["ServerError"];
132
+ };
133
+ }, {
134
+ body: {
135
+ id?: string;
136
+ name: string;
137
+ description?: string;
138
+ };
139
+ }, `${string}/${string}`>>;
140
+ /**
141
+ * Update product information
142
+ */
143
+ updateProduct(id: string, body: UpdateProductDto): Promise<import("openapi-fetch").FetchResponse<{
144
+ parameters: {
145
+ query?: never;
146
+ header?: never;
147
+ path: {
148
+ id: string;
149
+ };
150
+ cookie?: never;
151
+ };
152
+ requestBody: {
153
+ content: {
154
+ "application/json": components["schemas"]["UpdateProductDto"];
155
+ };
156
+ };
157
+ responses: {
158
+ 200: {
159
+ headers: {
160
+ [name: string]: unknown;
161
+ };
162
+ content: {
163
+ "application/json": {
164
+ status?: string;
165
+ data?: components["schemas"]["Product"];
166
+ };
167
+ };
168
+ };
169
+ 400: components["responses"]["BadRequest"];
170
+ 401: components["responses"]["Unauthorized"];
171
+ 404: components["responses"]["NotFound"];
172
+ 409: {
173
+ headers: {
174
+ [name: string]: unknown;
175
+ };
176
+ content?: never;
177
+ };
178
+ 500: components["responses"]["ServerError"];
179
+ };
180
+ }, {
181
+ params: {
182
+ path: {
183
+ id: string;
184
+ };
185
+ };
186
+ body: {
187
+ name?: string;
188
+ description?: string;
189
+ };
190
+ }, `${string}/${string}`>>;
191
+ /**
192
+ * Delete product
193
+ */
194
+ deleteProduct(id: string): Promise<import("openapi-fetch").FetchResponse<{
195
+ parameters: {
196
+ query?: never;
197
+ header?: never;
198
+ path: {
199
+ id: string;
200
+ };
201
+ cookie?: never;
202
+ };
203
+ requestBody?: never;
204
+ responses: {
205
+ 204: {
206
+ headers: {
207
+ [name: string]: unknown;
208
+ };
209
+ content?: never;
210
+ };
211
+ 400: components["responses"]["BadRequest"];
212
+ 401: components["responses"]["Unauthorized"];
213
+ 404: components["responses"]["NotFound"];
214
+ 500: components["responses"]["ServerError"];
215
+ };
216
+ }, {
217
+ params: {
218
+ path: {
219
+ id: string;
220
+ };
221
+ };
222
+ }, `${string}/${string}`>>;
223
+ };
224
+ export type ProductService = ReturnType<typeof createProductService>;
225
+ export {};
@@ -0,0 +1,223 @@
1
+ import type { AcademeApiClient } from './index';
2
+ import type { components } from '../types/academe-api';
3
+ type CreateQuizDto = components['schemas']['CreateQuizDto'];
4
+ type UpdateQuizDto = components['schemas']['UpdateQuizDto'];
5
+ type GetQuizzesParams = {
6
+ title?: string;
7
+ courseId?: string;
8
+ isActive?: boolean;
9
+ createdBy?: string;
10
+ search?: string;
11
+ page?: number;
12
+ limit?: number;
13
+ };
14
+ export declare function createQuizService(apiClient: AcademeApiClient): {
15
+ /**
16
+ * List all quizzes
17
+ */
18
+ getAll(params?: GetQuizzesParams): Promise<import("openapi-fetch").FetchResponse<{
19
+ parameters: {
20
+ query?: {
21
+ title?: string;
22
+ courseId?: string;
23
+ isActive?: boolean;
24
+ createdBy?: string;
25
+ search?: string;
26
+ page?: number;
27
+ limit?: number;
28
+ };
29
+ header?: never;
30
+ path?: never;
31
+ cookie?: never;
32
+ };
33
+ requestBody?: never;
34
+ responses: {
35
+ 200: {
36
+ headers: {
37
+ [name: string]: unknown;
38
+ };
39
+ content: {
40
+ "application/json": {
41
+ status?: string;
42
+ data?: components["schemas"]["Quiz"][];
43
+ meta?: components["schemas"]["PaginationMeta"];
44
+ };
45
+ };
46
+ };
47
+ 401: components["responses"]["Unauthorized"];
48
+ 500: components["responses"]["ServerError"];
49
+ };
50
+ }, {
51
+ params: {
52
+ query: GetQuizzesParams | undefined;
53
+ };
54
+ }, `${string}/${string}`>>;
55
+ /**
56
+ * Get quiz by ID
57
+ */
58
+ getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
59
+ parameters: {
60
+ query?: never;
61
+ header?: never;
62
+ path: {
63
+ id: components["parameters"]["id"];
64
+ };
65
+ cookie?: never;
66
+ };
67
+ requestBody?: never;
68
+ responses: {
69
+ 200: {
70
+ headers: {
71
+ [name: string]: unknown;
72
+ };
73
+ content: {
74
+ "application/json": {
75
+ status?: string;
76
+ data?: components["schemas"]["Quiz"];
77
+ };
78
+ };
79
+ };
80
+ 400: components["responses"]["BadRequest"];
81
+ 401: components["responses"]["Unauthorized"];
82
+ 404: components["responses"]["NotFound"];
83
+ 500: components["responses"]["ServerError"];
84
+ };
85
+ }, {
86
+ params: {
87
+ path: {
88
+ id: string;
89
+ };
90
+ };
91
+ }, `${string}/${string}`>>;
92
+ /**
93
+ * Create a new quiz
94
+ */
95
+ create(data: CreateQuizDto): Promise<import("openapi-fetch").FetchResponse<{
96
+ parameters: {
97
+ query?: never;
98
+ header?: never;
99
+ path?: never;
100
+ cookie?: never;
101
+ };
102
+ requestBody: {
103
+ content: {
104
+ "application/json": components["schemas"]["CreateQuizDto"];
105
+ };
106
+ };
107
+ responses: {
108
+ 201: {
109
+ headers: {
110
+ [name: string]: unknown;
111
+ };
112
+ content: {
113
+ "application/json": {
114
+ status?: string;
115
+ data?: components["schemas"]["Quiz"];
116
+ };
117
+ };
118
+ };
119
+ 400: components["responses"]["BadRequest"];
120
+ 401: components["responses"]["Unauthorized"];
121
+ 500: components["responses"]["ServerError"];
122
+ };
123
+ }, {
124
+ body: {
125
+ courseId?: string;
126
+ title: string;
127
+ description?: string;
128
+ passingScore?: number;
129
+ timeLimit?: number;
130
+ maxAttempts?: number;
131
+ randomizeQuestions?: boolean;
132
+ showCorrectAnswers?: boolean;
133
+ isActive?: boolean;
134
+ createdBy: string;
135
+ };
136
+ }, `${string}/${string}`>>;
137
+ /**
138
+ * Update quiz
139
+ */
140
+ update(id: string, data: UpdateQuizDto): Promise<import("openapi-fetch").FetchResponse<{
141
+ parameters: {
142
+ query?: never;
143
+ header?: never;
144
+ path: {
145
+ id: components["parameters"]["id"];
146
+ };
147
+ cookie?: never;
148
+ };
149
+ requestBody: {
150
+ content: {
151
+ "application/json": components["schemas"]["UpdateQuizDto"];
152
+ };
153
+ };
154
+ responses: {
155
+ 200: {
156
+ headers: {
157
+ [name: string]: unknown;
158
+ };
159
+ content: {
160
+ "application/json": {
161
+ status?: string;
162
+ data?: components["schemas"]["Quiz"];
163
+ };
164
+ };
165
+ };
166
+ 400: components["responses"]["BadRequest"];
167
+ 401: components["responses"]["Unauthorized"];
168
+ 404: components["responses"]["NotFound"];
169
+ 500: components["responses"]["ServerError"];
170
+ };
171
+ }, {
172
+ params: {
173
+ path: {
174
+ id: string;
175
+ };
176
+ };
177
+ body: {
178
+ courseId?: string;
179
+ title?: string;
180
+ description?: string;
181
+ passingScore?: number;
182
+ timeLimit?: number;
183
+ maxAttempts?: number;
184
+ randomizeQuestions?: boolean;
185
+ showCorrectAnswers?: boolean;
186
+ isActive?: boolean;
187
+ };
188
+ }, `${string}/${string}`>>;
189
+ /**
190
+ * Delete quiz
191
+ */
192
+ delete(id: string): Promise<import("openapi-fetch").FetchResponse<{
193
+ parameters: {
194
+ query?: never;
195
+ header?: never;
196
+ path: {
197
+ id: components["parameters"]["id"];
198
+ };
199
+ cookie?: never;
200
+ };
201
+ requestBody?: never;
202
+ responses: {
203
+ 204: {
204
+ headers: {
205
+ [name: string]: unknown;
206
+ };
207
+ content?: never;
208
+ };
209
+ 400: components["responses"]["BadRequest"];
210
+ 401: components["responses"]["Unauthorized"];
211
+ 404: components["responses"]["NotFound"];
212
+ 500: components["responses"]["ServerError"];
213
+ };
214
+ }, {
215
+ params: {
216
+ path: {
217
+ id: string;
218
+ };
219
+ };
220
+ }, `${string}/${string}`>>;
221
+ };
222
+ export type QuizService = ReturnType<typeof createQuizService>;
223
+ export {};