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,7 @@
1
+ import Route from "./interface";
2
+ declare class AdminUsersRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default AdminUsersRoute;
package/dist/index.d.ts CHANGED
@@ -10357,6 +10357,46 @@ declare class AdminReports {
10357
10357
  static steam<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
10358
10358
  }
10359
10359
 
10360
+ /**
10361
+ * Site-administrator user management.
10362
+ *
10363
+ * These endpoints back the admin dashboard user directory. They require a
10364
+ * site-admin auth token (Super Administrator or Administrator), and
10365
+ * impersonation additionally requires a Super Administrator token.
10366
+ */
10367
+ declare class AdminUsers {
10368
+ /**
10369
+ * List and search all users in the system.
10370
+ *
10371
+ * Supported params include `search` (matches name, username, email, or id),
10372
+ * `is_site_admin`, `is_verified`, `sort_by`, `sort_order`, `per_page`, and
10373
+ * `page`.
10374
+ *
10375
+ * @param params Optional query parameters.
10376
+ * @returns promise
10377
+ */
10378
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
10379
+ /**
10380
+ * Retrieve a comprehensive profile for a single user, including communities,
10381
+ * administered titles, games played, roles, billing status, social presence,
10382
+ * and activity counts.
10383
+ *
10384
+ * @param user_id The id of the user to view.
10385
+ * @param params Optional query parameters.
10386
+ * @returns promise
10387
+ */
10388
+ static view<T>(user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
10389
+ /**
10390
+ * Impersonate a user. Issues a JWT for the target account so a Super
10391
+ * Administrator can operate as that user. Administrator accounts cannot be
10392
+ * impersonated, and every call is written to the impersonation audit log.
10393
+ *
10394
+ * @param user_id The id of the user to impersonate.
10395
+ * @returns promise resolving to an access token and the impersonated user summary.
10396
+ */
10397
+ static impersonate<T>(user_id: string): AxiosPromise<Response<T>>;
10398
+ }
10399
+
10360
10400
  declare class MarketResearch {
10361
10401
  static access<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
10362
10402
  static filterOptions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
@@ -10734,6 +10774,7 @@ declare class Glitch {
10734
10774
  Mcp: typeof Mcp;
10735
10775
  PrDirectory: typeof PrDirectory;
10736
10776
  AdminReports: typeof AdminReports;
10777
+ AdminUsers: typeof AdminUsers;
10737
10778
  MarketResearch: typeof MarketResearch;
10738
10779
  };
10739
10780
  static util: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.2.31",
3
+ "version": "3.2.32",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,54 @@
1
+ import AdminUsersRoute from "../routes/AdminUsersRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ /**
7
+ * Site-administrator user management.
8
+ *
9
+ * These endpoints back the admin dashboard user directory. They require a
10
+ * site-admin auth token (Super Administrator or Administrator), and
11
+ * impersonation additionally requires a Super Administrator token.
12
+ */
13
+ class AdminUsers {
14
+ /**
15
+ * List and search all users in the system.
16
+ *
17
+ * Supported params include `search` (matches name, username, email, or id),
18
+ * `is_site_admin`, `is_verified`, `sort_by`, `sort_order`, `per_page`, and
19
+ * `page`.
20
+ *
21
+ * @param params Optional query parameters.
22
+ * @returns promise
23
+ */
24
+ public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
25
+ return Requests.processRoute(AdminUsersRoute.routes.list, undefined, undefined, params);
26
+ }
27
+
28
+ /**
29
+ * Retrieve a comprehensive profile for a single user, including communities,
30
+ * administered titles, games played, roles, billing status, social presence,
31
+ * and activity counts.
32
+ *
33
+ * @param user_id The id of the user to view.
34
+ * @param params Optional query parameters.
35
+ * @returns promise
36
+ */
37
+ public static view<T>(user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
38
+ return Requests.processRoute(AdminUsersRoute.routes.view, undefined, { user_id: user_id }, params);
39
+ }
40
+
41
+ /**
42
+ * Impersonate a user. Issues a JWT for the target account so a Super
43
+ * Administrator can operate as that user. Administrator accounts cannot be
44
+ * impersonated, and every call is written to the impersonation audit log.
45
+ *
46
+ * @param user_id The id of the user to impersonate.
47
+ * @returns promise resolving to an access token and the impersonated user summary.
48
+ */
49
+ public static impersonate<T>(user_id: string): AxiosPromise<Response<T>> {
50
+ return Requests.processRoute(AdminUsersRoute.routes.impersonate, { user_id: user_id });
51
+ }
52
+ }
53
+
54
+ export default AdminUsers;
package/src/api/index.ts CHANGED
@@ -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
 
54
55
  export {Ads};
@@ -102,4 +103,5 @@ export {Agents};
102
103
  export {Mcp};
103
104
  export {PrDirectory};
104
105
  export {AdminReports};
106
+ export {AdminUsers};
105
107
  export {MarketResearch};
package/src/index.ts CHANGED
@@ -53,6 +53,7 @@ import {Agents} from './api';
53
53
  import {Mcp} from './api';
54
54
  import {PrDirectory} from './api';
55
55
  import {AdminReports} from './api';
56
+ import {AdminUsers} from './api';
56
57
  import {MarketResearch} from './api';
57
58
 
58
59
  import Requests from "./util/Requests";
@@ -136,6 +137,7 @@ class Glitch {
136
137
  Mcp : Mcp,
137
138
  PrDirectory : PrDirectory,
138
139
  AdminReports : AdminReports,
140
+ AdminUsers : AdminUsers,
139
141
  MarketResearch : MarketResearch,
140
142
  }
141
143
 
@@ -0,0 +1,24 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class AdminUsersRoute {
5
+ public static routes: { [key: string]: Route } = {
6
+ // List and search every user in the system (site admin only).
7
+ list: {
8
+ url: '/admin/users',
9
+ method: HTTP_METHODS.GET
10
+ },
11
+ // Full profile for a single user (site admin only).
12
+ view: {
13
+ url: '/admin/users/{user_id}',
14
+ method: HTTP_METHODS.GET
15
+ },
16
+ // Securely impersonate a user (super admin only, audited).
17
+ impersonate: {
18
+ url: '/admin/users/impersonate',
19
+ method: HTTP_METHODS.POST
20
+ },
21
+ };
22
+ }
23
+
24
+ export default AdminUsersRoute;