glitch-javascript-sdk 3.1.5 → 3.2.0
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 +233 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Agents.d.ts +81 -0
- package/dist/esm/api/RedditSubreddits.d.ts +35 -0
- package/dist/esm/api/Scheduler.d.ts +17 -1
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +233 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/AgentsRoute.d.ts +7 -0
- package/dist/esm/routes/RedditSubredditsRoute.d.ts +7 -0
- package/dist/index.d.ts +131 -1
- package/package.json +4 -1
- package/src/api/Agents.ts +141 -0
- package/src/api/RedditSubreddits.ts +53 -0
- package/src/api/Scheduler.ts +23 -1
- package/src/api/index.ts +4 -0
- package/src/index.ts +4 -0
- package/src/routes/AgentsRoute.ts +28 -0
- package/src/routes/RedditSubredditsRoute.ts +14 -0
- package/src/routes/SchedulerRoute.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -7066,7 +7066,7 @@ declare class Scheduler {
|
|
|
7066
7066
|
*/
|
|
7067
7067
|
static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7068
7068
|
/**
|
|
7069
|
-
* Get
|
|
7069
|
+
* Get subreddit recommendations for a scheduler.
|
|
7070
7070
|
*
|
|
7071
7071
|
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
7072
7072
|
*
|
|
@@ -7085,6 +7085,22 @@ declare class Scheduler {
|
|
|
7085
7085
|
* @returns promise
|
|
7086
7086
|
*/
|
|
7087
7087
|
static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7088
|
+
/**
|
|
7089
|
+
* Match the scheduler title to indexed Reddit communities.
|
|
7090
|
+
*
|
|
7091
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
7092
|
+
* @param data Optional post context and filters.
|
|
7093
|
+
* @returns promise
|
|
7094
|
+
*/
|
|
7095
|
+
static getRedditSubredditMatches<T>(scheduler_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7096
|
+
/**
|
|
7097
|
+
* Position a registered game for a subreddit and optionally prepare Reddit draft content.
|
|
7098
|
+
*
|
|
7099
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
7100
|
+
* @param data The target subreddit and optional post context.
|
|
7101
|
+
* @returns promise
|
|
7102
|
+
*/
|
|
7103
|
+
static getRedditSubredditPositioning<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7088
7104
|
/**
|
|
7089
7105
|
* Get all posts and comments for a scheduler.
|
|
7090
7106
|
*
|
|
@@ -7172,6 +7188,39 @@ declare class Scheduler {
|
|
|
7172
7188
|
static getTikTokRecommendedKeywords<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7173
7189
|
}
|
|
7174
7190
|
|
|
7191
|
+
declare class RedditSubreddits {
|
|
7192
|
+
/**
|
|
7193
|
+
* Search indexed Reddit communities for game marketing research.
|
|
7194
|
+
*
|
|
7195
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/indexRedditSubreddits
|
|
7196
|
+
*/
|
|
7197
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7198
|
+
/**
|
|
7199
|
+
* Get an analyzed subreddit record by display name.
|
|
7200
|
+
*
|
|
7201
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/showRedditSubreddit
|
|
7202
|
+
*/
|
|
7203
|
+
static show<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7204
|
+
/**
|
|
7205
|
+
* Match a game concept to relevant Reddit communities.
|
|
7206
|
+
*
|
|
7207
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/matchRedditSubreddits
|
|
7208
|
+
*/
|
|
7209
|
+
static match<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7210
|
+
/**
|
|
7211
|
+
* Admin-only ingestion of subreddit metadata and rules.
|
|
7212
|
+
*
|
|
7213
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/ingestRedditSubreddits
|
|
7214
|
+
*/
|
|
7215
|
+
static ingest<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7216
|
+
/**
|
|
7217
|
+
* Admin-only refresh for one subreddit.
|
|
7218
|
+
*
|
|
7219
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/refreshRedditSubreddit
|
|
7220
|
+
*/
|
|
7221
|
+
static refresh<T>(subreddit: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7222
|
+
}
|
|
7223
|
+
|
|
7175
7224
|
declare class Funnel {
|
|
7176
7225
|
/**
|
|
7177
7226
|
* Get funnel metrics.
|
|
@@ -9049,6 +9098,85 @@ declare class ServerOperations {
|
|
|
9049
9098
|
static updatePolicy<T>(title_id: string, build_id: string, data: object): AxiosPromise<Response<T>>;
|
|
9050
9099
|
}
|
|
9051
9100
|
|
|
9101
|
+
declare class Agents {
|
|
9102
|
+
/**
|
|
9103
|
+
* List game titles that can be managed in the Agents section.
|
|
9104
|
+
*/
|
|
9105
|
+
static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9106
|
+
/**
|
|
9107
|
+
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
9108
|
+
*/
|
|
9109
|
+
static routeCatalog<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9110
|
+
/**
|
|
9111
|
+
* Get a title-scoped agent workspace with setup, billing, counts, and route summary.
|
|
9112
|
+
*/
|
|
9113
|
+
static workspace<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9114
|
+
/**
|
|
9115
|
+
* List agents for a title.
|
|
9116
|
+
*/
|
|
9117
|
+
static listAgents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9118
|
+
/**
|
|
9119
|
+
* Create an agent before payment. Runs/results remain gated until trial/subscription.
|
|
9120
|
+
*/
|
|
9121
|
+
static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9122
|
+
/**
|
|
9123
|
+
* View one agent.
|
|
9124
|
+
*/
|
|
9125
|
+
static viewAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9126
|
+
/**
|
|
9127
|
+
* Update an agent's setup, policies, and guidance stop rules.
|
|
9128
|
+
*/
|
|
9129
|
+
static updateAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9130
|
+
/**
|
|
9131
|
+
* Archive an agent.
|
|
9132
|
+
*/
|
|
9133
|
+
static deleteAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9134
|
+
/**
|
|
9135
|
+
* Run an agent planning cycle. Returns 402 when trial/subscription is required.
|
|
9136
|
+
*/
|
|
9137
|
+
static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9138
|
+
/**
|
|
9139
|
+
* List agent runs for a title.
|
|
9140
|
+
*/
|
|
9141
|
+
static listRuns<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9142
|
+
/**
|
|
9143
|
+
* List agent actions/approval queue for a title.
|
|
9144
|
+
*/
|
|
9145
|
+
static listActions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9146
|
+
/**
|
|
9147
|
+
* Approve an agent action.
|
|
9148
|
+
*/
|
|
9149
|
+
static approveAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9150
|
+
/**
|
|
9151
|
+
* Reject an agent action.
|
|
9152
|
+
*/
|
|
9153
|
+
static rejectAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9154
|
+
/**
|
|
9155
|
+
* Execute an approved safe action.
|
|
9156
|
+
*/
|
|
9157
|
+
static executeAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9158
|
+
/**
|
|
9159
|
+
* List guidance requests where agents have stopped for developer direction.
|
|
9160
|
+
*/
|
|
9161
|
+
static listGuidance<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9162
|
+
/**
|
|
9163
|
+
* Answer a guidance request and write structured agent memory.
|
|
9164
|
+
*/
|
|
9165
|
+
static answerGuidance<T>(title_id: string, guidance_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9166
|
+
/**
|
|
9167
|
+
* List structured agent memories for a title.
|
|
9168
|
+
*/
|
|
9169
|
+
static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9170
|
+
/**
|
|
9171
|
+
* Get results and outcome summary for title agents. Returns 402 until trial/subscription is active.
|
|
9172
|
+
*/
|
|
9173
|
+
static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9174
|
+
/**
|
|
9175
|
+
* Start a Stripe-backed agent trial/subscription after setup.
|
|
9176
|
+
*/
|
|
9177
|
+
static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9178
|
+
}
|
|
9179
|
+
|
|
9052
9180
|
interface Route {
|
|
9053
9181
|
url: string;
|
|
9054
9182
|
method: string;
|
|
@@ -9389,6 +9517,7 @@ declare class Glitch {
|
|
|
9389
9517
|
PlayTests: typeof PlayTests;
|
|
9390
9518
|
Media: typeof Media;
|
|
9391
9519
|
Scheduler: typeof Scheduler;
|
|
9520
|
+
RedditSubreddits: typeof RedditSubreddits;
|
|
9392
9521
|
Funnel: typeof Funnel;
|
|
9393
9522
|
SocialStats: typeof SocialStats;
|
|
9394
9523
|
WebsiteAnalytics: typeof WebsiteAnalytics;
|
|
@@ -9403,6 +9532,7 @@ declare class Glitch {
|
|
|
9403
9532
|
Crm: typeof Crm;
|
|
9404
9533
|
Multiplayer: typeof Multiplayer;
|
|
9405
9534
|
ServerOperations: typeof ServerOperations;
|
|
9535
|
+
Agents: typeof Agents;
|
|
9406
9536
|
};
|
|
9407
9537
|
static util: {
|
|
9408
9538
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import AgentsRoute from "../routes/AgentsRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class Agents {
|
|
7
|
+
/**
|
|
8
|
+
* List game titles that can be managed in the Agents section.
|
|
9
|
+
*/
|
|
10
|
+
public static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
11
|
+
return Requests.processRoute(AgentsRoute.routes.listTitles, {}, {}, params);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
16
|
+
*/
|
|
17
|
+
public static routeCatalog<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
18
|
+
return Requests.processRoute(AgentsRoute.routes.routeCatalog, {}, {}, params);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get a title-scoped agent workspace with setup, billing, counts, and route summary.
|
|
23
|
+
*/
|
|
24
|
+
public static workspace<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
25
|
+
return Requests.processRoute(AgentsRoute.routes.workspace, {}, { title_id }, params);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* List agents for a title.
|
|
30
|
+
*/
|
|
31
|
+
public static listAgents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
32
|
+
return Requests.processRoute(AgentsRoute.routes.listAgents, {}, { title_id }, params);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create an agent before payment. Runs/results remain gated until trial/subscription.
|
|
37
|
+
*/
|
|
38
|
+
public static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
39
|
+
return Requests.processRoute(AgentsRoute.routes.createAgent, data, { title_id }, params);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* View one agent.
|
|
44
|
+
*/
|
|
45
|
+
public static viewAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
46
|
+
return Requests.processRoute(AgentsRoute.routes.viewAgent, {}, { title_id, agent_id }, params);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Update an agent's setup, policies, and guidance stop rules.
|
|
51
|
+
*/
|
|
52
|
+
public static updateAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
53
|
+
return Requests.processRoute(AgentsRoute.routes.updateAgent, data, { title_id, agent_id }, params);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Archive an agent.
|
|
58
|
+
*/
|
|
59
|
+
public static deleteAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
60
|
+
return Requests.processRoute(AgentsRoute.routes.deleteAgent, {}, { title_id, agent_id }, params);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Run an agent planning cycle. Returns 402 when trial/subscription is required.
|
|
65
|
+
*/
|
|
66
|
+
public static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
67
|
+
return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id, agent_id }, params);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* List agent runs for a title.
|
|
72
|
+
*/
|
|
73
|
+
public static listRuns<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
74
|
+
return Requests.processRoute(AgentsRoute.routes.listRuns, {}, { title_id }, params);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* List agent actions/approval queue for a title.
|
|
79
|
+
*/
|
|
80
|
+
public static listActions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
81
|
+
return Requests.processRoute(AgentsRoute.routes.listActions, {}, { title_id }, params);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Approve an agent action.
|
|
86
|
+
*/
|
|
87
|
+
public static approveAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
88
|
+
return Requests.processRoute(AgentsRoute.routes.approveAction, data || {}, { title_id, action_id }, params);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Reject an agent action.
|
|
93
|
+
*/
|
|
94
|
+
public static rejectAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
95
|
+
return Requests.processRoute(AgentsRoute.routes.rejectAction, data || {}, { title_id, action_id }, params);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Execute an approved safe action.
|
|
100
|
+
*/
|
|
101
|
+
public static executeAction<T>(title_id: string, action_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
102
|
+
return Requests.processRoute(AgentsRoute.routes.executeAction, data || {}, { title_id, action_id }, params);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* List guidance requests where agents have stopped for developer direction.
|
|
107
|
+
*/
|
|
108
|
+
public static listGuidance<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
109
|
+
return Requests.processRoute(AgentsRoute.routes.listGuidance, {}, { title_id }, params);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Answer a guidance request and write structured agent memory.
|
|
114
|
+
*/
|
|
115
|
+
public static answerGuidance<T>(title_id: string, guidance_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
116
|
+
return Requests.processRoute(AgentsRoute.routes.answerGuidance, data, { title_id, guidance_id }, params);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* List structured agent memories for a title.
|
|
121
|
+
*/
|
|
122
|
+
public static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
123
|
+
return Requests.processRoute(AgentsRoute.routes.listMemories, {}, { title_id }, params);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get results and outcome summary for title agents. Returns 402 until trial/subscription is active.
|
|
128
|
+
*/
|
|
129
|
+
public static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
130
|
+
return Requests.processRoute(AgentsRoute.routes.results, {}, { title_id }, params);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Start a Stripe-backed agent trial/subscription after setup.
|
|
135
|
+
*/
|
|
136
|
+
public static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
137
|
+
return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id }, params);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export default Agents;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import RedditSubredditsRoute from "../routes/RedditSubredditsRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class RedditSubreddits {
|
|
7
|
+
/**
|
|
8
|
+
* Search indexed Reddit communities for game marketing research.
|
|
9
|
+
*
|
|
10
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/indexRedditSubreddits
|
|
11
|
+
*/
|
|
12
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
13
|
+
return Requests.processRoute(RedditSubredditsRoute.routes.list, undefined, undefined, params);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get an analyzed subreddit record by display name.
|
|
18
|
+
*
|
|
19
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/showRedditSubreddit
|
|
20
|
+
*/
|
|
21
|
+
public static show<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
22
|
+
return Requests.processRoute(RedditSubredditsRoute.routes.show, undefined, { subreddit }, params);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Match a game concept to relevant Reddit communities.
|
|
27
|
+
*
|
|
28
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/matchRedditSubreddits
|
|
29
|
+
*/
|
|
30
|
+
public static match<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
31
|
+
return Requests.processRoute(RedditSubredditsRoute.routes.match, data, undefined, params);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Admin-only ingestion of subreddit metadata and rules.
|
|
36
|
+
*
|
|
37
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/ingestRedditSubreddits
|
|
38
|
+
*/
|
|
39
|
+
public static ingest<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
40
|
+
return Requests.processRoute(RedditSubredditsRoute.routes.ingest, data, undefined, params);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Admin-only refresh for one subreddit.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/refreshRedditSubreddit
|
|
47
|
+
*/
|
|
48
|
+
public static refresh<T>(subreddit: string, data: object = {}, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
49
|
+
return Requests.processRoute(RedditSubredditsRoute.routes.refresh, data, { subreddit }, params);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default RedditSubreddits;
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -752,7 +752,7 @@ class Scheduler {
|
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
/**
|
|
755
|
-
* Get
|
|
755
|
+
* Get subreddit recommendations for a scheduler.
|
|
756
756
|
*
|
|
757
757
|
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
758
758
|
*
|
|
@@ -777,6 +777,28 @@ class Scheduler {
|
|
|
777
777
|
return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id }, params);
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
+
/**
|
|
781
|
+
* Match the scheduler title to indexed Reddit communities.
|
|
782
|
+
*
|
|
783
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
784
|
+
* @param data Optional post context and filters.
|
|
785
|
+
* @returns promise
|
|
786
|
+
*/
|
|
787
|
+
public static getRedditSubredditMatches<T>(scheduler_id: string, data: object = {}, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
788
|
+
return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditMatches, data, { scheduler_id }, params);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Position a registered game for a subreddit and optionally prepare Reddit draft content.
|
|
793
|
+
*
|
|
794
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
795
|
+
* @param data The target subreddit and optional post context.
|
|
796
|
+
* @returns promise
|
|
797
|
+
*/
|
|
798
|
+
public static getRedditSubredditPositioning<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
799
|
+
return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditPositioning, data, { scheduler_id }, params);
|
|
800
|
+
}
|
|
801
|
+
|
|
780
802
|
/**
|
|
781
803
|
* Get all posts and comments for a scheduler.
|
|
782
804
|
*
|
package/src/api/index.ts
CHANGED
|
@@ -30,6 +30,7 @@ import Newsletters from "./Newsletters"
|
|
|
30
30
|
import PlayTests from "./PlayTests";
|
|
31
31
|
import Media from "./Media";
|
|
32
32
|
import Scheduler from "./Scheduler";
|
|
33
|
+
import RedditSubreddits from "./RedditSubreddits";
|
|
33
34
|
import Funnel from "./Funnel";
|
|
34
35
|
import SocialStats from "./SocialStats";
|
|
35
36
|
import Hashtags from "./Hashtags";
|
|
@@ -44,6 +45,7 @@ import Education from "./Education";
|
|
|
44
45
|
import Crm from "./Crm";
|
|
45
46
|
import Multiplayer from "./Multiplayer";
|
|
46
47
|
import ServerOperations from "./ServerOperations";
|
|
48
|
+
import Agents from "./Agents";
|
|
47
49
|
|
|
48
50
|
export {Ads};
|
|
49
51
|
export {AccessKeys};
|
|
@@ -76,6 +78,7 @@ export {Newsletters};
|
|
|
76
78
|
export {PlayTests};
|
|
77
79
|
export {Media};
|
|
78
80
|
export {Scheduler};
|
|
81
|
+
export {RedditSubreddits};
|
|
79
82
|
export {Funnel};
|
|
80
83
|
export {SocialStats};
|
|
81
84
|
export {Hashtags};
|
|
@@ -91,3 +94,4 @@ export {Education};
|
|
|
91
94
|
export {Crm};
|
|
92
95
|
export {Multiplayer};
|
|
93
96
|
export {ServerOperations};
|
|
97
|
+
export {Agents};
|
package/src/index.ts
CHANGED
|
@@ -33,6 +33,7 @@ import {Newsletters} from "./api";
|
|
|
33
33
|
import {PlayTests} from "./api";
|
|
34
34
|
import {Media} from "./api";
|
|
35
35
|
import {Scheduler} from "./api";
|
|
36
|
+
import {RedditSubreddits} from "./api";
|
|
36
37
|
import {Funnel} from "./api";
|
|
37
38
|
import {SocialStats} from "./api";
|
|
38
39
|
import {Hashtags} from "./api";
|
|
@@ -48,6 +49,7 @@ import {Education} from './api';
|
|
|
48
49
|
import {Crm} from './api';
|
|
49
50
|
import {Multiplayer} from './api';
|
|
50
51
|
import {ServerOperations} from './api';
|
|
52
|
+
import {Agents} from './api';
|
|
51
53
|
|
|
52
54
|
import Requests from "./util/Requests";
|
|
53
55
|
import Parser from "./util/Parser";
|
|
@@ -111,6 +113,7 @@ class Glitch {
|
|
|
111
113
|
PlayTests : PlayTests,
|
|
112
114
|
Media : Media,
|
|
113
115
|
Scheduler : Scheduler,
|
|
116
|
+
RedditSubreddits : RedditSubreddits,
|
|
114
117
|
Funnel: Funnel,
|
|
115
118
|
SocialStats : SocialStats,
|
|
116
119
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
@@ -125,6 +128,7 @@ class Glitch {
|
|
|
125
128
|
Crm : Crm,
|
|
126
129
|
Multiplayer : Multiplayer,
|
|
127
130
|
ServerOperations : ServerOperations,
|
|
131
|
+
Agents : Agents,
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
public static util = {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class AgentsRoute {
|
|
5
|
+
public static routes: { [key: string]: Route } = {
|
|
6
|
+
listTitles: { url: "/agents/titles", method: HTTP_METHODS.GET },
|
|
7
|
+
routeCatalog: { url: "/agents/routes/catalog", method: HTTP_METHODS.GET },
|
|
8
|
+
workspace: { url: "/agents/titles/{title_id}/workspace", method: HTTP_METHODS.GET },
|
|
9
|
+
listAgents: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.GET },
|
|
10
|
+
createAgent: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.POST },
|
|
11
|
+
viewAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.GET },
|
|
12
|
+
updateAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.PUT },
|
|
13
|
+
deleteAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}", method: HTTP_METHODS.DELETE },
|
|
14
|
+
runAgent: { url: "/agents/titles/{title_id}/agents/{agent_id}/run", method: HTTP_METHODS.POST },
|
|
15
|
+
listRuns: { url: "/agents/titles/{title_id}/runs", method: HTTP_METHODS.GET },
|
|
16
|
+
listActions: { url: "/agents/titles/{title_id}/actions", method: HTTP_METHODS.GET },
|
|
17
|
+
approveAction: { url: "/agents/titles/{title_id}/actions/{action_id}/approve", method: HTTP_METHODS.POST },
|
|
18
|
+
rejectAction: { url: "/agents/titles/{title_id}/actions/{action_id}/reject", method: HTTP_METHODS.POST },
|
|
19
|
+
executeAction: { url: "/agents/titles/{title_id}/actions/{action_id}/execute", method: HTTP_METHODS.POST },
|
|
20
|
+
listGuidance: { url: "/agents/titles/{title_id}/guidance", method: HTTP_METHODS.GET },
|
|
21
|
+
answerGuidance: { url: "/agents/titles/{title_id}/guidance/{guidance_id}/answer", method: HTTP_METHODS.POST },
|
|
22
|
+
listMemories: { url: "/agents/titles/{title_id}/memories", method: HTTP_METHODS.GET },
|
|
23
|
+
results: { url: "/agents/titles/{title_id}/results", method: HTTP_METHODS.GET },
|
|
24
|
+
startTrial: { url: "/agents/titles/{title_id}/subscription/trial", method: HTTP_METHODS.POST },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default AgentsRoute;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class RedditSubredditsRoute {
|
|
5
|
+
public static routes: { [key: string]: Route } = {
|
|
6
|
+
list: { url: '/reddit/subreddits', method: HTTP_METHODS.GET },
|
|
7
|
+
show: { url: '/reddit/subreddits/{subreddit}', method: HTTP_METHODS.GET },
|
|
8
|
+
match: { url: '/reddit/subreddits/match', method: HTTP_METHODS.POST },
|
|
9
|
+
ingest: { url: '/admin/reddit/subreddits/ingest', method: HTTP_METHODS.POST },
|
|
10
|
+
refresh: { url: '/admin/reddit/subreddits/{subreddit}/refresh', method: HTTP_METHODS.POST },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default RedditSubredditsRoute;
|
|
@@ -112,6 +112,8 @@ class SchedulerRoute {
|
|
|
112
112
|
|
|
113
113
|
getRedditRecommendations: { url: '/schedulers/{scheduler_id}/reddit/recommendations', method: HTTP_METHODS.POST },
|
|
114
114
|
generateRedditContent: { url: '/schedulers/{scheduler_id}/reddit/generateContent', method: HTTP_METHODS.POST },
|
|
115
|
+
getRedditSubredditMatches: { url: '/schedulers/{scheduler_id}/reddit/subreddit-matches', method: HTTP_METHODS.POST },
|
|
116
|
+
getRedditSubredditPositioning: { url: '/schedulers/{scheduler_id}/reddit/subreddit-positioning', method: HTTP_METHODS.POST },
|
|
115
117
|
|
|
116
118
|
listDestinations: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.GET },
|
|
117
119
|
createDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.POST },
|