glitch-javascript-sdk 2.5.7 → 2.5.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.
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Education.d.ts +9 -0
- package/dist/esm/index.js +28 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/package.json +1 -1
- package/src/api/Education.ts +30 -0
- package/src/routes/EducationRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -7163,11 +7163,20 @@ declare class Education {
|
|
|
7163
7163
|
static submitQuiz<T>(uuid: string, answers: object): AxiosPromise<Response<T>>;
|
|
7164
7164
|
static myQuizAttempts<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7165
7165
|
static viewQuizAttempt<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7166
|
+
static createQuiz<T>(data: object): AxiosPromise<Response<T>>;
|
|
7167
|
+
static updateQuiz<T>(uuid: string, data: object): AxiosPromise<Response<T>>;
|
|
7168
|
+
static deleteQuiz<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7166
7169
|
static listQuizQuestions<T>(quiz_id: string): AxiosPromise<Response<T>>;
|
|
7167
7170
|
static createQuizQuestion<T>(quiz_id: string, data: object): AxiosPromise<Response<T>>;
|
|
7168
7171
|
static reorderQuizQuestions<T>(quiz_id: string, question_ids: string[]): AxiosPromise<Response<T>>;
|
|
7169
7172
|
static listQuizOptions<T>(question_id: string): AxiosPromise<Response<T>>;
|
|
7170
7173
|
static createQuizOption<T>(question_id: string, data: object): AxiosPromise<Response<T>>;
|
|
7174
|
+
static viewQuizQuestion<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7175
|
+
static updateQuizQuestion<T>(uuid: string, data: object): AxiosPromise<Response<T>>;
|
|
7176
|
+
static deleteQuizQuestion<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7177
|
+
static viewQuizOption<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7178
|
+
static updateQuizOption<T>(uuid: string, data: object): AxiosPromise<Response<T>>;
|
|
7179
|
+
static deleteQuizOption<T>(uuid: string): AxiosPromise<Response<T>>;
|
|
7171
7180
|
static syncProgress<T>(data: object): AxiosPromise<Response<T>>;
|
|
7172
7181
|
static getMyProgressByContent<T>(content_id: string): AxiosPromise<Response<T>>;
|
|
7173
7182
|
static listRegistrations<T>(params?: object): AxiosPromise<Response<T>>;
|
package/package.json
CHANGED
package/src/api/Education.ts
CHANGED
|
@@ -100,6 +100,15 @@ class Education {
|
|
|
100
100
|
public static viewQuizAttempt<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
101
101
|
return Requests.processRoute(EducationRoute.routes.viewQuizAttempt, undefined, { uuid });
|
|
102
102
|
}
|
|
103
|
+
public static createQuiz<T>(data: object): AxiosPromise<Response<T>> {
|
|
104
|
+
return Requests.processRoute(EducationRoute.routes.createQuiz, data);
|
|
105
|
+
}
|
|
106
|
+
public static updateQuiz<T>(uuid: string, data: object): AxiosPromise<Response<T>> {
|
|
107
|
+
return Requests.processRoute(EducationRoute.routes.updateQuiz, data, { uuid });
|
|
108
|
+
}
|
|
109
|
+
public static deleteQuiz<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
110
|
+
return Requests.processRoute(EducationRoute.routes.deleteQuiz, undefined, { uuid });
|
|
111
|
+
}
|
|
103
112
|
|
|
104
113
|
// --- 6. QUIZ QUESTIONS & OPTIONS ---
|
|
105
114
|
public static listQuizQuestions<T>(quiz_id: string): AxiosPromise<Response<T>> {
|
|
@@ -117,6 +126,27 @@ class Education {
|
|
|
117
126
|
public static createQuizOption<T>(question_id: string, data: object): AxiosPromise<Response<T>> {
|
|
118
127
|
return Requests.processRoute(EducationRoute.routes.createQuizOption, data, { question_id });
|
|
119
128
|
}
|
|
129
|
+
public static viewQuizQuestion<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
130
|
+
return Requests.processRoute(EducationRoute.routes.viewQuizQuestion, undefined, { uuid });
|
|
131
|
+
}
|
|
132
|
+
public static updateQuizQuestion<T>(uuid: string, data: object): AxiosPromise<Response<T>> {
|
|
133
|
+
return Requests.processRoute(EducationRoute.routes.updateQuizQuestion, data, { uuid });
|
|
134
|
+
}
|
|
135
|
+
public static deleteQuizQuestion<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
136
|
+
return Requests.processRoute(EducationRoute.routes.deleteQuizQuestion, undefined, { uuid });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// --- QUIZ OPTIONS (CRUD) ---
|
|
140
|
+
public static viewQuizOption<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
141
|
+
return Requests.processRoute(EducationRoute.routes.viewQuizOption, undefined, { uuid });
|
|
142
|
+
}
|
|
143
|
+
public static updateQuizOption<T>(uuid: string, data: object): AxiosPromise<Response<T>> {
|
|
144
|
+
return Requests.processRoute(EducationRoute.routes.updateQuizOption, data, { uuid });
|
|
145
|
+
}
|
|
146
|
+
public static deleteQuizOption<T>(uuid: string): AxiosPromise<Response<T>> {
|
|
147
|
+
return Requests.processRoute(EducationRoute.routes.deleteQuizOption, undefined, { uuid });
|
|
148
|
+
}
|
|
149
|
+
|
|
120
150
|
|
|
121
151
|
// --- 7. PROGRESS & REGISTRATIONS ---
|
|
122
152
|
public static syncProgress<T>(data: object): AxiosPromise<Response<T>> {
|
|
@@ -137,6 +137,7 @@ class EducationRoute {
|
|
|
137
137
|
updateBadge: { url: '/badges/{uuid}', method: HTTP_METHODS.PUT },
|
|
138
138
|
revokeBadge: { url: '/badges/{uuid}', method: HTTP_METHODS.DELETE },
|
|
139
139
|
listUserBadges: { url: '/users/{user_id}/badges', method: HTTP_METHODS.GET },
|
|
140
|
+
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
143
|
|