glitch-javascript-sdk 3.2.12 → 3.2.14
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 +44 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/AdminReports.d.ts +10 -0
- package/dist/esm/api/Agents.d.ts +12 -4
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +44 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/AdminReportsRoute.d.ts +7 -0
- package/dist/index.d.ts +21 -4
- package/package.json +1 -1
- package/src/api/AdminReports.ts +16 -0
- package/src/api/Agents.ts +18 -4
- package/src/api/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/routes/AdminReportsRoute.ts +13 -0
- package/src/routes/AgentsRoute.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -9224,6 +9224,14 @@ declare class Agents {
|
|
|
9224
9224
|
* List game titles that can be managed in the Agents section.
|
|
9225
9225
|
*/
|
|
9226
9226
|
static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9227
|
+
/**
|
|
9228
|
+
* List title-agent subscriptions linked to titles in a community.
|
|
9229
|
+
*/
|
|
9230
|
+
static listCommunitySubscriptions<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9231
|
+
/**
|
|
9232
|
+
* Cancel a title-agent subscription linked to a community title.
|
|
9233
|
+
*/
|
|
9234
|
+
static cancelCommunitySubscription<T>(community_id: string, stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9227
9235
|
/**
|
|
9228
9236
|
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
9229
9237
|
*/
|
|
@@ -9237,7 +9245,7 @@ declare class Agents {
|
|
|
9237
9245
|
*/
|
|
9238
9246
|
static listAgents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9239
9247
|
/**
|
|
9240
|
-
* Create an agent before payment. Runs/results remain gated until
|
|
9248
|
+
* Create an agent before payment. Runs/results remain gated until subscription or prepaid credits.
|
|
9241
9249
|
*/
|
|
9242
9250
|
static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9243
9251
|
/**
|
|
@@ -9253,7 +9261,7 @@ declare class Agents {
|
|
|
9253
9261
|
*/
|
|
9254
9262
|
static deleteAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9255
9263
|
/**
|
|
9256
|
-
* Run an agent planning cycle. Returns 402 when
|
|
9264
|
+
* Run an agent planning cycle. Returns 402 when subscription or prepaid credits are required.
|
|
9257
9265
|
*/
|
|
9258
9266
|
static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9259
9267
|
/**
|
|
@@ -9322,7 +9330,7 @@ declare class Agents {
|
|
|
9322
9330
|
*/
|
|
9323
9331
|
static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9324
9332
|
/**
|
|
9325
|
-
* Get results and outcome summary for title agents. Returns 402 until
|
|
9333
|
+
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
9326
9334
|
*/
|
|
9327
9335
|
static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9328
9336
|
/**
|
|
@@ -9340,7 +9348,7 @@ declare class Agents {
|
|
|
9340
9348
|
*/
|
|
9341
9349
|
static purchaseCredits<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9342
9350
|
/**
|
|
9343
|
-
* Start a Stripe-backed agent
|
|
9351
|
+
* Start a Stripe-backed agent subscription after setup.
|
|
9344
9352
|
*/
|
|
9345
9353
|
static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9346
9354
|
/**
|
|
@@ -9816,6 +9824,14 @@ declare class PrDirectory {
|
|
|
9816
9824
|
static queueVerification<T = PrQueueVerificationResponse>(data?: PrQueueVerificationRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9817
9825
|
}
|
|
9818
9826
|
|
|
9827
|
+
declare class AdminReports {
|
|
9828
|
+
/**
|
|
9829
|
+
* Returns aggregate site-admin reporting for user growth, churn, acquisition,
|
|
9830
|
+
* engagement, and user-generated revenue.
|
|
9831
|
+
*/
|
|
9832
|
+
static usersRevenue<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9833
|
+
}
|
|
9834
|
+
|
|
9819
9835
|
interface Route {
|
|
9820
9836
|
url: string;
|
|
9821
9837
|
method: string;
|
|
@@ -10181,6 +10197,7 @@ declare class Glitch {
|
|
|
10181
10197
|
Agents: typeof Agents;
|
|
10182
10198
|
Mcp: typeof Mcp;
|
|
10183
10199
|
PrDirectory: typeof PrDirectory;
|
|
10200
|
+
AdminReports: typeof AdminReports;
|
|
10184
10201
|
};
|
|
10185
10202
|
static util: {
|
|
10186
10203
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import AdminReportsRoute from "../routes/AdminReportsRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class AdminReports {
|
|
7
|
+
/**
|
|
8
|
+
* Returns aggregate site-admin reporting for user growth, churn, acquisition,
|
|
9
|
+
* engagement, and user-generated revenue.
|
|
10
|
+
*/
|
|
11
|
+
public static usersRevenue<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
12
|
+
return Requests.processRoute(AdminReportsRoute.routes.usersRevenue, undefined, undefined, params);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default AdminReports;
|
package/src/api/Agents.ts
CHANGED
|
@@ -23,6 +23,20 @@ class Agents {
|
|
|
23
23
|
return Requests.processRoute(AgentsRoute.routes.listTitles, {}, {}, params);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* List title-agent subscriptions linked to titles in a community.
|
|
28
|
+
*/
|
|
29
|
+
public static listCommunitySubscriptions<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
30
|
+
return Requests.processRoute(AgentsRoute.routes.listCommunitySubscriptions, {}, { community_id }, params);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Cancel a title-agent subscription linked to a community title.
|
|
35
|
+
*/
|
|
36
|
+
public static cancelCommunitySubscription<T>(community_id: string, stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
37
|
+
return Requests.processRoute(AgentsRoute.routes.cancelCommunitySubscription, {}, { community_id, stripe_subscription_id }, params);
|
|
38
|
+
}
|
|
39
|
+
|
|
26
40
|
/**
|
|
27
41
|
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
28
42
|
*/
|
|
@@ -45,7 +59,7 @@ class Agents {
|
|
|
45
59
|
}
|
|
46
60
|
|
|
47
61
|
/**
|
|
48
|
-
* Create an agent before payment. Runs/results remain gated until
|
|
62
|
+
* Create an agent before payment. Runs/results remain gated until subscription or prepaid credits.
|
|
49
63
|
*/
|
|
50
64
|
public static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
51
65
|
return Requests.processRoute(AgentsRoute.routes.createAgent, data, { title_id }, params);
|
|
@@ -73,7 +87,7 @@ class Agents {
|
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
/**
|
|
76
|
-
* Run an agent planning cycle. Returns 402 when
|
|
90
|
+
* Run an agent planning cycle. Returns 402 when subscription or prepaid credits are required.
|
|
77
91
|
*/
|
|
78
92
|
public static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
79
93
|
return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id, agent_id }, params);
|
|
@@ -211,7 +225,7 @@ class Agents {
|
|
|
211
225
|
}
|
|
212
226
|
|
|
213
227
|
/**
|
|
214
|
-
* Get results and outcome summary for title agents. Returns 402 until
|
|
228
|
+
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
215
229
|
*/
|
|
216
230
|
public static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
217
231
|
return Requests.processRoute(AgentsRoute.routes.results, {}, { title_id }, params);
|
|
@@ -241,7 +255,7 @@ class Agents {
|
|
|
241
255
|
}
|
|
242
256
|
|
|
243
257
|
/**
|
|
244
|
-
* Start a Stripe-backed agent
|
|
258
|
+
* Start a Stripe-backed agent subscription after setup.
|
|
245
259
|
*/
|
|
246
260
|
public static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
247
261
|
return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id }, params);
|
package/src/api/index.ts
CHANGED
|
@@ -48,6 +48,7 @@ import ServerOperations from "./ServerOperations";
|
|
|
48
48
|
import Agents from "./Agents";
|
|
49
49
|
import Mcp from "./Mcp";
|
|
50
50
|
import PrDirectory from "./PrDirectory";
|
|
51
|
+
import AdminReports from "./AdminReports";
|
|
51
52
|
|
|
52
53
|
export {Ads};
|
|
53
54
|
export {AccessKeys};
|
|
@@ -99,3 +100,4 @@ export {ServerOperations};
|
|
|
99
100
|
export {Agents};
|
|
100
101
|
export {Mcp};
|
|
101
102
|
export {PrDirectory};
|
|
103
|
+
export {AdminReports};
|
package/src/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ import {ServerOperations} from './api';
|
|
|
52
52
|
import {Agents} from './api';
|
|
53
53
|
import {Mcp} from './api';
|
|
54
54
|
import {PrDirectory} from './api';
|
|
55
|
+
import {AdminReports} from './api';
|
|
55
56
|
|
|
56
57
|
import Requests from "./util/Requests";
|
|
57
58
|
import Parser from "./util/Parser";
|
|
@@ -133,6 +134,7 @@ class Glitch {
|
|
|
133
134
|
Agents : Agents,
|
|
134
135
|
Mcp : Mcp,
|
|
135
136
|
PrDirectory : PrDirectory,
|
|
137
|
+
AdminReports : AdminReports,
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
public static util = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class AdminReportsRoute {
|
|
5
|
+
public static routes: { [key: string]: Route } = {
|
|
6
|
+
usersRevenue: {
|
|
7
|
+
url: '/admin/reports/users-revenue',
|
|
8
|
+
method: HTTP_METHODS.GET
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default AdminReportsRoute;
|
|
@@ -4,6 +4,8 @@ import HTTP_METHODS from "../constants/HttpMethods";
|
|
|
4
4
|
class AgentsRoute {
|
|
5
5
|
public static routes: { [key: string]: Route } = {
|
|
6
6
|
listTitles: { url: "/agents/titles", method: HTTP_METHODS.GET },
|
|
7
|
+
listCommunitySubscriptions: { url: "/agents/communities/{community_id}/subscriptions", method: HTTP_METHODS.GET },
|
|
8
|
+
cancelCommunitySubscription: { url: "/agents/communities/{community_id}/subscriptions/{stripe_subscription_id}", method: HTTP_METHODS.DELETE },
|
|
7
9
|
routeCatalog: { url: "/agents/routes/catalog", method: HTTP_METHODS.GET },
|
|
8
10
|
workspace: { url: "/agents/titles/{title_id}/workspace", method: HTTP_METHODS.GET },
|
|
9
11
|
listAgents: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.GET },
|