academe-kit 0.9.2 → 0.9.4

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,215 @@
1
+ import type { AcademeApiClient } from "./index";
2
+ import type { paths } from "../types/academe-api";
3
+ type GetStepsParams = paths["/steps"]["get"]["parameters"]["query"];
4
+ type CreateStepBody = paths["/steps"]["post"]["requestBody"]["content"]["application/json"];
5
+ type UpdateStepBody = paths["/steps/{id}"]["patch"]["requestBody"]["content"]["application/json"];
6
+ export declare function createStepService(apiClient: AcademeApiClient): {
7
+ /**
8
+ * List the step catalog (filterable by type / isActive)
9
+ */
10
+ getAll(params?: GetStepsParams): Promise<import("openapi-fetch").FetchResponse<{
11
+ parameters: {
12
+ query?: {
13
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
14
+ isActive?: boolean;
15
+ };
16
+ header?: never;
17
+ path?: never;
18
+ cookie?: never;
19
+ };
20
+ requestBody?: never;
21
+ responses: {
22
+ 200: {
23
+ headers: {
24
+ [name: string]: unknown;
25
+ };
26
+ content: {
27
+ "application/json": {
28
+ status?: string;
29
+ data?: import("../types/academe-api").components["schemas"]["Step"][];
30
+ };
31
+ };
32
+ };
33
+ 401: import("../types/academe-api").components["responses"]["Unauthorized"];
34
+ 500: import("../types/academe-api").components["responses"]["ServerError"];
35
+ };
36
+ }, {
37
+ params: {
38
+ query: {
39
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
40
+ isActive?: boolean;
41
+ } | undefined;
42
+ };
43
+ }, `${string}/${string}`>>;
44
+ /**
45
+ * Get a step by ID
46
+ */
47
+ getById(id: string): Promise<import("openapi-fetch").FetchResponse<{
48
+ parameters: {
49
+ query?: never;
50
+ header?: never;
51
+ path: {
52
+ id: import("../types/academe-api").components["parameters"]["id"];
53
+ };
54
+ cookie?: never;
55
+ };
56
+ requestBody?: never;
57
+ responses: {
58
+ 200: {
59
+ headers: {
60
+ [name: string]: unknown;
61
+ };
62
+ content: {
63
+ "application/json": {
64
+ status?: string;
65
+ data?: import("../types/academe-api").components["schemas"]["Step"];
66
+ };
67
+ };
68
+ };
69
+ 400: import("../types/academe-api").components["responses"]["BadRequest"];
70
+ 401: import("../types/academe-api").components["responses"]["Unauthorized"];
71
+ 404: import("../types/academe-api").components["responses"]["NotFound"];
72
+ 500: import("../types/academe-api").components["responses"]["ServerError"];
73
+ };
74
+ }, {
75
+ params: {
76
+ path: {
77
+ id: string;
78
+ };
79
+ };
80
+ }, `${string}/${string}`>>;
81
+ /**
82
+ * Create a new step in the catalog
83
+ */
84
+ create(data: CreateStepBody): Promise<import("openapi-fetch").FetchResponse<{
85
+ parameters: {
86
+ query?: never;
87
+ header?: never;
88
+ path?: never;
89
+ cookie?: never;
90
+ };
91
+ requestBody: {
92
+ content: {
93
+ "application/json": {
94
+ name: string;
95
+ color: string;
96
+ icon: string;
97
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
98
+ isActive?: boolean;
99
+ };
100
+ };
101
+ };
102
+ responses: {
103
+ 201: {
104
+ headers: {
105
+ [name: string]: unknown;
106
+ };
107
+ content: {
108
+ "application/json": {
109
+ status?: string;
110
+ data?: import("../types/academe-api").components["schemas"]["Step"];
111
+ };
112
+ };
113
+ };
114
+ 400: import("../types/academe-api").components["responses"]["BadRequest"];
115
+ 401: import("../types/academe-api").components["responses"]["Unauthorized"];
116
+ 500: import("../types/academe-api").components["responses"]["ServerError"];
117
+ };
118
+ }, {
119
+ body: {
120
+ name: string;
121
+ color: string;
122
+ icon: string;
123
+ type: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
124
+ isActive?: boolean;
125
+ };
126
+ }, `${string}/${string}`>>;
127
+ /**
128
+ * Update a step
129
+ */
130
+ update(id: string, data: UpdateStepBody): Promise<import("openapi-fetch").FetchResponse<{
131
+ parameters: {
132
+ query?: never;
133
+ header?: never;
134
+ path: {
135
+ id: import("../types/academe-api").components["parameters"]["id"];
136
+ };
137
+ cookie?: never;
138
+ };
139
+ requestBody: {
140
+ content: {
141
+ "application/json": {
142
+ name?: string;
143
+ color?: string;
144
+ icon?: string;
145
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
146
+ isActive?: boolean;
147
+ };
148
+ };
149
+ };
150
+ responses: {
151
+ 200: {
152
+ headers: {
153
+ [name: string]: unknown;
154
+ };
155
+ content: {
156
+ "application/json": {
157
+ status?: string;
158
+ data?: import("../types/academe-api").components["schemas"]["Step"];
159
+ };
160
+ };
161
+ };
162
+ 400: import("../types/academe-api").components["responses"]["BadRequest"];
163
+ 401: import("../types/academe-api").components["responses"]["Unauthorized"];
164
+ 404: import("../types/academe-api").components["responses"]["NotFound"];
165
+ 500: import("../types/academe-api").components["responses"]["ServerError"];
166
+ };
167
+ }, {
168
+ params: {
169
+ path: {
170
+ id: string;
171
+ };
172
+ };
173
+ body: {
174
+ name?: string;
175
+ color?: string;
176
+ icon?: string;
177
+ type?: "challenge" | "course" | "tutorial" | "publication" | "evaluation" | "certificate";
178
+ isActive?: boolean;
179
+ };
180
+ }, `${string}/${string}`>>;
181
+ /**
182
+ * Delete a step
183
+ */
184
+ delete(id: string): Promise<import("openapi-fetch").FetchResponse<{
185
+ parameters: {
186
+ query?: never;
187
+ header?: never;
188
+ path: {
189
+ id: import("../types/academe-api").components["parameters"]["id"];
190
+ };
191
+ cookie?: never;
192
+ };
193
+ requestBody?: never;
194
+ responses: {
195
+ 204: {
196
+ headers: {
197
+ [name: string]: unknown;
198
+ };
199
+ content?: never;
200
+ };
201
+ 400: import("../types/academe-api").components["responses"]["BadRequest"];
202
+ 401: import("../types/academe-api").components["responses"]["Unauthorized"];
203
+ 404: import("../types/academe-api").components["responses"]["NotFound"];
204
+ 500: import("../types/academe-api").components["responses"]["ServerError"];
205
+ };
206
+ }, {
207
+ params: {
208
+ path: {
209
+ id: string;
210
+ };
211
+ };
212
+ }, `${string}/${string}`>>;
213
+ };
214
+ export type StepService = ReturnType<typeof createStepService>;
215
+ export {};
@@ -18,6 +18,8 @@ import { type ProductService } from "./ProductService";
18
18
  import { type CourseService } from './CourseService';
