glitch-javascript-sdk 3.3.1 → 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.
@@ -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.
@@ -99,5 +99,27 @@ declare class PlayTests {
99
99
  * @returns Promise
100
100
  */
101
101
  static mine<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
102
+ /**
103
+ * Get aggregated results for a play test (publisher view).
104
+ *
105
+ * @param title_id The ID of the title.
106
+ * @param playtest_id The ID of the play test.
107
+ * @returns Promise
108
+ */
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>>;
102
124
  }
103
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).
@@ -15476,6 +15485,8 @@ var PlayTestsRoute = /** @class */ (function () {
15476
15485
  cancelRequest: { url: '/playtests/{title_id}/cancel/{playtest_id}', method: HTTP_METHODS.POST },
15477
15486
  show: { url: '/playtests/{title_id}/view/{playtest_id}', method: HTTP_METHODS.GET },
15478
15487
  mine: { url: '/playtests/mine', method: HTTP_METHODS.GET },
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 },
15479
15490
  };
15480
15491
  return PlayTestsRoute;
15481
15492
  }());
@@ -15605,6 +15616,35 @@ var PlayTests = /** @class */ (function () {
15605
15616
  PlayTests.mine = function (params) {
15606
15617
  return Requests.processRoute(PlayTestsRoute.routes.mine, {}, {}, params);
15607
15618
  };
15619
+ /**
15620
+ * Get aggregated results for a play test (publisher view).
15621
+ *
15622
+ * @param title_id The ID of the title.
15623
+ * @param playtest_id The ID of the play test.
15624
+ * @returns Promise
15625
+ */
15626
+ PlayTests.getResults = function (title_id, playtest_id, params) {
15627
+ return Requests.processRoute(PlayTestsRoute.routes.getResults, {}, { title_id: title_id, playtest_id: playtest_id }, params);
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
+ };
15608
15648
  return PlayTests;
15609
15649
  }());
15610
15650