glitch-javascript-sdk 1.0.1 → 1.0.3

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
@@ -18900,12 +18900,16 @@ var Config = /** @class */ (function () {
18900
18900
  LabelManager.initialize(community);
18901
18901
  };
18902
18902
  /**
18903
- * Sets the root level domain so data can accessed across
18903
+ * Sets the root level domain so data can be accessed across
18904
18904
  * multiple subdomains
18905
18905
  *
18906
18906
  * @param domain The domain ie: example.com
18907
18907
  */
18908
18908
  Config.setRootDomain = function (domain) {
18909
+ if (!domain) {
18910
+ console.error("setRootDomain: domain is undefined or null");
18911
+ return;
18912
+ }
18909
18913
  var parts = domain.split('.');
18910
18914
  if (parts.length > 2) {
18911
18915
  parts.shift();
@@ -23047,6 +23051,53 @@ var Influencers = /** @class */ (function () {
23047
23051
  return Influencers;
23048
23052
  }());
23049
23053
 
23054
+ var GamesRoutes = /** @class */ (function () {
23055
+ function GamesRoutes() {
23056
+ }
23057
+ GamesRoutes.routes = {
23058
+ listGames: { url: '/games', method: HTTP_METHODS.GET },
23059
+ viewGame: { url: '/games/{game_id}', method: HTTP_METHODS.GET },
23060
+ createCampaignData: { url: '/games/{game_id}/generateCampaign', method: HTTP_METHODS.POST },
23061
+ };
23062
+ return GamesRoutes;
23063
+ }());
23064
+
23065
+ var Games = /** @class */ (function () {
23066
+ function Games() {
23067
+ }
23068
+ /**
23069
+ * Get a list of Games available on he platform.
23070
+ *
23071
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGames
23072
+ *
23073
+ * @returns promise
23074
+ */
23075
+ Games.listGames = function (params) {
23076
+ return Requests.processRoute(GamesRoutes.routes.listGames, undefined, undefined, params);
23077
+ };
23078
+ /**
23079
+ * Retrieve information on a single game.
23080
+ *
23081
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGameById
23082
+ *
23083
+ * @returns promise
23084
+ */
23085
+ Games.viewGame = function (game_id, params) {
23086
+ return Requests.processRoute(GamesRoutes.routes.viewGame, undefined, { game_id: game_id }, params);
23087
+ };
23088
+ /**
23089
+ * Generates campaign data for this game.
23090
+ *
23091
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/generateCampaign
23092
+ *
23093
+ * @returns promise
23094
+ */
23095
+ Games.createCampaignData = function (game_id, data, params) {
23096
+ return Requests.processRoute(GamesRoutes.routes.createCampaignData, data, { game_id: game_id }, params);
23097
+ };
23098
+ return Games;
23099
+ }());
23100
+
23050
23101
  var Parser = /** @class */ (function () {
23051
23102
  function Parser() {
23052
23103
  }
@@ -23450,6 +23501,7 @@ var Glitch = /** @class */ (function () {
23450
23501
  Communities: Communities,
23451
23502
  Users: Users,
23452
23503
  Events: Events,
23504
+ Games: Games,
23453
23505
  Feedback: Feedback,
23454
23506
  Influencers: Influencers,
23455
23507
  Teams: Teams,