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
|
@@ -36,6 +36,12 @@ declare class Newsletters {
|
|
|
36
36
|
* @param data { name, email, game }
|
|
37
37
|
*/
|
|
38
38
|
static joinNsfwWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Apply for Codex credit support for a playable AI game.
|
|
41
|
+
*
|
|
42
|
+
* @param data { name, email, game, game_description, game_url }
|
|
43
|
+
*/
|
|
44
|
+
static joinCodexCreditWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
39
45
|
/**
|
|
40
46
|
* List all newsletter campaigns (Admin only).
|
|
41
47
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Response from "../util/Response";
|
|
2
|
-
import { AxiosPromise } from "axios";
|
|
2
|
+
import { AxiosPromise, AxiosProgressEvent } from "axios";
|
|
3
3
|
declare class PlayTests {
|
|
4
4
|
/**
|
|
5
5
|
* Get a list of play tests associated with a title.
|
|
@@ -107,5 +107,19 @@ declare class PlayTests {
|
|
|
107
107
|
* @returns Promise
|
|
108
108
|
*/
|
|
109
109
|
static getResults<T>(title_id: string, playtest_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
110
|
+
/**
|
|
111
|
+
* Upload an audio/video answer file for a play test question. The file is
|
|
112
|
+
* stored by the Glitch backend (authenticated with the session token) and a
|
|
113
|
+
* media URL is returned that can then be passed to submitAnswers().
|
|
114
|
+
*
|
|
115
|
+
* @param title_id The ID of the title.
|
|
116
|
+
* @param playtest_id The ID of the play test.
|
|
117
|
+
* @param file The recorded audio/video file or blob.
|
|
118
|
+
* @param data Additional fields (question_id, media_type, title, description).
|
|
119
|
+
* @param params Optional query parameters.
|
|
120
|
+
* @param onUploadProgress Optional progress callback.
|
|
121
|
+
* @returns Promise
|
|
122
|
+
*/
|
|
123
|
+
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>>;
|
|
110
124
|
}
|
|
111
125
|
export default PlayTests;
|
package/dist/esm/index.js
CHANGED
|
@@ -15281,6 +15281,7 @@ var NewslettersRoutes = /** @class */ (function () {
|
|
|
15281
15281
|
joinRaffleWaitlist: { url: '/newsletters/joinRaffleWaitlist', method: HTTP_METHODS.POST },
|
|
15282
15282
|
joinDiscordMarketplaceWaitlist: { url: '/newsletters/joinDiscordMarketplaceWaitlist', method: HTTP_METHODS.POST },
|
|
15283
15283
|
joinNsfwWaitlist: { url: '/newsletters/joinNsfwWaitlist', method: HTTP_METHODS.POST },
|
|
15284
|
+
joinCodexCreditWaitlist: { url: '/newsletters/joinCodexCreditWaitlist', method: HTTP_METHODS.POST },
|
|
15284
15285
|
// --- Admin Campaign Management ---
|
|
15285
15286
|
listCampaigns: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.GET },
|
|
15286
15287
|
createCampaign: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.POST },
|
|
@@ -15352,6 +15353,14 @@ var Newsletters = /** @class */ (function () {
|
|
|
15352
15353
|
Newsletters.joinNsfwWaitlist = function (data, params) {
|
|
15353
15354
|
return Requests.processRoute(NewslettersRoutes.routes.joinNsfwWaitlist, data, undefined, params);
|
|
15354
15355
|
};
|
|
15356
|
+
/**
|
|
15357
|
+
* Apply for Codex credit support for a playable AI game.
|
|
15358
|
+
*
|
|
15359
|
+
* @param data { name, email, game, game_description, game_url }
|
|
15360
|
+
*/
|
|
15361
|
+
Newsletters.joinCodexCreditWaitlist = function (data, params) {
|
|
15362
|
+
return Requests.processRoute(NewslettersRoutes.routes.joinCodexCreditWaitlist, data, undefined, params);
|
|
15363
|
+
};
|
|
15355
15364
|
// --- ADMINISTRATIVE CAMPAIGN METHODS ---
|
|
15356
15365
|
/**
|
|
15357
15366
|
* List all newsletter campaigns (Admin only).
|
|
@@ -15477,6 +15486,7 @@ var PlayTestsRoute = /** @class */ (function () {
|
|
|
15477
15486
|
show: { url: '/playtests/{title_id}/view/{playtest_id}', method: HTTP_METHODS.GET },
|
|
15478
15487
|
mine: { url: '/playtests/mine', method: HTTP_METHODS.GET },
|
|
15479
15488
|
getResults: { url: '/playtests/{title_id}/{playtest_id}/results', method: HTTP_METHODS.GET },
|
|
15489
|
+
uploadAnswer: { url: '/playtests/{title_id}/{playtest_id}/upload-answer', method: HTTP_METHODS.POST },
|
|
15480
15490
|
};
|
|
15481
15491
|
return PlayTestsRoute;
|
|
15482
15492
|
}());
|
|
@@ -15616,6 +15626,25 @@ var PlayTests = /** @class */ (function () {
|
|
|
15616
15626
|
PlayTests.getResults = function (title_id, playtest_id, params) {
|
|
15617
15627
|
return Requests.processRoute(PlayTestsRoute.routes.getResults, {}, { title_id: title_id, playtest_id: playtest_id }, params);
|
|
15618
15628
|
};
|
|
15629
|
+
/**
|
|
15630
|
+
* Upload an audio/video answer file for a play test question. The file is
|
|
15631
|
+
* stored by the Glitch backend (authenticated with the session token) and a
|
|
15632
|
+
* media URL is returned that can then be passed to submitAnswers().
|
|
15633
|
+
*
|
|
15634
|
+
* @param title_id The ID of the title.
|
|
15635
|
+
* @param playtest_id The ID of the play test.
|
|
15636
|
+
* @param file The recorded audio/video file or blob.
|
|
15637
|
+
* @param data Additional fields (question_id, media_type, title, description).
|
|
15638
|
+
* @param params Optional query parameters.
|
|
15639
|
+
* @param onUploadProgress Optional progress callback.
|
|
15640
|
+
* @returns Promise
|
|
15641
|
+
*/
|
|
15642
|
+
PlayTests.uploadAnswer = function (title_id, playtest_id, file, data, params, onUploadProgress) {
|
|
15643
|
+
var url = PlayTestsRoute.routes.uploadAnswer.url
|
|
15644
|
+
.replace('{title_id}', title_id)
|
|
15645
|
+
.replace('{playtest_id}', playtest_id);
|
|
15646
|
+
return Requests.uploadFile(url, 'file', file, data, params, onUploadProgress);
|
|
15647
|
+
};
|
|
15619
15648
|
return PlayTests;
|
|
15620
15649
|
}());
|
|
15621
15650
|
|