glitch-javascript-sdk 3.2.31 → 3.3.0

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 CHANGED
@@ -31056,6 +31056,28 @@ var MultiplayerRoute = /** @class */ (function () {
31056
31056
  listFavorites: { url: '/titles/{title_id}/multiplayer/favorites', method: HTTP_METHODS.GET },
31057
31057
  addFavorite: { url: '/titles/{title_id}/multiplayer/favorites', method: HTTP_METHODS.POST },
31058
31058
  deleteFavorite: { url: '/titles/{title_id}/multiplayer/favorites/{favorite_id}', method: HTTP_METHODS.DELETE },
31059
+ // MMO world layer: realms, zones, instances, presence.
31060
+ listRealms: { url: '/titles/{title_id}/multiplayer/realms', method: HTTP_METHODS.GET },
31061
+ createRealm: { url: '/titles/{title_id}/multiplayer/realms', method: HTTP_METHODS.POST },
31062
+ showRealm: { url: '/titles/{title_id}/multiplayer/realms/{realm_id}', method: HTTP_METHODS.GET },
31063
+ updateRealm: { url: '/titles/{title_id}/multiplayer/realms/{realm_id}', method: HTTP_METHODS.PUT },
31064
+ listZones: { url: '/titles/{title_id}/multiplayer/realms/{realm_id}/zones', method: HTTP_METHODS.GET },
31065
+ createZone: { url: '/titles/{title_id}/multiplayer/realms/{realm_id}/zones', method: HTTP_METHODS.POST },
31066
+ listInstances: { url: '/titles/{title_id}/multiplayer/zones/{zone_id}/instances', method: HTTP_METHODS.GET },
31067
+ showInstance: { url: '/titles/{title_id}/multiplayer/instances/{instance_id}', method: HTTP_METHODS.GET },
31068
+ listInstancePresence: { url: '/titles/{title_id}/multiplayer/instances/{instance_id}/presence', method: HTTP_METHODS.GET },
31069
+ enterZone: { url: '/titles/{title_id}/multiplayer/world/enter', method: HTTP_METHODS.POST },
31070
+ updatePresence: { url: '/titles/{title_id}/multiplayer/world/presence', method: HTTP_METHODS.POST },
31071
+ leaveWorld: { url: '/titles/{title_id}/multiplayer/world/leave', method: HTTP_METHODS.POST },
31072
+ // Ticketed matchmaking.
31073
+ enqueueTicket: { url: '/titles/{title_id}/multiplayer/matchmaking/tickets', method: HTTP_METHODS.POST },
31074
+ showTicket: { url: '/titles/{title_id}/multiplayer/matchmaking/tickets/{ticket_id}', method: HTTP_METHODS.GET },
31075
+ cancelTicket: { url: '/titles/{title_id}/multiplayer/matchmaking/tickets/{ticket_id}', method: HTTP_METHODS.DELETE },
31076
+ // Real-time negotiate + trust/moderation.
31077
+ negotiateRealtime: { url: '/titles/{title_id}/multiplayer/realtime/negotiate', method: HTTP_METHODS.POST },
31078
+ listBans: { url: '/titles/{title_id}/multiplayer/bans', method: HTTP_METHODS.GET },
31079
+ createBan: { url: '/titles/{title_id}/multiplayer/bans', method: HTTP_METHODS.POST },
31080
+ deleteBan: { url: '/titles/{title_id}/multiplayer/bans/{ban_id}', method: HTTP_METHODS.DELETE },
31059
31081
  };
31060
31082
  return MultiplayerRoute;
31061
31083
  }());