19
19
  import { type CategoryService } from './CategoryService';
20
20
  import { type StorageFileService } from './StorageFileService';
21
+ import { type ChallengeService } from './ChallengeService';
22
+ import { type StepService } from './StepService';
21
23
  export type AcademeApiClient = ReturnType<typeof createClient<paths>>;
22
24
  export declare function createAcademeApiClient(baseUrl: string): AcademeApiClient;
23
25
  export interface AcademeServices {
@@ -39,6 +41,8 @@ export interface AcademeServices {
39
41
  seatCode: SeatCodeService;
40
42
  product: ProductService;
41
43
  storageFile: StorageFileService;
44
+ challenge: ChallengeService;
45
+ step: StepService;
42
46
  }
43
47
  export declare function createAcademeServices(apiClient: AcademeApiClient): AcademeServices;
44
48
  export { createUserService, type UserService } from "./userService";
@@ -58,3 +62,5 @@ export { createProductService, type ProductService } from "./ProductService";
58
62
  export { createCourseService, type CourseService } from './CourseService';
59
63
  export { createCategoryService, type CategoryService } from './CategoryService';
60
64
  export { createStorageFileService, type StorageFileService } from './StorageFileService';
65
+ export { createChallengeService, type ChallengeService } from './ChallengeService';
66
+ export { createStepService, type StepService } from './StepService';