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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class AdminReports {
|
|
4
|
+
/**
|
|
5
|
+
* Returns aggregate site-admin reporting for user growth, churn, acquisition,
|
|
6
|
+
* engagement, and user-generated revenue.
|
|
7
|
+
*/
|
|
8
|
+
static usersRevenue<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9
|
+
}
|
|
10
|
+
export default AdminReports;
|
package/dist/esm/api/Agents.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ declare class Agents {
|
|
|
16
16
|
* List game titles that can be managed in the Agents section.
|
|
17
17
|
*/
|
|
18
18
|
static listTitles<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
19
|
+
/**
|
|
20
|
+
* List title-agent subscriptions linked to titles in a community.
|
|
21
|
+
*/
|
|
22
|
+
static listCommunitySubscriptions<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
23
|
+
/**
|
|
24
|
+
* Cancel a title-agent subscription linked to a community title.
|
|
25
|
+
*/
|
|
26
|
+
static cancelCommunitySubscription<T>(community_id: string, stripe_subscription_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
19
27
|
/**
|
|
20
28
|
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
21
29
|
*/
|
|
@@ -29,7 +37,7 @@ declare class Agents {
|
|
|
29
37
|
*/
|
|
30
38
|
static listAgents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
31
39
|
/**
|
|
32
|
-
* Create an agent before payment. Runs/results remain gated until
|
|
40
|
+
* Create an agent before payment. Runs/results remain gated until subscription or prepaid credits.
|
|
33
41
|
*/
|
|
34
42
|
static createAgent<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
35
43
|
/**
|
|
@@ -45,7 +53,7 @@ declare class Agents {
|
|
|
45
53
|
*/
|
|
46
54
|
static deleteAgent<T>(title_id: string, agent_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
47
55
|
/**
|
|
48
|
-
* Run an agent planning cycle. Returns 402 when
|
|
56
|
+
* Run an agent planning cycle. Returns 402 when subscription or prepaid credits are required.
|
|
49
57
|
*/
|
|
50
58
|
static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
51
59
|
/**
|
|
@@ -114,7 +122,7 @@ declare class Agents {
|
|
|
114
122
|
*/
|
|
115
123
|
static listMemories<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
116
124
|
/**
|
|
117
|
-
* Get results and outcome summary for title agents. Returns 402 until
|
|
125
|
+
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
118
126
|
*/
|
|
119
127
|
static results<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
120
128
|
/**
|
|
@@ -132,7 +140,7 @@ declare class Agents {
|
|
|
132
140
|
*/
|
|
133
141
|
static purchaseCredits<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
134
142
|
/**
|
|
135
|
-
* Start a Stripe-backed agent
|
|
143
|
+
* Start a Stripe-backed agent subscription after setup.
|
|
136
144
|
*/
|
|
137
145
|
static startTrial<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
138
146
|
/**
|
package/dist/esm/api/index.d.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
|
export { Ads };
|
|
52
53
|
export { AccessKeys };
|
|
53
54
|
export { Auth };
|
|
@@ -98,3 +99,4 @@ export { ServerOperations };
|
|
|
98
99
|
export { Agents };
|
|
99
100
|
export { Mcp };
|
|
100
101
|
export { PrDirectory };
|
|
102
|
+
export { AdminReports };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ import { ServerOperations } from './api';
|
|
|
48
48
|
import { Agents } from './api';
|
|
49
49
|
import { Mcp } from './api';
|
|
50
50
|
import { PrDirectory } from './api';
|
|
51
|
+
import { AdminReports } from './api';
|
|
51
52
|
import Requests from "./util/Requests";
|
|
52
53
|
import Parser from "./util/Parser";
|
|
53
54
|
import Session from "./util/Session";
|
|
@@ -117,6 +118,7 @@ declare class Glitch {
|
|
|
117
118
|
Agents: typeof Agents;
|
|
118
119
|
Mcp: typeof Mcp;
|
|
119
120
|
PrDirectory: typeof PrDirectory;
|
|
121
|
+
AdminReports: typeof AdminReports;
|
|
120
122
|
};
|
|
121
123
|
static util: {
|
|
122
124
|
Requests: typeof Requests;
|
package/dist/esm/index.js
CHANGED
|
@@ -19085,6 +19085,8 @@ var AgentsRoute = /** @class */ (function () {
|
|
|
19085
19085
|
}
|
|
19086
19086
|
AgentsRoute.routes = {
|
|
19087
19087
|
listTitles: { url: "/agents/titles", method: HTTP_METHODS.GET },
|
|
19088
|
+
listCommunitySubscriptions: { url: "/agents/communities/{community_id}/subscriptions", method: HTTP_METHODS.GET },
|
|
19089
|
+
cancelCommunitySubscription: { url: "/agents/communities/{community_id}/subscriptions/{stripe_subscription_id}", method: HTTP_METHODS.DELETE },
|
|
19088
19090
|
routeCatalog: { url: "/agents/routes/catalog", method: HTTP_METHODS.GET },
|
|
19089
19091
|
workspace: { url: "/agents/titles/{title_id}/workspace", method: HTTP_METHODS.GET },
|
|
19090
19092
|
listAgents: { url: "/agents/titles/{title_id}/agents", method: HTTP_METHODS.GET },
|
|
@@ -19130,6 +19132,18 @@ var Agents = /** @class */ (function () {
|
|
|
19130
19132
|
Agents.listTitles = function (params) {
|
|
19131
19133
|
return Requests.processRoute(AgentsRoute.routes.listTitles, {}, {}, params);
|
|
19132
19134
|
};
|
|
19135
|
+
/**
|
|
19136
|
+
* List title-agent subscriptions linked to titles in a community.
|
|
19137
|
+
*/
|
|
19138
|
+
Agents.listCommunitySubscriptions = function (community_id, params) {
|
|
19139
|
+
return Requests.processRoute(AgentsRoute.routes.listCommunitySubscriptions, {}, { community_id: community_id }, params);
|
|
19140
|
+
};
|
|
19141
|
+
/**
|
|
19142
|
+
* Cancel a title-agent subscription linked to a community title.
|
|
19143
|
+
*/
|
|
19144
|
+
Agents.cancelCommunitySubscription = function (community_id, stripe_subscription_id, params) {
|
|
19145
|
+
return Requests.processRoute(AgentsRoute.routes.cancelCommunitySubscription, {}, { community_id: community_id, stripe_subscription_id: stripe_subscription_id }, params);
|
|
19146
|
+
};
|
|
19133
19147
|
/**
|
|
19134
19148
|
* Return the full Laravel API route catalog agents use for route-aware planning.
|
|
19135
19149
|
*/
|
|
@@ -19149,7 +19163,7 @@ var Agents = /** @class */ (function () {
|
|
|
19149
19163
|
return Requests.processRoute(AgentsRoute.routes.listAgents, {}, { title_id: title_id }, params);
|
|
19150
19164
|
};
|
|
19151
19165
|
/**
|
|
19152
|
-
* Create an agent before payment. Runs/results remain gated until
|
|
19166
|
+
* Create an agent before payment. Runs/results remain gated until subscription or prepaid credits.
|
|
19153
19167
|
*/
|
|
19154
19168
|
Agents.createAgent = function (title_id, data, params) {
|
|
19155
19169
|
return Requests.processRoute(AgentsRoute.routes.createAgent, data, { title_id: title_id }, params);
|
|
@@ -19173,7 +19187,7 @@ var Agents = /** @class */ (function () {
|
|
|
19173
19187
|
return Requests.processRoute(AgentsRoute.routes.deleteAgent, {}, { title_id: title_id, agent_id: agent_id }, params);
|
|
19174
19188
|
};
|
|
19175
19189
|
/**
|
|
19176
|
-
* Run an agent planning cycle. Returns 402 when
|
|
19190
|
+
* Run an agent planning cycle. Returns 402 when subscription or prepaid credits are required.
|
|
19177
19191
|
*/
|
|
19178
19192
|
Agents.runAgent = function (title_id, agent_id, data, params) {
|
|
19179
19193
|
return Requests.processRoute(AgentsRoute.routes.runAgent, data, { title_id: title_id, agent_id: agent_id }, params);
|
|
@@ -19279,7 +19293,7 @@ var Agents = /** @class */ (function () {
|
|
|
19279
19293
|
return Requests.processRoute(AgentsRoute.routes.listMemories, {}, { title_id: title_id }, params);
|
|
19280
19294
|
};
|
|
19281
19295
|
/**
|
|
19282
|
-
* Get results and outcome summary for title agents. Returns 402 until
|
|
19296
|
+
* Get results and outcome summary for title agents. Returns 402 until subscription or prepaid credits are active.
|
|
19283
19297
|
*/
|
|
19284
19298
|
Agents.results = function (title_id, params) {
|
|
19285
19299
|
return Requests.processRoute(AgentsRoute.routes.results, {}, { title_id: title_id }, params);
|
|
@@ -19305,7 +19319,7 @@ var Agents = /** @class */ (function () {
|
|
|
19305
19319
|
return Requests.processRoute(AgentsRoute.routes.purchaseCredits, data, { title_id: title_id }, params);
|
|
19306
19320
|
};
|
|
19307
19321
|
/**
|
|
19308
|
-
* Start a Stripe-backed agent
|
|
19322
|
+
* Start a Stripe-backed agent subscription after setup.
|
|
19309
19323
|
*/
|
|
19310
19324
|
Agents.startTrial = function (title_id, data, params) {
|
|
19311
19325
|
return Requests.processRoute(AgentsRoute.routes.startTrial, data, { title_id: title_id }, params);
|
|
@@ -19598,6 +19612,31 @@ var PrDirectory = /** @class */ (function () {
|
|
|
19598
19612
|
return PrDirectory;
|
|
19599
19613
|
}());
|
|
19600
19614
|
|
|
19615
|
+
var AdminReportsRoute = /** @class */ (function () {
|
|
19616
|
+
function AdminReportsRoute() {
|
|
19617
|
+
}
|
|
19618
|
+
AdminReportsRoute.routes = {
|
|
19619
|
+
usersRevenue: {
|
|
19620
|
+
url: '/admin/reports/users-revenue',
|
|
19621
|
+
method: HTTP_METHODS.GET
|
|
19622
|
+
},
|
|
19623
|
+
};
|
|
19624
|
+
return AdminReportsRoute;
|
|
19625
|
+
}());
|
|
19626
|
+
|
|
19627
|
+
var AdminReports = /** @class */ (function () {
|
|
19628
|
+
function AdminReports() {
|
|
19629
|
+
}
|
|
19630
|
+
/**
|
|
19631
|
+
* Returns aggregate site-admin reporting for user growth, churn, acquisition,
|
|
19632
|
+
* engagement, and user-generated revenue.
|
|
19633
|
+
*/
|
|
19634
|
+
AdminReports.usersRevenue = function (params) {
|
|
19635
|
+
return Requests.processRoute(AdminReportsRoute.routes.usersRevenue, undefined, undefined, params);
|
|
19636
|
+
};
|
|
19637
|
+
return AdminReports;
|
|
19638
|
+
}());
|
|
19639
|
+
|
|
19601
19640
|
var Parser = /** @class */ (function () {
|
|
19602
19641
|
function Parser() {
|
|
19603
19642
|
}
|
|
@@ -20144,6 +20183,7 @@ var Glitch = /** @class */ (function () {
|
|
|
20144
20183
|
Agents: Agents,
|
|
20145
20184
|
Mcp: Mcp,
|
|
20146
20185
|
PrDirectory: PrDirectory,
|
|
20186
|
+
AdminReports: AdminReports,
|
|
20147
20187
|
};
|
|
20148
20188
|
Glitch.util = {
|
|
20149
20189
|
Requests: Requests,
|