@@ -31556,6 +31578,231 @@ var Multiplayer = /** @class */ (function () {
31556
31578
  Multiplayer.deleteFavorite = function (title_id, favorite_id, params) {
31557
31579
  return Requests.processRoute(MultiplayerRoute.routes.deleteFavorite, undefined, { title_id: title_id, favorite_id: favorite_id }, params);
31558
31580
  };
31581
+ // -----------------------------------------------------------------------
31582
+ // MMO world layer
31583
+ // -----------------------------------------------------------------------
31584
+ /**
31585
+ * List realms (persistent world shards) so a player can choose where to log in.
31586
+ *
31587
+ * @param title_id Title UUID.
31588
+ * @param params Optional region/status filters; recommended realms sort first.
31589
+ * @example
31590
+ * Multiplayer.listRealms('title-uuid', { region: 'us-central', status: 'active' });
31591
+ */
31592
+ Multiplayer.listRealms = function (title_id, params) {
31593
+ return Requests.processRoute(MultiplayerRoute.routes.listRealms, undefined, { title_id: title_id }, params);
31594
+ };
31595
+ /**
31596
+ * Create a realm. Requires a title administrator JWT.
31597
+ *
31598
+ * @param title_id Title UUID.
31599
+ * @param data Realm configuration.
31600
+ * @example
31601
+ * Multiplayer.createRealm('title-uuid', { name: 'Aurora', region: 'us-central', population_cap: 5000, recommended: true });
31602
+ */
31603
+ Multiplayer.createRealm = function (title_id, data) {
31604
+ return Requests.processRoute(MultiplayerRoute.routes.createRealm, data, { title_id: title_id });
31605
+ };
31606
+ /**
31607
+ * Retrieve a single realm.
31608
+ *
31609
+ * @param title_id Title UUID.
31610
+ * @param realm_id Realm UUID.
31611
+ */
31612
+ Multiplayer.showRealm = function (title_id, realm_id) {
31613
+ return Requests.processRoute(MultiplayerRoute.routes.showRealm, undefined, { title_id: title_id, realm_id: realm_id });
31614
+ };
31615
+ /**
31616
+ * Update a realm (status, population cap, ruleset). Requires a title admin JWT.
31617
+ *
31618
+ * @param title_id Title UUID.
31619
+ * @param realm_id Realm UUID.
31620
+ * @param data Fields to update.
31621
+ */
31622
+ Multiplayer.updateRealm = function (title_id, realm_id, data) {
31623
+ return Requests.processRoute(MultiplayerRoute.routes.updateRealm, data, { title_id: title_id, realm_id: realm_id });
31624
+ };
31625
+ /**
31626
+ * List the zones defined for a realm.
31627
+ *
31628
+ * @param title_id Title UUID.
31629
+ * @param realm_id Realm UUID.
31630
+ * @param params Optional zone_type filter.
31631
+ */
31632
+ Multiplayer.listZones = function (title_id, realm_id, params) {
31633
+ return Requests.processRoute(MultiplayerRoute.routes.listZones, undefined, { title_id: title_id, realm_id: realm_id }, params);
31634
+ };
31635
+ /**
31636
+ * Create a zone in a realm. Requires a title administrator JWT.
31637
+ *
31638
+ * @param title_id Title UUID.
31639
+ * @param realm_id Realm UUID.
31640
+ * @param data Zone configuration, including interest-management grid cell size.
31641
+ * @example
31642
+ * Multiplayer.createZone('title-uuid', 'realm-uuid', {
31643
+ * zone_key: 'ashfall_valley',
31644
+ * display_name: 'Ashfall Valley',
31645
+ * zone_type: 'overworld',
31646
+ * max_players_per_instance: 100,
31647
+ * grid_cell_size: 64
31648
+ * });
31649
+ */
31650
+ Multiplayer.createZone = function (title_id, realm_id, data) {
31651
+ return Requests.processRoute(MultiplayerRoute.routes.createZone, data, { title_id: title_id, realm_id: realm_id });
31652
+ };
31653
+ /**
31654
+ * List the active/other instances (runtime copies) of a zone.
31655
+ *
31656
+ * @param title_id Title UUID.
31657
+ * @param zone_id Zone UUID.
31658
+ * @param params Optional state filter.
31659
+ */
31660
+ Multiplayer.listInstances = function (title_id, zone_id, params) {
31661
+ return Requests.processRoute(MultiplayerRoute.routes.listInstances, undefined, { title_id: title_id, zone_id: zone_id }, params);
31662
+ };
31663
+ /**
31664
+ * Retrieve a single instance.
31665
+ *
31666
+ * @param title_id Title UUID.
31667
+ * @param instance_id Instance UUID.
31668
+ */
31669
+ Multiplayer.showInstance = function (title_id, instance_id) {
31670
+ return Requests.processRoute(MultiplayerRoute.routes.showInstance, undefined, { title_id: title_id, instance_id: instance_id });
31671
+ };
31672
+ /**
31673
+ * List players present in an instance. Pass grid_cell (and optional radius) to
31674
+ * receive only players in the caller's area of interest — the key to keeping
31675
+ * per-player fan-out bounded regardless of how populated the zone is.
31676
+ *
31677
+ * @param title_id Title UUID.
31678
+ * @param instance_id Instance UUID.
31679
+ * @param params grid_cell "cx:cy" and radius (0-4) to scope the query.
31680
+ * @example
31681
+ * Multiplayer.listInstancePresence('title-uuid', 'instance-uuid', { grid_cell: '12:8', radius: 1 });
31682
+ */
31683
+ Multiplayer.listInstancePresence = function (title_id, instance_id, params) {
31684
+ return Requests.processRoute(MultiplayerRoute.routes.listInstancePresence, undefined, { title_id: title_id, instance_id: instance_id }, params);
31685
+ };
31686
+ /**
31687
+ * Enter a zone. The backend places the player into an active instance with
31688
+ * capacity (creating a new layer if all are full), enforces bans and realm
31689
+ * capacity, and upserts presence. Returns the instance and presence so the
31690
+ * client can connect and subscribe to the instance's real-time group.
31691
+ *
31692
+ * @param title_id Title UUID.
31693
+ * @param data Realm/zone target plus optional spawn position and metadata.
31694
+ * @example
31695
+ * Multiplayer.enterZone('title-uuid', {
31696
+ * player_id: 'steam:765...',
31697
+ * realm_id: 'realm-uuid',
31698
+ * zone_id: 'zone-uuid',
31699
+ * pos_x: 128.0, pos_z: 64.0
31700
+ * });
31701
+ */
31702
+ Multiplayer.enterZone = function (title_id, data) {
31703
+ return Requests.processRoute(MultiplayerRoute.routes.enterZone, data, { title_id: title_id });
31704
+ };
31705
+ /**
31706
+ * Update presence (position, heading, rich status) and refresh the TTL. Call
31707
+ * on a movement interval and on notable state changes.
31708
+ *
31709
+ * @param title_id Title UUID.
31710
+ * @param data New position/status for the player.
31711
+ */
31712
+ Multiplayer.updatePresence = function (title_id, data) {
31713
+ return Requests.processRoute(MultiplayerRoute.routes.updatePresence, data, { title_id: title_id });
31714
+ };
31715
+ /**
31716
+ * Leave the world. Frees the player's instance slot and realm population.
31717
+ *
31718
+ * @param title_id Title UUID.
31719
+ * @param data Optional player_id for title-token clients.
31720
+ */
31721
+ Multiplayer.leaveWorld = function (title_id, data) {
31722
+ return Requests.processRoute(MultiplayerRoute.routes.leaveWorld, data, { title_id: title_id });
31723
+ };
31724
+ // -----------------------------------------------------------------------
31725
+ // Matchmaking
31726
+ // -----------------------------------------------------------------------
31727
+ /**
31728
+ * Enqueue a matchmaking ticket. Idempotent per (queue, player): an existing
31729
+ * open ticket is returned rather than duplicated, so retries are safe. Poll
31730
+ * the ticket or subscribe to `matchmaking.matched` for the assignment.
31731
+ *
31732
+ * @param title_id Title UUID.
31733
+ * @param data Queue name plus optional party, skill, region, and attributes.
31734
+ * @example
31735
+ * Multiplayer.enqueueTicket('title-uuid', { player_id: 'steam:765...', queue: 'ranked_2v2', skill: 1840, region: 'us-central' });
31736
+ */
31737
+ Multiplayer.enqueueTicket = function (title_id, data) {
31738
+ return Requests.processRoute(MultiplayerRoute.routes.enqueueTicket, data, { title_id: title_id });
31739
+ };
31740
+ /**
31741
+ * Poll a matchmaking ticket. A queued ticket past its TTL is reported as
31742
+ * `timed_out`; a matched ticket carries the connection `assignment`.
31743
+ *
31744
+ * @param title_id Title UUID.
31745
+ * @param ticket_id Ticket UUID.
31746
+ */
31747
+ Multiplayer.showTicket = function (title_id, ticket_id) {
31748
+ return Requests.processRoute(MultiplayerRoute.routes.showTicket, undefined, { title_id: title_id, ticket_id: ticket_id });
31749
+ };
31750
+ /**
31751
+ * Cancel a queued matchmaking ticket.
31752
+ *
31753
+ * @param title_id Title UUID.
31754
+ * @param ticket_id Ticket UUID.
31755
+ */
31756
+ Multiplayer.cancelTicket = function (title_id, ticket_id) {
31757
+ return Requests.processRoute(MultiplayerRoute.routes.cancelTicket, undefined, { title_id: title_id, ticket_id: ticket_id });
31758
+ };
31759
+ // -----------------------------------------------------------------------
31760
+ // Real-time negotiate + trust/moderation
31761
+ // -----------------------------------------------------------------------
31762
+ /**
31763
+ * Negotiate a real-time push connection. Returns the authorized group names
31764
+ * and the push endpoint. When SignalR/Web PubSub is configured, an
31765
+ * access_token scoped to those groups is included; otherwise `configured` is
31766
+ * false and the client should fall back to the polling endpoints.
31767
+ *
31768
+ * @param title_id Title UUID.
31769
+ * @param data Optional player_id and the scopes (lobby/voice/zone/instance) to subscribe to.
31770
+ * @example
31771
+ * Multiplayer.negotiateRealtime('title-uuid', { player_id: 'steam:765...', scopes: [{ type: 'instance', id: 'instance-uuid' }] });
31772
+ */
31773
+ Multiplayer.negotiateRealtime = function (title_id, data) {
31774
+ return Requests.processRoute(MultiplayerRoute.routes.negotiateRealtime, data, { title_id: title_id });
31775
+ };
31776
+ /**
31777
+ * List bans for a title. Requires a title administrator JWT.
31778
+ *
31779
+ * @param title_id Title UUID.
31780
+ * @param params Optional scope/player/source filters and active_only.
31781
+ */
31782
+ Multiplayer.listBans = function (title_id, params) {
31783
+ return Requests.processRoute(MultiplayerRoute.routes.listBans, undefined, { title_id: title_id }, params);
31784
+ };
31785
+ /**
31786
+ * Ban a player at a scope (title/realm/lobby/server/voice). Requires a title
31787
+ * administrator JWT. Omit expires_at for a permanent ban.
31788
+ *
31789
+ * @param title_id Title UUID.
31790
+ * @param data Ban target and scope.
31791
+ * @example
31792
+ * Multiplayer.createBan('title-uuid', { player_id: 'steam:765...', scope: 'title', reason: 'Cheating: aimbot' });
31793
+ */
31794
+ Multiplayer.createBan = function (title_id, data) {
31795
+ return Requests.processRoute(MultiplayerRoute.routes.createBan, data, { title_id: title_id });
31796
+ };
31797
+ /**
31798
+ * Lift a ban. Requires a title administrator JWT.
31799
+ *
31800
+ * @param title_id Title UUID.
31801
+ * @param ban_id Ban UUID.
31802
+ */
31803
+ Multiplayer.deleteBan = function (title_id, ban_id) {
31804
+ return Requests.processRoute(MultiplayerRoute.routes.deleteBan, undefined, { title_id: title_id, ban_id: ban_id });
31805
+ };
31559
31806
  return Multiplayer;
31560
31807
  }());
