glitch-javascript-sdk 3.3.2 → 3.3.5
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 +167 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Agents.d.ts +72 -0
- package/dist/esm/api/Campaigns.d.ts +8 -0
- package/dist/esm/api/Newsletters.d.ts +6 -0
- package/dist/esm/api/PlayTests.d.ts +15 -1
- package/dist/esm/index.js +167 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +100 -0
- package/package.json +1 -1
- package/src/api/Agents.ts +170 -0
- package/src/api/Campaigns.ts +14 -0
- package/src/api/Newsletters.ts +10 -1
- package/src/api/PlayTests.ts +29 -1
- package/src/routes/AgentsRoute.ts +7 -0
- package/src/routes/CampaignsRoute.ts +2 -0
- package/src/routes/NewslettersRoutes.ts +2 -1
- package/src/routes/PlayTestsRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -5200,6 +5200,14 @@ declare class Campaigns {
|
|
|
5200
5200
|
* @returns promise
|
|
5201
5201
|
*/
|
|
5202
5202
|
static sendInfluencerInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5203
|
+
/**
|
|
5204
|
+
* Get creator context used when preparing a personalized invite.
|
|
5205
|
+
*/
|
|
5206
|
+
static creatorInviteContext<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5207
|
+
/**
|
|
5208
|
+
* Send a personalized creator invite after review.
|
|
5209
|
+
*/
|
|
5210
|
+
static sendCreatorInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5203
5211
|
/**
|
|
5204
5212
|
* Invites an influencer to join this campaign.
|
|
5205
5213
|
*
|
|
@@ -6311,6 +6319,12 @@ declare class Newsletters {
|
|
|
6311
6319
|
* @param data { name, email, game }
|
|
6312
6320
|
*/
|
|
6313
6321
|
static joinNsfwWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6322
|
+
/**
|
|
6323
|
+
* Apply for Codex credit support for a playable AI game.
|
|
6324
|
+
*
|
|
6325
|
+
* @param data { name, email, game, game_description, game_url }
|
|
6326
|
+
*/
|
|
6327
|
+
static joinCodexCreditWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6314
6328
|
/**
|
|
6315
6329
|
* List all newsletter campaigns (Admin only).
|
|
6316
6330
|
*/
|
|
@@ -6491,6 +6505,20 @@ declare class PlayTests {
|
|
|
6491
6505
|
* @returns Promise
|
|
6492
6506
|
*/
|
|
6493
6507
|
static getResults<T>(title_id: string, playtest_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6508
|
+
/**
|
|
6509
|
+
* Upload an audio/video answer file for a play test question. The file is
|
|
6510
|
+
* stored by the Glitch backend (authenticated with the session token) and a
|
|
6511
|
+
* media URL is returned that can then be passed to submitAnswers().
|
|
6512
|
+
*
|
|
6513
|
+
* @param title_id The ID of the title.
|
|
6514
|
+
* @param playtest_id The ID of the play test.
|
|
6515
|
+
* @param file The recorded audio/video file or blob.
|
|
6516
|
+
* @param data Additional fields (question_id, media_type, title, description).
|
|
6517
|
+
* @param params Optional query parameters.
|
|
6518
|
+
* @param onUploadProgress Optional progress callback.
|
|
6519
|
+
* @returns Promise
|
|
6520
|
+
*/
|
|
6521
|
+
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
6522
|
}
|
|
6495
6523
|
|
|
6496
6524
|
interface SteamCapsuleCropRequest {
|
|
@@ -9895,7 +9923,20 @@ interface AgentRunRequest {
|
|
|
9895
9923
|
agent_run_id?: string | null;
|
|
9896
9924
|
[key: string]: any;
|
|
9897
9925
|
}
|
|
9926
|
+
interface AgentStreamAnswerRequest {
|
|
9927
|
+
prompt: string;
|
|
9928
|
+
[key: string]: any;
|
|
9929
|
+
}
|
|
9930
|
+
interface AgentFetchOptions {
|
|
9931
|
+
params?: Record<string, any>;
|
|
9932
|
+
signal?: AbortSignal;
|
|
9933
|
+
headers?: Record<string, string>;
|
|
9934
|
+
fetcher?: typeof fetch;
|
|
9935
|
+
}
|
|
9936
|
+
interface AgentStreamAnswerOptions extends AgentFetchOptions {
|
|
9937
|
+
}
|
|
9898
9938
|
declare class Agents {
|
|
9939
|
+
private static fetchWithAuth;
|
|
9899
9940
|
/**
|
|
9900
9941
|
* List game titles that can be managed in the Agents section.
|
|
9901
9942
|
*/
|
|
@@ -9940,6 +9981,15 @@ declare class Agents {
|
|
|
9940
9981
|
* Run an agent planning cycle. Returns 402 when subscription or prepaid credits are required.
|
|
9941
9982
|
*/
|
|
9942
9983
|
static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9984
|
+
/**
|
|
9985
|
+
* Stream a quick advisory answer for the agent workspace.
|
|
9986
|
+
*
|
|
9987
|
+
* This returns the native Fetch API Response so callers can consume the
|
|
9988
|
+
* ReadableStream body incrementally. A 409 response means streaming is
|
|
9989
|
+
* disabled server-side and the caller should fall back to the normal run
|
|
9990
|
+
* flow.
|
|
9991
|
+
*/
|
|
9992
|
+
static streamAnswer(title_id: string, agent_id: string, data: AgentStreamAnswerRequest | string, options?: AgentStreamAnswerOptions): Promise<globalThis.Response>;
|
|
9943
9993
|
/**
|
|
9944
9994
|
* Upload one file for an agent run. data can include { agent_run_id }.
|
|
9945
9995
|
*/
|
|
@@ -9948,6 +9998,25 @@ declare class Agents {
|
|
|
9948
9998
|
* Alias for callers that use plural naming while uploading one file at a time.
|
|
9949
9999
|
*/
|
|
9950
10000
|
static uploadAgentFiles<T>(title_id: string, agent_id: string, file: File | Blob, data?: object, params?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
10001
|
+
/**
|
|
10002
|
+
* List Google Drive files/folders available to attach to a title agent.
|
|
10003
|
+
*/
|
|
10004
|
+
static listGoogleDriveFiles<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10005
|
+
/**
|
|
10006
|
+
* Attach a Google Drive file as a reference file for an agent.
|
|
10007
|
+
*/
|
|
10008
|
+
static attachGoogleDriveFile<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10009
|
+
/**
|
|
10010
|
+
* Download a protected agent file through the authenticated API route.
|
|
10011
|
+
*
|
|
10012
|
+
* Returns the native Fetch API Response so callers can inspect headers such
|
|
10013
|
+
* as Content-Disposition before creating a browser download or preview blob.
|
|
10014
|
+
*/
|
|
10015
|
+
static downloadAgentFile(title_id: string, file_id: string, options?: AgentFetchOptions): Promise<globalThis.Response>;
|
|
10016
|
+
/**
|
|
10017
|
+
* Export a generated agent artifact to Google Drive.
|
|
10018
|
+
*/
|
|
10019
|
+
static exportAgentFileToGoogleDrive<T>(title_id: string, file_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9951
10020
|
/**
|
|
9952
10021
|
* List agent runs for a title.
|
|
9953
10022
|
*/
|
|
@@ -10001,10 +10070,41 @@ declare class Agents {
|
|
|
10001
10070
|
* Rewrite an editable agent draft for review without executing the parent action.
|
|
10002
10071
|
*/
|
|
10003
10072
|
static rewriteAgentDraft<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10073
|
+
/**
|
|
10074
|
+
* Agent workflow convenience wrapper for creator invite context.
|
|
10075
|
+
*/
|
|
10076
|
+
static creatorInviteContext<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10077
|
+
/**
|
|
10078
|
+
* Agent workflow convenience wrapper for sending a reviewed creator invite.
|
|
10079
|
+
*/
|
|
10080
|
+
static sendCreatorInvite<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10081
|
+
/**
|
|
10082
|
+
* Agent workflow convenience wrapper for updating a drafted social post.
|
|
10083
|
+
*/
|
|
10084
|
+
static updateSocialPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10085
|
+
/**
|
|
10086
|
+
* Agent workflow convenience wrapper for updating campaign settings.
|
|
10087
|
+
*/
|
|
10088
|
+
static updateCampaign<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10089
|
+
/**
|
|
10090
|
+
* Agent workflow convenience wrapper for saving manual access keys.
|
|
10091
|
+
*/
|
|
10092
|
+
static createAccessKeys<T>(title_id: string, data: {
|
|
10093
|
+
platform: string;
|
|
10094
|
+
codes: string;
|
|
10095
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10004
10096
|
/**
|
|
10005
10097
|
* List structured agent memories for a title.
|
|
10006
10098
|
*/
|
|
10007
10099
|
static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10100
|
+
/**
|
|
10101
|
+
* Update one structured agent memory.
|
|
10102
|
+
*/
|
|
10103
|
+
static updateMemory<T>(title_id: string, memory_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10104
|
+
/**
|
|
10105
|
+
* Deactivate one structured agent memory.
|
|
10106
|
+
*/
|
|
10107
|
+
static deactivateMemory<T>(title_id: string, memory_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10008
10108
|
/**
|
|
10009
10109
|
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
10010
10110
|
*/
|
package/package.json
CHANGED
package/src/api/Agents.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import AgentsRoute from "../routes/AgentsRoute";
|
|
2
|
+
import AccessKeys from "./AccessKeys";
|
|
3
|
+
import Campaigns from "./Campaigns";
|
|
4
|
+
import Config from "../config/Config";
|
|
2
5
|
import Requests from "../util/Requests";
|
|
3
6
|
import Response from "../util/Response";
|
|
7
|
+
import SocialPosts from "./SocialPosts";
|
|
4
8
|
import { AxiosPromise, AxiosProgressEvent } from "axios";
|
|
5
9
|
|
|
6
10
|
export interface AgentRunRequest {
|
|
@@ -15,7 +19,51 @@ export interface AgentRunRequest {
|
|
|
15
19
|
[key: string]: any;
|
|
16
20
|
}
|
|
17
21
|
|
|
22
|
+
export interface AgentStreamAnswerRequest {
|
|
23
|
+
prompt: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface AgentFetchOptions {
|
|
28
|
+
params?: Record<string, any>;
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
fetcher?: typeof fetch;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface AgentStreamAnswerOptions extends AgentFetchOptions {}
|
|
35
|
+
|
|
18
36
|
class Agents {
|
|
37
|
+
private static fetchWithAuth(
|
|
38
|
+
path: string,
|
|
39
|
+
init: RequestInit,
|
|
40
|
+
options: AgentFetchOptions = {}
|
|
41
|
+
): Promise<globalThis.Response> {
|
|
42
|
+
const url = Requests.buildUrl(path, options.params);
|
|
43
|
+
const token = Config.getAuthToken?.();
|
|
44
|
+
const headers: Record<string, string> = {
|
|
45
|
+
...((init.headers || {}) as Record<string, string>),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (token && !headers.Authorization) {
|
|
49
|
+
headers.Authorization = `Bearer ${token}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Object.assign(headers, options.headers || {});
|
|
53
|
+
|
|
54
|
+
const fetcher = options.fetcher || (typeof globalThis !== "undefined" ? globalThis.fetch : undefined);
|
|
55
|
+
|
|
56
|
+
if (!fetcher) {
|
|
57
|
+
return Promise.reject(new Error("Fetch API is not available in this environment."));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return fetcher(url, {
|
|
61
|
+
...init,
|
|
62
|
+
headers,
|
|
63
|
+
signal: options.signal,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
19
67
|
/**
|
|
20
68
|
* List game titles that can be managed in the Agents section.
|
|
21
69
|
*/
|
|
@@ -93,6 +141,35 @@ class Agents {
|
|
|
93
141
|
return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id, agent_id }, params);
|
|
94
142
|
}
|
|
95
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Stream a quick advisory answer for the agent workspace.
|
|
146
|
+
*
|
|
147
|
+
* This returns the native Fetch API Response so callers can consume the
|
|
148
|
+
* ReadableStream body incrementally. A 409 response means streaming is
|
|
149
|
+
* disabled server-side and the caller should fall back to the normal run
|
|
150
|
+
* flow.
|
|
151
|
+
*/
|
|
152
|
+
public static streamAnswer(
|
|
153
|
+
title_id: string,
|
|
154
|
+
agent_id: string,
|
|
155
|
+
data: AgentStreamAnswerRequest | string,
|
|
156
|
+
options: AgentStreamAnswerOptions = {}
|
|
157
|
+
): Promise<globalThis.Response> {
|
|
158
|
+
const body = typeof data === "string" ? { prompt: data } : data;
|
|
159
|
+
const path = AgentsRoute.routes.streamAnswer.url
|
|
160
|
+
.replace("{title_id}", title_id)
|
|
161
|
+
.replace("{agent_id}", agent_id);
|
|
162
|
+
|
|
163
|
+
return Agents.fetchWithAuth(path, {
|
|
164
|
+
method: AgentsRoute.routes.streamAnswer.method,
|
|
165
|
+
headers: {
|
|
166
|
+
"Content-Type": "application/json",
|
|
167
|
+
Accept: "text/event-stream",
|
|
168
|
+
},
|
|
169
|
+
body: JSON.stringify(body),
|
|
170
|
+
}, options);
|
|
171
|
+
}
|
|
172
|
+
|
|
96
173
|
/**
|
|
97
174
|
* Upload one file for an agent run. data can include { agent_run_id }.
|
|
98
175
|
*/
|
|
@@ -125,6 +202,50 @@ class Agents {
|
|
|
125
202
|
return Agents.uploadAgentFile(title_id, agent_id, file, data, params, onUploadProgress);
|
|
126
203
|
}
|
|
127
204
|
|
|
205
|
+
/**
|
|
206
|
+
* List Google Drive files/folders available to attach to a title agent.
|
|
207
|
+
*/
|
|
208
|
+
public static listGoogleDriveFiles<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
209
|
+
return Requests.processRoute(AgentsRoute.routes.listGoogleDriveFiles, {}, { title_id }, params);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Attach a Google Drive file as a reference file for an agent.
|
|
214
|
+
*/
|
|
215
|
+
public static attachGoogleDriveFile<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
216
|
+
return Requests.processRoute(AgentsRoute.routes.attachGoogleDriveFile, data || {}, { title_id, agent_id }, params);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Download a protected agent file through the authenticated API route.
|
|
221
|
+
*
|
|
222
|
+
* Returns the native Fetch API Response so callers can inspect headers such
|
|
223
|
+
* as Content-Disposition before creating a browser download or preview blob.
|
|
224
|
+
*/
|
|
225
|
+
public static downloadAgentFile(
|
|
226
|
+
title_id: string,
|
|
227
|
+
file_id: string,
|
|
228
|
+
options: AgentFetchOptions = {}
|
|
229
|
+
): Promise<globalThis.Response> {
|
|
230
|
+
const path = AgentsRoute.routes.downloadAgentFile.url
|
|
231
|
+
.replace("{title_id}", title_id)
|
|
232
|
+
.replace("{file_id}", file_id);
|
|
233
|
+
|
|
234
|
+
return Agents.fetchWithAuth(path, {
|
|
235
|
+
method: AgentsRoute.routes.downloadAgentFile.method,
|
|
236
|
+
headers: {
|
|
237
|
+
Accept: "application/octet-stream",
|
|
238
|
+
},
|
|
239
|
+
}, options);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Export a generated agent artifact to Google Drive.
|
|
244
|
+
*/
|
|
245
|
+
public static exportAgentFileToGoogleDrive<T>(title_id: string, file_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
246
|
+
return Requests.processRoute(AgentsRoute.routes.exportAgentFileToGoogleDrive, data || {}, { title_id, file_id }, params);
|
|
247
|
+
}
|
|
248
|
+
|
|
128
249
|
/**
|
|
129
250
|
* List agent runs for a title.
|
|
130
251
|
*/
|
|
@@ -217,6 +338,41 @@ class Agents {
|
|
|
217
338
|
return Requests.processRoute(AgentsRoute.routes.rewriteAgentDraft, data, { title_id }, params);
|
|
218
339
|
}
|
|
219
340
|
|
|
341
|
+
/**
|
|
342
|
+
* Agent workflow convenience wrapper for creator invite context.
|
|
343
|
+
*/
|
|
344
|
+
public static creatorInviteContext<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
345
|
+
return Campaigns.creatorInviteContext<T>(campaign_id, params);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Agent workflow convenience wrapper for sending a reviewed creator invite.
|
|
350
|
+
*/
|
|
351
|
+
public static sendCreatorInvite<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
352
|
+
return Campaigns.sendCreatorInvite<T>(campaign_id, data || {}, params);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Agent workflow convenience wrapper for updating a drafted social post.
|
|
357
|
+
*/
|
|
358
|
+
public static updateSocialPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
359
|
+
return SocialPosts.update<T>(post_id, data || {}, params);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Agent workflow convenience wrapper for updating campaign settings.
|
|
364
|
+
*/
|
|
365
|
+
public static updateCampaign<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
366
|
+
return Campaigns.update<T>(campaign_id, data || {}, params);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Agent workflow convenience wrapper for saving manual access keys.
|
|
371
|
+
*/
|
|
372
|
+
public static createAccessKeys<T>(title_id: string, data: { platform: string, codes: string }, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
373
|
+
return AccessKeys.store<T>(title_id, data, params);
|
|
374
|
+
}
|
|
375
|
+
|
|
220
376
|
/**
|
|
221
377
|
* List structured agent memories for a title.
|
|
222
378
|
*/
|
|
@@ -224,6 +380,20 @@ class Agents {
|
|
|
224
380
|
return Requests.processRoute(AgentsRoute.routes.listMemories, {}, { title_id }, params);
|
|
225
381
|
}
|
|
226
382
|
|
|
383
|
+
/**
|
|
384
|
+
* Update one structured agent memory.
|
|
385
|
+
*/
|
|
386
|
+
public static updateMemory<T>(title_id: string, memory_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
387
|
+
return Requests.processRoute(AgentsRoute.routes.updateMemory, data || {}, { title_id, memory_id }, params);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Deactivate one structured agent memory.
|
|
392
|
+
*/
|
|
393
|
+
public static deactivateMemory<T>(title_id: string, memory_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
394
|
+
return Requests.processRoute(AgentsRoute.routes.deactivateMemory, {}, { title_id, memory_id }, params);
|
|
395
|
+
}
|
|
396
|
+
|
|
227
397
|
/**
|
|
228
398
|
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
229
399
|
*/
|
package/src/api/Campaigns.ts
CHANGED
|
@@ -560,6 +560,20 @@ class Campaigns {
|
|
|
560
560
|
return Requests.processRoute(CampaignsRoute.routes.sendInfluencerInvite, data, { campaign_id: campaign_id }, params);
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Get creator context used when preparing a personalized invite.
|
|
565
|
+
*/
|
|
566
|
+
public static creatorInviteContext<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
567
|
+
return Requests.processRoute(CampaignsRoute.routes.influencerInviteProfileContext, {}, { campaign_id: campaign_id }, params);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Send a personalized creator invite after review.
|
|
572
|
+
*/
|
|
573
|
+
public static sendCreatorInvite<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
574
|
+
return Requests.processRoute(CampaignsRoute.routes.influencerInviteProfileSend, data, { campaign_id: campaign_id }, params);
|
|
575
|
+
}
|
|
576
|
+
|
|
563
577
|
/**
|
|
564
578
|
* Invites an influencer to join this campaign.
|
|
565
579
|
*
|
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;
|
|
@@ -14,7 +14,12 @@ class AgentsRoute {
|
|
|
14
14
|
updateAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.PUT },
|
|
15
15
|
deleteAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.DELETE },
|
|
16
16
|
runAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}/run", method: HTTP_METHODS.POST },
|
|
17
|
+
streamAnswer: { url: "/agents/titles/{title_id}/agents/{agent_id}/stream-answer", method: HTTP_METHODS.POST },
|
|
17
18
|
uploadAgentFiles: { url: "/agents/titles/{title_id}/agents/{agent_id}/files", method: HTTP_METHODS.POST },
|
|
19
|
+
listGoogleDriveFiles: { url: "/agents/titles/{title_id}/gmail/drive/files", method: HTTP_METHODS.GET },
|
|
20
|
+
attachGoogleDriveFile: { url: "/agents/titles/{title_id}/agents/{agent_id}/drive/files", method: HTTP_METHODS.POST },
|
|
21
|
+
downloadAgentFile: { url: "/agents/titles/{title_id}/files/{file_id}/download", method: HTTP_METHODS.GET },
|
|
22
|
+
exportAgentFileToGoogleDrive: { url: "/agents/titles/{title_id}/files/{file_id}/export/google-drive", method: HTTP_METHODS.POST },
|
|
18
23
|
listRuns: { url: "/agents/titles/{title_id}/runs", method: HTTP_METHODS.GET },
|
|
19
24
|
viewRun: { url: "/agents/titles/{title_id}/runs/{run_id}", method: HTTP_METHODS.GET },
|
|
20
25
|
listRunEvents: { url: "/agents/titles/{title_id}/runs/{run_id}/events", method: HTTP_METHODS.GET },
|
|
@@ -29,6 +34,8 @@ class AgentsRoute {
|
|
|
29
34
|
answerGuidance: { url: "/agents/titles/{title_id}/guidance/{guidance_id}/answer", method: HTTP_METHODS.POST },
|
|
30
35
|
rewriteAgentDraft: { url: "/agents/titles/{title_id}/drafts/rewrite", method: HTTP_METHODS.POST },
|
|
31
36
|
listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
|
|
37
|
+
updateMemory: { url: "/agents/titles/{title_id}/memories/{memory_id}", method: HTTP_METHODS.PATCH },
|
|
38
|
+
deactivateMemory: { url: "/agents/titles/{title_id}/memories/{memory_id}", method: HTTP_METHODS.DELETE },
|
|
32
39
|
results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
|
|
33
40
|
usage: { url: "/agents/titles/{title_id}/usage", method: HTTP_METHODS.GET },
|
|
34
41
|
credits: { url: "/agents/titles/{title_id}/credits", method: HTTP_METHODS.GET },
|
|
@@ -45,6 +45,8 @@ class CampaignsRoute {
|
|
|
45
45
|
addType: { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
|
|
46
46
|
removeType: { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
47
47
|
inviteInfluencer: { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
48
|
+
influencerInviteProfileContext: { url: '/campaigns/{campaign_id}/influencers/invites/profile-context', method: HTTP_METHODS.GET },
|
|
49
|
+
influencerInviteProfileSend: { url: '/campaigns/{campaign_id}/influencers/invites/profile-send', method: HTTP_METHODS.POST },
|
|
48
50
|
viewInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.GET },
|
|
49
51
|
updateInfluencerInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.PUT },
|
|
50
52
|
updateInfluencerCompensationInvite: { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/compensation', method: HTTP_METHODS.PUT },
|
|
@@ -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
|
}
|