glitch-javascript-sdk 3.3.2 → 3.3.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.
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Newsletters.d.ts +6 -0
- package/dist/esm/api/PlayTests.d.ts +15 -1
- package/dist/esm/index.js +29 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +20 -0
- package/package.json +1 -1
- package/src/api/Newsletters.ts +10 -1
- package/src/api/PlayTests.ts +29 -1
- package/src/routes/NewslettersRoutes.ts +2 -1
- package/src/routes/PlayTestsRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -6311,6 +6311,12 @@ declare class Newsletters {
|
|
|
6311
6311
|
* @param data { name, email, game }
|
|
6312
6312
|
*/
|
|
6313
6313
|
static joinNsfwWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6314
|
+
/**
|
|
6315
|
+
* Apply for Codex credit support for a playable AI game.
|
|
6316
|
+
*
|
|
6317
|
+
* @param data { name, email, game, game_description, game_url }
|
|
6318
|
+
*/
|
|
6319
|
+
static joinCodexCreditWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6314
6320
|
/**
|
|
6315
6321
|
* List all newsletter campaigns (Admin only).
|
|
6316
6322
|
*/
|
|
@@ -6491,6 +6497,20 @@ declare class PlayTests {
|
|
|
6491
6497
|
* @returns Promise
|
|
6492
6498
|
*/
|
|
6493
6499
|
static getResults<T>(title_id: string, playtest_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6500
|
+
/**
|
|
6501
|
+
* Upload an audio/video answer file for a play test question. The file is
|
|
6502
|
+
* stored by the Glitch backend (authenticated with the session token) and a
|
|
6503
|
+
* media URL is returned that can then be passed to submitAnswers().
|
|
6504
|
+
*
|
|
6505
|
+
* @param title_id The ID of the title.
|
|
6506
|
+
* @param playtest_id The ID of the play test.
|
|
6507
|
+
* @param file The recorded audio/video file or blob.
|
|
6508
|
+
* @param data Additional fields (question_id, media_type, title, description).
|
|
6509
|
+
* @param params Optional query parameters.
|
|
6510
|
+
* @param onUploadProgress Optional progress callback.
|
|
6511
|
+
* @returns Promise
|
|
6512
|
+
*/
|
|
6513
|
+
static uploadAnswer<T>(title_id: string, playtest_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
6494
6514
|
}
|
|
6495
6515
|
|
|
6496
6516
|
interface SteamCapsuleCropRequest {
|
package/package.json
CHANGED
package/src/api/Newsletters.ts
CHANGED
|
@@ -58,6 +58,15 @@ class Newsletters {
|
|
|
58
58
|
return Requests.processRoute(NewslettersRoutes.routes.joinNsfwWaitlist, data, undefined, params);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Apply for Codex credit support for a playable AI game.
|
|
63
|
+
*
|
|
64
|
+
* @param data { name, email, game, game_description, game_url }
|
|
65
|
+
*/
|
|
66
|
+
public static joinCodexCreditWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
67
|
+
return Requests.processRoute(NewslettersRoutes.routes.joinCodexCreditWaitlist, data, undefined, params);
|
|
68
|
+
}
|
|
69
|
+
|
|
61
70
|
// --- ADMINISTRATIVE CAMPAIGN METHODS ---
|
|
62
71
|
|
|
63
72
|
/**
|
|
@@ -184,4 +193,4 @@ class Newsletters {
|
|
|
184
193
|
|
|
185
194
|
}
|
|
186
195
|
|
|
187
|
-
export default Newsletters;
|
|
196
|
+
export default Newsletters;
|
package/src/api/PlayTests.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PlayTestsRoute from "../routes/PlayTestsRoute";
|
|
2
2
|
import Requests from "../util/Requests";
|
|
3
3
|
import Response from "../util/Response";
|
|
4
|
-
import { AxiosPromise } from "axios";
|
|
4
|
+
import { AxiosPromise, AxiosProgressEvent } from "axios";
|
|
5
5
|
|
|
6
6
|
class PlayTests {
|
|
7
7
|
/**
|
|
@@ -148,6 +148,34 @@ class PlayTests {
|
|
|
148
148
|
public static getResults<T>(title_id: string, playtest_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
149
149
|
return Requests.processRoute(PlayTestsRoute.routes.getResults, {}, { title_id, playtest_id }, params);
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Upload an audio/video answer file for a play test question. The file is
|
|
154
|
+
* stored by the Glitch backend (authenticated with the session token) and a
|
|
155
|
+
* media URL is returned that can then be passed to submitAnswers().
|
|
156
|
+
*
|
|
157
|
+
* @param title_id The ID of the title.
|
|
158
|
+
* @param playtest_id The ID of the play test.
|
|
159
|
+
* @param file The recorded audio/video file or blob.
|
|
160
|
+
* @param data Additional fields (question_id, media_type, title, description).
|
|
161
|
+
* @param params Optional query parameters.
|
|
162
|
+
* @param onUploadProgress Optional progress callback.
|
|
163
|
+
* @returns Promise
|
|
164
|
+
*/
|
|
165
|
+
public static uploadAnswer<T>(
|
|
166
|
+
title_id: string,
|
|
167
|
+
playtest_id: string,
|
|
168
|
+
file: File | Blob,
|
|
169
|
+
data?: Record<string, any>,
|
|
170
|
+
params?: Record<string, any>,
|
|
171
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
172
|
+
): AxiosPromise<Response<T>> {
|
|
173
|
+
const url = PlayTestsRoute.routes.uploadAnswer.url
|
|
174
|
+
.replace('{title_id}', title_id)
|
|
175
|
+
.replace('{playtest_id}', playtest_id);
|
|
176
|
+
|
|
177
|
+
return Requests.uploadFile(url, 'file', file, data, params, onUploadProgress);
|
|
178
|
+
}
|
|
151
179
|
}
|
|
152
180
|
|
|
153
181
|
export default PlayTests;
|
|
@@ -9,6 +9,7 @@ class NewslettersRoutes {
|
|
|
9
9
|
joinRaffleWaitlist: { url: '/newsletters/joinRaffleWaitlist', method: HTTP_METHODS.POST },
|
|
10
10
|
joinDiscordMarketplaceWaitlist: { url: '/newsletters/joinDiscordMarketplaceWaitlist', method: HTTP_METHODS.POST },
|
|
11
11
|
joinNsfwWaitlist: { url: '/newsletters/joinNsfwWaitlist', method: HTTP_METHODS.POST },
|
|
12
|
+
joinCodexCreditWaitlist: { url: '/newsletters/joinCodexCreditWaitlist', method: HTTP_METHODS.POST },
|
|
12
13
|
|
|
13
14
|
// --- Admin Campaign Management ---
|
|
14
15
|
listCampaigns: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.GET },
|
|
@@ -36,4 +37,4 @@ class NewslettersRoutes {
|
|
|
36
37
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export default NewslettersRoutes;
|
|
40
|
+
export default NewslettersRoutes;
|
|
@@ -16,6 +16,7 @@ class PlayTestsRoute {
|
|
|
16
16
|
show: { url: '/playtests/{title_id}/view/{playtest_id}', method: HTTP_METHODS.GET },
|
|
17
17
|
mine: { url: '/playtests/mine', method: HTTP_METHODS.GET },
|
|
18
18
|
getResults: { url: '/playtests/{title_id}/{playtest_id}/results', method: HTTP_METHODS.GET },
|
|
19
|
+
uploadAnswer: { url: '/playtests/{title_id}/{playtest_id}/upload-answer', method: HTTP_METHODS.POST },
|
|
19
20
|
|
|
20
21
|
};
|
|
21
22
|
}
|