glitch-javascript-sdk 3.2.31 → 3.2.32

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.
@@ -0,0 +1,42 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ /**
4
+ * Site-administrator user management.
5
+ *
6
+ * These endpoints back the admin dashboard user directory. They require a
7
+ * site-admin auth token (Super Administrator or Administrator), and
8
+ * impersonation additionally requires a Super Administrator token.
9
+ */
10
+ declare class AdminUsers {
11
+ /**
12
+ * List and search all users in the system.
13
+ *
14
+ * Supported params include `search` (matches name, username, email, or id),
15
+ * `is_site_admin`, `is_verified`, `sort_by`, `sort_order`, `per_page`, and
16
+ * `page`.
17
+ *
18
+ * @param params Optional query parameters.
19
+ * @returns promise
20
+ */
21
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Retrieve a comprehensive profile for a single user, including communities,
24
+ * administered titles, games played, roles, billing status, social presence,
25
+ * and activity counts.
26
+ *
27
+ * @param user_id The id of the user to view.
28
+ * @param params Optional query parameters.
29
+ * @returns promise
30
+ */
31
+ static view<T>(user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
32
+ /**
33
+ * Impersonate a user. Issues a JWT for the target account so a Super
34
+ * Administrator can operate as that user. Administrator accounts cannot be
35
+ * impersonated, and every call is written to the impersonation audit log.
36
+ *
37
+ * @param user_id The id of the user to impersonate.
38
+ * @returns promise resolving to an access token and the impersonated user summary.
39
+ */
40
+ static impersonate<T>(user_id: string): AxiosPromise<Response<T>>;
41
+ }
42
+ export default AdminUsers;
@@ -49,6 +49,7 @@ import Agents from "./Agents";
49
49
  import Mcp from "./Mcp";
50
50
  import PrDirectory from "./PrDirectory";
51
51
  import AdminReports from "./AdminReports";
52
+ import AdminUsers from "./AdminUsers";
52
53
  import MarketResearch from "./MarketResearch";
53
54
  export { Ads };
54
55
  export { AccessKeys };
@@ -101,4 +102,5 @@ export { Agents };
101
102
  export { Mcp };
102
103
  export { PrDirectory };
103
104
  export { AdminReports };
105
+ export { AdminUsers };
104
106
  export { MarketResearch };
@@ -49,6 +49,7 @@ import { Agents } from './api';
49
49
  import { Mcp } from './api';
50
50
  import { PrDirectory } from './api';
51
51
  import { AdminReports } from './api';
52
+ import { AdminUsers } from './api';
52
53
  import { MarketResearch } from './api';
53
54
  import Requests from "./util/Requests";
54
55
  import Parser from "./util/Parser";
@@ -120,6 +121,7 @@ declare class Glitch {
120
121
  Mcp: typeof Mcp;
121
122
  PrDirectory: typeof PrDirectory;
122
123
  AdminReports: typeof AdminReports;
124
+ AdminUsers: typeof AdminUsers;
123
125
  MarketResearch: typeof MarketResearch;
124
126
  };
125
127
  static util: {
package/dist/esm/index.js CHANGED
@@ -20211,6 +20211,78 @@ var AdminReports = /** @class */ (function () {
20211
20211
  return AdminReports;
20212
20212
  }());
20213
20213
 
20214
+ var AdminUsersRoute = /** @class */ (function () {
20215
+ function AdminUsersRoute() {
20216
+ }
20217
+ AdminUsersRoute.routes = {
20218
+ // List and search every user in the system (site admin only).
20219
+ list: {
20220
+ url: '/admin/users',
20221
+ method: HTTP_METHODS.GET
20222
+ },
20223
+ // Full profile for a single user (site admin only).
20224
+ view: {
20225
+ url: '/admin/users/{user_id}',
20226
+ method: HTTP_METHODS.GET
20227
+ },
20228
+ // Securely impersonate a user (super admin only, audited).
20229
+ impersonate: {
20230
+ url: '/admin/users/impersonate',
20231
+ method: HTTP_METHODS.POST
20232
+ },
20233
+ };
20234
+ return AdminUsersRoute;
20235
+ }());
20236
+
20237
+ /**
20238
+ * Site-administrator user management.
20239
+ *
20240
+ * These endpoints back the admin dashboard user directory. They require a
20241
+ * site-admin auth token (Super Administrator or Administrator), and
20242
+ * impersonation additionally requires a Super Administrator token.
20243
+ */
20244
+ var AdminUsers = /** @class */ (function () {
20245
+ function AdminUsers() {
20246
+ }
20247
+ /**
20248
+ * List and search all users in the system.
20249
+ *
20250
+ * Supported params include `search` (matches name, username, email, or id),
20251
+ * `is_site_admin`, `is_verified`, `sort_by`, `sort_order`, `per_page`, and
20252
+ * `page`.
20253
+ *
20254
+ * @param params Optional query parameters.
20255
+ * @returns promise
20256
+ */
20257
+ AdminUsers.list = function (params) {
20258
+ return Requests.processRoute(AdminUsersRoute.routes.list, undefined, undefined, params);
20259
+ };
20260
+ /**
20261
+ * Retrieve a comprehensive profile for a single user, including communities,
20262
+ * administered titles, games played, roles, billing status, social presence,
20263
+ * and activity counts.
20264
+ *
20265
+ * @param user_id The id of the user to view.
20266
+ * @param params Optional query parameters.
20267
+ * @returns promise
20268
+ */
20269
+ AdminUsers.view = function (user_id, params) {
20270
+ return Requests.processRoute(AdminUsersRoute.routes.view, undefined, { user_id: user_id }, params);
20271
+ };
20272
+ /**
20273
+ * Impersonate a user. Issues a JWT for the target account so a Super
20274
+ * Administrator can operate as that user. Administrator accounts cannot be
20275
+ * impersonated, and every call is written to the impersonation audit log.
20276
+ *
20277
+ * @param user_id The id of the user to impersonate.
20278
+ * @returns promise resolving to an access token and the impersonated user summary.
20279
+ */
20280
+ AdminUsers.impersonate = function (user_id) {
20281
+ return Requests.processRoute(AdminUsersRoute.routes.impersonate, { user_id: user_id });
20282
+ };
20283
+ return AdminUsers;
20284
+ }());
20285
+
20214
20286
  var MarketResearchRoute = /** @class */ (function () {
20215
20287
  function MarketResearchRoute() {
20216
20288
  }
@@ -20797,6 +20869,7 @@ var Glitch = /** @class */ (function () {
20797
20869
  Mcp: Mcp,
20798
20870
  PrDirectory: PrDirectory,
20799
20871
  AdminReports: AdminReports,
20872
+ AdminUsers: AdminUsers,
20800
20873
  MarketResearch: MarketResearch,
20801
20874
  };
20802
20875
  Glitch.util = {