glitch-javascript-sdk 3.2.30 → 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.
- package/dist/cjs/index.js +101 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/AdminUsers.d.ts +42 -0
- package/dist/esm/api/Crm.d.ts +16 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +101 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/AdminUsersRoute.d.ts +7 -0
- package/dist/index.d.ts +57 -0
- package/package.json +1 -1
- package/src/api/AdminUsers.ts +54 -0
- package/src/api/Crm.ts +28 -0
- package/src/api/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/routes/AdminUsersRoute.ts +24 -0
- package/src/routes/CrmRoute.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -8537,6 +8537,22 @@ declare class Crm {
|
|
|
8537
8537
|
* Import uploaded festival submission sheets into External Games and CRM leads/contacts.
|
|
8538
8538
|
*/
|
|
8539
8539
|
static importFestivalSubmissions<T>(files: Array<File | Blob>, options?: Record<string, any>, onUploadProgress?: (progressEvent: AxiosProgressEvent) => void): AxiosPromise<Response<T>>;
|
|
8540
|
+
/**
|
|
8541
|
+
* List saved recurring Google Sheet sources for festival submission imports.
|
|
8542
|
+
*/
|
|
8543
|
+
static listFestivalSubmissionSources<T>(): AxiosPromise<Response<T>>;
|
|
8544
|
+
/**
|
|
8545
|
+
* Save a recurring Google Sheet source for festival submission imports.
|
|
8546
|
+
*/
|
|
8547
|
+
static createFestivalSubmissionSource<T>(data: object): AxiosPromise<Response<T>>;
|
|
8548
|
+
/**
|
|
8549
|
+
* Update a recurring Google Sheet source for festival submission imports.
|
|
8550
|
+
*/
|
|
8551
|
+
static updateFestivalSubmissionSource<T>(source_id: string, data: object): AxiosPromise<Response<T>>;
|
|
8552
|
+
/**
|
|
8553
|
+
* Delete a recurring Google Sheet source for festival submission imports.
|
|
8554
|
+
*/
|
|
8555
|
+
static deleteFestivalSubmissionSource<T>(source_id: string): AxiosPromise<Response<T>>;
|
|
8540
8556
|
/**
|
|
8541
8557
|
* List provider-managed sender and reply-to addresses for CRM campaigns.
|
|
8542
8558
|
*/
|
|
@@ -10341,6 +10357,46 @@ declare class AdminReports {
|
|
|
10341
10357
|
static steam<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10342
10358
|
}
|
|
10343
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
|
+
|
|
10344
10400
|
declare class MarketResearch {
|
|
10345
10401
|
static access<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10346
10402
|
static filterOptions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
@@ -10718,6 +10774,7 @@ declare class Glitch {
|
|
|
10718
10774
|
Mcp: typeof Mcp;
|
|
10719
10775
|
PrDirectory: typeof PrDirectory;
|
|
10720
10776
|
AdminReports: typeof AdminReports;
|
|
10777
|
+
AdminUsers: typeof AdminUsers;
|
|
10721
10778
|
MarketResearch: typeof MarketResearch;
|
|
10722
10779
|
};
|
|
10723
10780
|
static util: {
|
package/package.json
CHANGED
|
@@ -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/Crm.ts
CHANGED
|
@@ -295,6 +295,34 @@ class Crm {
|
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
/**
|
|
299
|
+
* List saved recurring Google Sheet sources for festival submission imports.
|
|
300
|
+
*/
|
|
301
|
+
public static listFestivalSubmissionSources<T>(): AxiosPromise<Response<T>> {
|
|
302
|
+
return Requests.processRoute(CrmRoute.routes.listFestivalSubmissionSources);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Save a recurring Google Sheet source for festival submission imports.
|
|
307
|
+
*/
|
|
308
|
+
public static createFestivalSubmissionSource<T>(data: object): AxiosPromise<Response<T>> {
|
|
309
|
+
return Requests.processRoute(CrmRoute.routes.createFestivalSubmissionSource, data);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Update a recurring Google Sheet source for festival submission imports.
|
|
314
|
+
*/
|
|
315
|
+
public static updateFestivalSubmissionSource<T>(source_id: string, data: object): AxiosPromise<Response<T>> {
|
|
316
|
+
return Requests.processRoute(CrmRoute.routes.updateFestivalSubmissionSource, data, { source_id });
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Delete a recurring Google Sheet source for festival submission imports.
|
|
321
|
+
*/
|
|
322
|
+
public static deleteFestivalSubmissionSource<T>(source_id: string): AxiosPromise<Response<T>> {
|
|
323
|
+
return Requests.processRoute(CrmRoute.routes.deleteFestivalSubmissionSource, {}, { source_id });
|
|
324
|
+
}
|
|
325
|
+
|
|
298
326
|
/**
|
|
299
327
|
* List provider-managed sender and reply-to addresses for CRM campaigns.
|
|
300
328
|
*/
|
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;
|
package/src/routes/CrmRoute.ts
CHANGED
|
@@ -43,6 +43,10 @@ class CrmRoute {
|
|
|
43
43
|
importCampaignProspects: { url: '/admin/crm/campaigns/import-prospects', method: HTTP_METHODS.POST },
|
|
44
44
|
previewFestivalSubmissionImport: { url: '/admin/crm/imports/festival-submissions/preview', method: HTTP_METHODS.POST },
|
|
45
45
|
importFestivalSubmissions: { url: '/admin/crm/imports/festival-submissions', method: HTTP_METHODS.POST },
|
|
46
|
+
listFestivalSubmissionSources: { url: '/admin/crm/imports/festival-submissions/sources', method: HTTP_METHODS.GET },
|
|
47
|
+
createFestivalSubmissionSource: { url: '/admin/crm/imports/festival-submissions/sources', method: HTTP_METHODS.POST },
|
|
48
|
+
updateFestivalSubmissionSource: { url: '/admin/crm/imports/festival-submissions/sources/{source_id}', method: HTTP_METHODS.PUT },
|
|
49
|
+
deleteFestivalSubmissionSource: { url: '/admin/crm/imports/festival-submissions/sources/{source_id}', method: HTTP_METHODS.DELETE },
|
|
46
50
|
listEmailProviderAddresses: { url: '/admin/crm/email-provider-addresses', method: HTTP_METHODS.GET },
|
|
47
51
|
getEmailProviderAddressOptions: { url: '/admin/crm/email-provider-addresses/options', method: HTTP_METHODS.GET },
|
|
48
52
|
createEmailProviderAddress: { url: '/admin/crm/email-provider-addresses', method: HTTP_METHODS.POST },
|