glitch-javascript-sdk 1.0.2 → 1.0.4
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 +73 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Games.d.ts +29 -0
- package/dist/esm/api/Influencers.d.ts +8 -0
- package/dist/esm/api/Users.d.ts +11 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +73 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/GamesRoutes.d.ts +7 -0
- package/dist/index.d.ts +47 -0
- package/package.json +1 -1
- package/src/api/Games.ts +43 -0
- package/src/api/Influencers.ts +11 -0
- package/src/api/Users.ts +16 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/GamesRoutes.ts +14 -0
- package/src/routes/InfluencerRoutes.ts +2 -0
- package/src/routes/UserRoutes.ts +1 -0
|
@@ -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;
|
|
@@ -17,5 +17,13 @@ declare class Influencers {
|
|
|
17
17
|
* @returns promise
|
|
18
18
|
*/
|
|
19
19
|
static viewInfluencer<T>(influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a profile for an influencer based on their data.
|
|
22
|
+
*
|
|
23
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/generateInfluencerProfile
|
|
24
|
+
*
|
|
25
|
+
* @returns promise
|
|
26
|
+
*/
|
|
27
|
+
static generateProfile<T>(influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
28
|
}
|
|
21
29
|
export default Influencers;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -63,6 +63,17 @@ declare class Users {
|
|
|
63
63
|
* @returns promise
|
|
64
64
|
*/
|
|
65
65
|
static syncInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
66
|
+
/**
|
|
67
|
+
* Create profile data for an influencer based on their synced information and social media posts.
|
|
68
|
+
*
|
|
69
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/generateUserInfluencerProfile
|
|
70
|
+
*
|
|
71
|
+
* @param user_id The id of the user to update.
|
|
72
|
+
* @param data The data to update.
|
|
73
|
+
*
|
|
74
|
+
* @returns promise
|
|
75
|
+
*/
|
|
76
|
+
static generateInfluencerProfile<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
66
77
|
/**
|
|
67
78
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
68
79
|
*
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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
|
@@ -6916,6 +6916,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
6916
6916
|
profile: { url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
|
|
6917
6917
|
me: { url: '/users/me', method: HTTP_METHODS.GET },
|
|
6918
6918
|
syncInfluencer: { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
|
|
6919
|
+
generateInfluencerProfile: { url: '/users/generateInfluencerProfile', method: HTTP_METHODS.POST },
|
|
6919
6920
|
oneTimeToken: { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
|
|
6920
6921
|
uploadAvatar: { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
|
|
6921
6922
|
uploadBanner: { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
@@ -7022,6 +7023,19 @@ var Users = /** @class */ (function () {
|
|
|
7022
7023
|
Users.syncInfluencer = function (params) {
|
|
7023
7024
|
return Requests.processRoute(UserRoutes.routes.syncInfluencer, {}, undefined, params);
|
|
7024
7025
|
};
|
|
7026
|
+
/**
|
|
7027
|
+
* Create profile data for an influencer based on their synced information and social media posts.
|
|
7028
|
+
*
|
|
7029
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/generateUserInfluencerProfile
|
|
7030
|
+
*
|
|
7031
|
+
* @param user_id The id of the user to update.
|
|
7032
|
+
* @param data The data to update.
|
|
7033
|
+
*
|
|
7034
|
+
* @returns promise
|
|
7035
|
+
*/
|
|
7036
|
+
Users.generateInfluencerProfile = function (params) {
|
|
7037
|
+
return Requests.processRoute(UserRoutes.routes.generateInfluencerProfile, {}, undefined, params);
|
|
7038
|
+
};
|
|
7025
7039
|
/**
|
|
7026
7040
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
7027
7041
|
*
|
|
@@ -9837,6 +9851,7 @@ var InfluencerRoutes = /** @class */ (function () {
|
|
|
9837
9851
|
InfluencerRoutes.routes = {
|
|
9838
9852
|
listInfluencers: { url: '/influencers', method: HTTP_METHODS.GET },
|
|
9839
9853
|
viewInfluencer: { url: '/influencers/{influencer_id}', method: HTTP_METHODS.GET },
|
|
9854
|
+
generateProfile: { url: '/influencers/{influencer_id}/generateProfile', method: HTTP_METHODS.POST },
|
|
9840
9855
|
};
|
|
9841
9856
|
return InfluencerRoutes;
|
|
9842
9857
|
}());
|
|
@@ -9864,9 +9879,66 @@ var Influencers = /** @class */ (function () {
|
|
|
9864
9879
|
Influencers.viewInfluencer = function (influencer_id, params) {
|
|
9865
9880
|
return Requests.processRoute(InfluencerRoutes.routes.viewInfluencer, undefined, { influencer_id: influencer_id }, params);
|
|
9866
9881
|
};
|
|
9882
|
+
/**
|
|
9883
|
+
* Generate a profile for an influencer based on their data.
|
|
9884
|
+
*
|
|
9885
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/generateInfluencerProfile
|
|
9886
|
+
*
|
|
9887
|
+
* @returns promise
|
|
9888
|
+
*/
|
|
9889
|
+
Influencers.generateProfile = function (influencer_id, params) {
|
|
9890
|
+
return Requests.processRoute(InfluencerRoutes.routes.generateProfile, undefined, { influencer_id: influencer_id }, params);
|
|
9891
|
+
};
|
|
9867
9892
|
return Influencers;
|
|
9868
9893
|
}());
|
|
9869
9894
|
|
|
9895
|
+
var GamesRoutes = /** @class */ (function () {
|
|
9896
|
+
function GamesRoutes() {
|
|
9897
|
+
}
|
|
9898
|
+
GamesRoutes.routes = {
|
|
9899
|
+
listGames: { url: '/games', method: HTTP_METHODS.GET },
|
|
9900
|
+
viewGame: { url: '/games/{game_id}', method: HTTP_METHODS.GET },
|
|
9901
|
+
createCampaignData: { url: '/games/{game_id}/generateCampaign', method: HTTP_METHODS.POST },
|
|
9902
|
+
};
|
|
9903
|
+
return GamesRoutes;
|
|
9904
|
+
}());
|
|
9905
|
+
|
|
9906
|
+
var Games = /** @class */ (function () {
|
|
9907
|
+
function Games() {
|
|
9908
|
+
}
|
|
9909
|
+
/**
|
|
9910
|
+
* Get a list of Games available on he platform.
|
|
9911
|
+
*
|
|
9912
|
+
* @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGames
|
|
9913
|
+
*
|
|
9914
|
+
* @returns promise
|
|
9915
|
+
*/
|
|
9916
|
+
Games.listGames = function (params) {
|
|
9917
|
+
return Requests.processRoute(GamesRoutes.routes.listGames, undefined, undefined, params);
|
|
9918
|
+
};
|
|
9919
|
+
/**
|
|
9920
|
+
* Retrieve information on a single game.
|
|
9921
|
+
*
|
|
9922
|
+
* @see https://api.glitch.fun/api/documentation#/ExternalGames/getExternalGameById
|
|
9923
|
+
*
|
|
9924
|
+
* @returns promise
|
|
9925
|
+
*/
|
|
9926
|
+
Games.viewGame = function (game_id, params) {
|
|
9927
|
+
return Requests.processRoute(GamesRoutes.routes.viewGame, undefined, { game_id: game_id }, params);
|
|
9928
|
+
};
|
|
9929
|
+
/**
|
|
9930
|
+
* Generates campaign data for this game.
|
|
9931
|
+
*
|
|
9932
|
+
* @see https://api.glitch.fun/api/documentation#/ExternalGames/generateCampaign
|
|
9933
|
+
*
|
|
9934
|
+
* @returns promise
|
|
9935
|
+
*/
|
|
9936
|
+
Games.createCampaignData = function (game_id, data, params) {
|
|
9937
|
+
return Requests.processRoute(GamesRoutes.routes.createCampaignData, data, { game_id: game_id }, params);
|
|
9938
|
+
};
|
|
9939
|
+
return Games;
|
|
9940
|
+
}());
|
|
9941
|
+
|
|
9870
9942
|
var Parser = /** @class */ (function () {
|
|
9871
9943
|
function Parser() {
|
|
9872
9944
|
}
|
|
@@ -10270,6 +10342,7 @@ var Glitch = /** @class */ (function () {
|
|
|
10270
10342
|
Communities: Communities,
|
|
10271
10343
|
Users: Users,
|
|
10272
10344
|
Events: Events,
|
|
10345
|
+
Games: Games,
|
|
10273
10346
|
Feedback: Feedback,
|
|
10274
10347
|
Influencers: Influencers,
|
|
10275
10348
|
Teams: Teams,
|