glitch-javascript-sdk 3.2.4 → 3.2.6

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
@@ -7207,6 +7207,12 @@ declare class RedditSubreddits {
7207
7207
  * @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/matchRedditSubreddits
7208
7208
  */
7209
7209
  static match<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
7210
+ /**
7211
+ * Match one of the authenticated user's administered titles to Reddit communities.
7212
+ *
7213
+ * @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/titleRedditSubredditMatches
7214
+ */
7215
+ static matchTitle<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
7210
7216
  /**
7211
7217
  * Admin-only ingestion of subreddit metadata and rules.
7212
7218
  *
@@ -9098,6 +9104,17 @@ declare class ServerOperations {
9098
9104
  static updatePolicy<T>(title_id: string, build_id: string, data: object): AxiosPromise<Response<T>>;
9099
9105
  }
9100
9106
 
9107
+ interface AgentRunRequest {
9108
+ run_type?: string;
9109
+ trigger_source?: string;
9110
+ background?: boolean;
9111
+ inline?: boolean;
9112
+ live_mode?: boolean;
9113
+ initial_message?: string | null;
9114
+ attachment_ids?: string[];
9115
+ agent_run_id?: string | null;
9116
+ [key: string]: any;
9117
+ }
9101
9118
  declare class Agents {
9102
9119
  /**
9103
9120
  * List game titles that can be managed in the Agents section.
@@ -9134,7 +9151,7 @@ declare class Agents {
9134
9151
  /**
9135
9152
  * Run an agent planning cycle. Returns 402 when trial/subscription is required.
9136
9153
  */
9137
- static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
9154
+ static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
9138
9155
  /**
9139
9156
  * Upload one file for an agent run. data can include { agent_run_id }.
9140
9157
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/api/Agents.ts CHANGED
@@ -3,6 +3,18 @@ import Requests from "../util/Requests";
3
3
  import Response from "../util/Response";
4
4
  import { AxiosPromise, AxiosProgressEvent } from "axios";
5
5
 
6
+ export interface AgentRunRequest {
7
+ run_type?: string;
8
+ trigger_source?: string;
9
+ background?: boolean;
10
+ inline?: boolean;
11
+ live_mode?: boolean;
12
+ initial_message?: string | null;
13
+ attachment_ids?: string[];
14
+ agent_run_id?: string | null;
15
+ [key: string]: any;
16
+ }
17
+
6
18
  class Agents {
7
19
  /**
8
20
  * List game titles that can be managed in the Agents section.
@@ -63,7 +75,7 @@ class Agents {
63
75
  /**
64
76
  * Run an agent planning cycle. Returns 402 when trial/subscription is required.
65
77
  */
66
- public static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
78
+ public static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
67
79
  return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id, agent_id }, params);
68
80
  }
69
81
 
@@ -31,6 +31,15 @@ class RedditSubreddits {
31
31
  return Requests.processRoute(RedditSubredditsRoute.routes.match, data, undefined, params);
32
32
  }
33
33
 
34
+ /**
35
+ * Match one of the authenticated user's administered titles to Reddit communities.
36
+ *
37
+ * @see https://api.glitch.fun/api/documentation#/Reddit%20Subreddit%20Intelligence/titleRedditSubredditMatches
38
+ */
39
+ public static matchTitle<T>(title_id: string, data: object = {}, params?: Record<string, any>): AxiosPromise<Response<T>> {
40
+ return Requests.processRoute(RedditSubredditsRoute.routes.matchTitle, data, { title_id }, params);
41
+ }
42
+
34
43
  /**
35
44
  * Admin-only ingestion of subreddit metadata and rules.
36
45
  *
@@ -6,6 +6,7 @@ class RedditSubredditsRoute {
6
6
  list: { url: '/reddit/subreddits', method: HTTP_METHODS.GET },
7
7
  show: { url: '/reddit/subreddits/{subreddit}', method: HTTP_METHODS.GET },
8
8
  match: { url: '/reddit/subreddits/match', method: HTTP_METHODS.POST },
9
+ matchTitle: { url: '/titles/{title_id}/reddit/subreddit-matches', method: HTTP_METHODS.POST },
9
10
  ingest: { url: '/admin/reddit/subreddits/ingest', method: HTTP_METHODS.POST },
10
11
  refresh: { url: '/admin/reddit/subreddits/{subreddit}/refresh', method: HTTP_METHODS.POST },
11
12
  };