glitch-javascript-sdk 1.0.2 → 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.
@@ -0,0 +1,29 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Games {
4
+ /**
5
+ * Get a list of Games available on he platform.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGames
8
+ *
9
+ * @returns promise
10
+ */
11
+ static listGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Retrieve information on a single game.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGameById
16
+ *
17
+ * @returns promise
18
+ */
19
+ static viewGame<T>(game_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Generates campaign data for this game.
22
+ *
23
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/generateCampaign
24
+ *
25
+ * @returns promise
26
+ */
27
+ static createCampaignData<T>(game_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
28
+ }
29
+ export default Games;
@@ -20,6 +20,7 @@ import Subscriptions from "./Subscriptions";
20
20
  import Messages from "./Messages";
21
21
  import Feedback from "./Feedback";
22
22
  import Influencers from "./Influencers";
23
+ import Games from "./Games";
23
24
  export { Auth };
24
25
  export { Competitions };
25
26
  export { Communities };
@@ -42,3 +43,4 @@ export { Subscriptions };
42
43
  export { Messages };
43
44
  export { Feedback };
44
45
  export { Influencers };
46
+ export { Games };
@@ -20,6 +20,7 @@ import { Subscriptions } from "./api";
20
20
  import { Messages } from "./api";
21
21
  import { Feedback } from "./api";
22
22
  import { Influencers } from "./api";
23
+ import { Games } from "./api";
23
24
  import Requests from "./util/Requests";
24
25
  import Parser from "./util/Parser";
25
26
  import Session from "./util/Session";
@@ -45,6 +46,7 @@ declare class Glitch {
45
46
  Communities: typeof Communities;
46
47
  Users: typeof Users;
47
48
  Events: typeof Events;
49
+ Games: typeof Games;
48
50
  Feedback: typeof Feedback;
49
51
  Influencers: typeof Influencers;
50
52
  Teams: typeof Teams;
package/dist/esm/index.js CHANGED
@@ -9867,6 +9867,53 @@ var Influencers = /** @class */ (function () {
9867
9867
  return Influencers;
9868
9868
  }());
9869
9869
 
9870
+ var GamesRoutes = /** @class */ (function () {
9871
+ function GamesRoutes() {
9872
+ }
9873
+ GamesRoutes.routes = {
9874
+ listGames: { url: '/games', method: HTTP_METHODS.GET },
9875
+ viewGame: { url: '/games/{game_id}', method: HTTP_METHODS.GET },
9876
+ createCampaignData: { url: '/games/{game_id}/generateCampaign', method: HTTP_METHODS.POST },
9877
+ };
9878
+ return GamesRoutes;
9879
+ }());
9880
+
9881
+ var Games = /** @class */ (function () {
9882
+ function Games() {
9883
+ }
9884
+ /**
9885
+ * Get a list of Games available on he platform.
9886
+ *
9887
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGames
9888
+ *
9889
+ * @returns promise
9890
+ */
9891
+ Games.listGames = function (params) {
9892
+ return Requests.processRoute(GamesRoutes.routes.listGames, undefined, undefined, params);
9893
+ };
9894
+ /**
9895
+ * Retrieve information on a single game.
9896
+ *
9897
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGameById
9898
+ *
9899
+ * @returns promise
9900
+ */
9901
+ Games.viewGame = function (game_id, params) {
9902
+ return Requests.processRoute(GamesRoutes.routes.viewGame, undefined, { game_id: game_id }, params);
9903
+ };
9904
+ /**
9905
+ * Generates campaign data for this game.
9906
+ *
9907
+ * @see https://api.glitch.fun/api/documentation#/ExternalGames/generateCampaign
9908
+ *
9909
+ * @returns promise
9910
+ */
9911
+ Games.createCampaignData = function (game_id, data, params) {
9912
+ return Requests.processRoute(GamesRoutes.routes.createCampaignData, data, { game_id: game_id }, params);
9913
+ };
9914
+ return Games;
9915
+ }());
9916
+
9870
9917
  var Parser = /** @class */ (function () {
9871
9918
  function Parser() {
9872
9919
  }
@@ -10270,6 +10317,7 @@ var Glitch = /** @class */ (function () {
10270
10317
  Communities: Communities,
10271
10318
  Users: Users,
10272
10319
  Events: Events,
10320
+ Games: Games,
10273
10321
  Feedback: Feedback,
10274
10322
  Influencers: Influencers,
10275
10323
  Teams: Teams,