31561
31808
 
@@ -32209,6 +32456,78 @@ var AdminReports = /** @class */ (function () {
32209
32456
  return AdminReports;
32210
32457
  }());
32211
32458
 
32459
+ var AdminUsersRoute = /** @class */ (function () {
32460
+ function AdminUsersRoute() {
32461
+ }
32462
+ AdminUsersRoute.routes = {
32463
+ // List and search every user in the system (site admin only).
32464
+ list: {
32465
+ url: '/admin/users',
32466
+ method: HTTP_METHODS.GET
32467
+ },
32468
+ // Full profile for a single user (site admin only).
32469
+ view: {
32470
+ url: '/admin/users/{user_id}',
32471
+ method: HTTP_METHODS.GET
32472
+ },
32473
+ // Securely impersonate a user (super admin only, audited).
32474
+ impersonate: {
32475
+ url: '/admin/users/impersonate',
32476
+ method: HTTP_METHODS.POST
32477
+ },
32478
+ };
32479
+ return AdminUsersRoute;
32480
+ }());
32481
+
32482
+ /**
32483
+ * Site-administrator user management.
32484
+ *
32485
+ * These endpoints back the admin dashboard user directory. They require a
32486
+ * site-admin auth token (Super Administrator or Administrator), and
32487
+ * impersonation additionally requires a Super Administrator token.
32488
+ */
32489
+ var AdminUsers = /** @class */ (function () {
32490
+ function AdminUsers() {
32491
+ }
32492
+ /**
32493
+ * List and search all users in the system.
32494
+ *
32495
+ * Supported params include `search` (matches name, username, email, or id),
32496
+ * `is_site_admin`, `is_verified`, `sort_by`, `sort_order`, `per_page`, and
32497
+ * `page`.
32498
+ *
32499
+ * @param params Optional query parameters.
32500
+ * @returns promise
32501
+ */
32502
+ AdminUsers.list = function (params) {
32503
+ return Requests.processRoute(AdminUsersRoute.routes.list, undefined, undefined, params);
32504
+ };
32505
+ /**
32506
+ * Retrieve a comprehensive profile for a single user, including communities,
32507
+ * administered titles, games played, roles, billing status, social presence,
32508
+ * and activity counts.
32509
+ *
32510
+ * @param user_id The id of the user to view.
32511
+ * @param params Optional query parameters.
32512
+ * @returns promise
32513
+ */
32514
+ AdminUsers.view = function (user_id, params) {
32515
+ return Requests.processRoute(AdminUsersRoute.routes.view, undefined, { user_id: user_id }, params);
32516
+ };
32517
+ /**
32518
+ * Impersonate a user. Issues a JWT for the target account so a Super
32519
+ * Administrator can operate as that user. Administrator accounts cannot be
32520
+ * impersonated, and every call is written to the impersonation audit log.
32521
+ *
32522
+ * @param user_id The id of the user to impersonate.
32523
+ * @returns promise resolving to an access token and the impersonated user summary.
32524
+ */
32525
+ AdminUsers.impersonate = function (user_id) {
32526
+ return Requests.processRoute(AdminUsersRoute.routes.impersonate, { user_id: user_id });
32527
+ };
32528
+ return AdminUsers;
32529
+ }());
32530
+
32212
32531
  var MarketResearchRoute = /** @class */ (function () {
32213
32532
  function MarketResearchRoute() {
32214
32533
  }
@@ -32795,6 +33114,7 @@ var Glitch = /** @class */ (function () {
32795
33114
  Mcp: Mcp,
32796
33115
  PrDirectory: PrDirectory,
32797
33116
  AdminReports: AdminReports,
33117
+ AdminUsers: AdminUsers,
32798
33118
  MarketResearch: MarketResearch,
32799
33119
  };
32800
33120
  Glitch.util = {