academe-kit 0.3.8 → 0.4.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.
- package/dist/index.d.ts +6946 -5179
- package/dist/index.esm.js +187 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +187 -4
- package/dist/index.js.map +1 -1
- package/dist/types/context/SecurityProvider/index.d.ts +10 -0
- package/dist/types/context/SecurityProvider/types.d.ts +1 -1
- package/dist/types/services/CourseService.d.ts +216 -0
- package/dist/types/services/InstitutionService.d.ts +596 -0
- package/dist/types/services/ProductService.d.ts +225 -0
- package/dist/types/services/UserService.d.ts +2 -0
- package/dist/types/services/index.d.ts +6 -0
- package/dist/types/types/academe-api.d.ts +1098 -389
- package/dist/types/types/index.d.ts +9 -0
- package/package.json +1 -1
|
@@ -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 {};
|
|
@@ -214,6 +214,7 @@ export declare function createUserService(apiClient: AcademeApiClient): {
|
|
|
214
214
|
birthdate?: string;
|
|
215
215
|
groupId?: string;
|
|
216
216
|
institutionId?: string;
|
|
217
|
+
guardianId?: string;
|
|
217
218
|
};
|
|
218
219
|
}, `${string}/${string}`>>;
|
|
219
220
|
createPublicUser(body: CreateUserBody): Promise<import("openapi-fetch").FetchResponse<{
|
|
@@ -290,6 +291,7 @@ export declare function createUserService(apiClient: AcademeApiClient): {
|
|
|
290
291
|
birthdate?: string;
|
|
291
292
|
groupId?: string;
|
|
292
293
|
institutionId?: string;
|
|
294
|
+
guardianId?: string;
|
|
293
295
|
};
|
|
294
296
|
}, `${string}/${string}`>>;
|
|
295
297
|
/**
|
|
@@ -13,6 +13,8 @@ import { type GroupService } from "./GroupService";
|
|
|
13
13
|
import { type QuizService } from "./QuizService";
|
|
14
14
|
import { type CertificateService } from "./CertificateService";
|
|
15
15
|
import { type SeatCodeService } from "./SeatCodeService";
|
|
16
|
+
import { type ProductService } from "./ProductService";
|
|
17
|
+
import { type CourseService } from './CourseService';
|
|
16
18
|
export type AcademeApiClient = ReturnType<typeof createClient<paths>>;
|
|
17
19
|
export declare function createAcademeApiClient(baseUrl: string): AcademeApiClient;
|
|
18
20
|
export interface AcademeServices {
|
|
@@ -24,11 +26,13 @@ export interface AcademeServices {
|
|
|
24
26
|
serie: SerieService;
|
|
25
27
|
shift: ShiftService;
|
|
26
28
|
guardian: GuardianService;
|
|
29
|
+
course: CourseService;
|
|
27
30
|
auth: AuthService;
|
|
28
31
|
group: GroupService;
|
|
29
32
|
quiz: QuizService;
|
|
30
33
|
certificate: CertificateService;
|
|
31
34
|
seatCode: SeatCodeService;
|
|
35
|
+
product: ProductService;
|
|
32
36
|
}
|
|
33
37
|
export declare function createAcademeServices(apiClient: AcademeApiClient): AcademeServices;
|
|
34
38
|
export { createUserService, type UserService } from "./UserService";
|
|
@@ -43,3 +47,5 @@ export { createGroupService, type GroupService } from "./GroupService";
|
|
|
43
47
|
export { createQuizService, type QuizService } from "./QuizService";
|
|
44
48
|
export { createCertificateService, type CertificateService } from "./CertificateService";
|
|
45
49
|
export { createSeatCodeService, type SeatCodeService } from "./SeatCodeService";
|
|
50
|
+
export { createProductService, type ProductService } from "./ProductService";
|
|
51
|
+
export { createCourseService, type CourseService } from './CourseService';
|