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.
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
  */
@@ -6483,6 +6489,28 @@ declare class PlayTests {
6483
6489
  * @returns Promise
6484
6490
  */
6485
6491
  static mine<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6492
+ /**
6493
+ * Get aggregated results for a play test (publisher view).
6494
+ *
6495
+ * @param title_id The ID of the title.
6496
+ * @param playtest_id The ID of the play test.
6497
+ * @returns Promise
6498
+ */
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>>;
6486
6514
  }
6487
6515
 
6488
6516
  interface SteamCapsuleCropRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.3.1",
3
+ "version": "3.3.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -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;
@@ -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
  /**
@@ -137,6 +137,45 @@ class PlayTests {
137
137
  public static mine<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
138
138
  return Requests.processRoute(PlayTestsRoute.routes.mine, {}, {}, params);
139
139
  }
140
+
141
+ /**
142
+ * Get aggregated results for a play test (publisher view).
143
+ *
144
+ * @param title_id The ID of the title.
145
+ * @param playtest_id The ID of the play test.
146
+ * @returns Promise
147
+ */
148
+ public static getResults<T>(title_id: string, playtest_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
149
+ return Requests.processRoute(PlayTestsRoute.routes.getResults, {}, { title_id, playtest_id }, params);
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
+ }
140
179
  }
141
180
 
142
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;
@@ -15,6 +15,8 @@ class PlayTestsRoute {
15
15
  cancelRequest: { url: '/playtests/{title_id}/cancel/{playtest_id}', method: HTTP_METHODS.POST },
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
+ 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 },
18
20
 
19
21
  };
20
22
  }