glitch-javascript-sdk 1.2.9 → 1.3.1
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 +167 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Newsletters.d.ts +15 -0
- package/dist/esm/api/PlayTests.d.ts +95 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +167 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/NewslettersRoutes.d.ts +7 -0
- package/dist/esm/routes/PlayTestsRoute.d.ts +7 -0
- package/dist/index.d.ts +108 -0
- package/package.json +1 -1
- package/src/api/Newsletters.ts +28 -0
- package/src/api/PlayTests.ts +131 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +5 -1
- package/src/routes/NewslettersRoutes.ts +12 -0
- package/src/routes/PlayTestsRoute.ts +20 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class Newsletters {
|
|
4
|
+
/**
|
|
5
|
+
* Download the list of publictions, podcasts and blogs.
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Newsletters/downloadMarketingChecklists
|
|
8
|
+
*
|
|
9
|
+
* @param data The data to be passed when creating a team.
|
|
10
|
+
*
|
|
11
|
+
* @returns Promise
|
|
12
|
+
*/
|
|
13
|
+
static downloadMarketingChecklist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
14
|
+
}
|
|
15
|
+
export default Newsletters;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class PlayTests {
|
|
4
|
+
/**
|
|
5
|
+
* Get a list of play tests associated with a title.
|
|
6
|
+
*
|
|
7
|
+
* @param title_id The ID of the title.
|
|
8
|
+
* @param params Optional query parameters.
|
|
9
|
+
* @returns Promise
|
|
10
|
+
*/
|
|
11
|
+
static index<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* User requests to test a title.
|
|
14
|
+
*
|
|
15
|
+
* @param title_id The ID of the title.
|
|
16
|
+
* @param data Optional data for the request.
|
|
17
|
+
* @returns Promise
|
|
18
|
+
*/
|
|
19
|
+
static requestPlayTest<T>(title_id: string, data?: object): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Title administrator invites a user to test a title.
|
|
22
|
+
*
|
|
23
|
+
* @param title_id The ID of the title.
|
|
24
|
+
* @param data The data containing user_id and other optional fields.
|
|
25
|
+
* @returns Promise
|
|
26
|
+
*/
|
|
27
|
+
static invitePlayTester<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
28
|
+
/**
|
|
29
|
+
* User submits or updates their answers for a play test.
|
|
30
|
+
*
|
|
31
|
+
* @param title_id The ID of the title.
|
|
32
|
+
* @param playtest_id The ID of the play test.
|
|
33
|
+
* @param data The answers data.
|
|
34
|
+
* @returns Promise
|
|
35
|
+
*/
|
|
36
|
+
static submitAnswers<T>(title_id: string, playtest_id: string, data: object): AxiosPromise<Response<T>>;
|
|
37
|
+
/**
|
|
38
|
+
* Title admin updates test questions for a play test.
|
|
39
|
+
*
|
|
40
|
+
* @param title_id The ID of the title.
|
|
41
|
+
* @param playtest_id The ID of the play test.
|
|
42
|
+
* @param data The questions data.
|
|
43
|
+
* @returns Promise
|
|
44
|
+
*/
|
|
45
|
+
static updateQuestions<T>(title_id: string, playtest_id: string, data: object): AxiosPromise<Response<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* User accepts an invite to a play test.
|
|
48
|
+
*
|
|
49
|
+
* @param title_id The ID of the title.
|
|
50
|
+
* @param playtest_id The ID of the play test.
|
|
51
|
+
* @returns Promise
|
|
52
|
+
*/
|
|
53
|
+
static acceptInvite<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
54
|
+
/**
|
|
55
|
+
* User rejects an invite to a play test.
|
|
56
|
+
*
|
|
57
|
+
* @param title_id The ID of the title.
|
|
58
|
+
* @param playtest_id The ID of the play test.
|
|
59
|
+
* @returns Promise
|
|
60
|
+
*/
|
|
61
|
+
static rejectInvite<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Title admin approves a user's play test request.
|
|
64
|
+
*
|
|
65
|
+
* @param title_id The ID of the title.
|
|
66
|
+
* @param playtest_id The ID of the play test.
|
|
67
|
+
* @returns Promise
|
|
68
|
+
*/
|
|
69
|
+
static approveRequest<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
70
|
+
/**
|
|
71
|
+
* Title admin declines a user's play test request.
|
|
72
|
+
*
|
|
73
|
+
* @param title_id The ID of the title.
|
|
74
|
+
* @param playtest_id The ID of the play test.
|
|
75
|
+
* @returns Promise
|
|
76
|
+
*/
|
|
77
|
+
static declineRequest<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
78
|
+
/**
|
|
79
|
+
* User cancels their own play test request.
|
|
80
|
+
*
|
|
81
|
+
* @param title_id The ID of the title.
|
|
82
|
+
* @param playtest_id The ID of the play test.
|
|
83
|
+
* @returns Promise
|
|
84
|
+
*/
|
|
85
|
+
static cancelRequest<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
86
|
+
/**
|
|
87
|
+
* Retrieve a single play test.
|
|
88
|
+
*
|
|
89
|
+
* @param title_id The ID of the title.
|
|
90
|
+
* @param playtest_id The ID of the play test.
|
|
91
|
+
* @returns Promise
|
|
92
|
+
*/
|
|
93
|
+
static show<T>(title_id: string, playtest_id: string): AxiosPromise<Response<T>>;
|
|
94
|
+
}
|
|
95
|
+
export default PlayTests;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ import Influencers from "./Influencers";
|
|
|
23
23
|
import Games from "./Games";
|
|
24
24
|
import Publications from "./Publications";
|
|
25
25
|
import GameShows from "./GameShows";
|
|
26
|
+
import Newsletters from "./Newsletters";
|
|
27
|
+
import PlayTests from "./PlayTests";
|
|
26
28
|
export { Auth };
|
|
27
29
|
export { Competitions };
|
|
28
30
|
export { Communities };
|
|
@@ -48,3 +50,5 @@ export { Influencers };
|
|
|
48
50
|
export { Games };
|
|
49
51
|
export { Publications };
|
|
50
52
|
export { GameShows };
|
|
53
|
+
export { Newsletters };
|
|
54
|
+
export { PlayTests };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ import { Influencers } from "./api";
|
|
|
23
23
|
import { Games } from "./api";
|
|
24
24
|
import { Publications } from "./api";
|
|
25
25
|
import { GameShows } from "./api";
|
|
26
|
+
import { Newsletters } from "./api";
|
|
27
|
+
import { PlayTests } from "./api";
|
|
26
28
|
import Requests from "./util/Requests";
|
|
27
29
|
import Parser from "./util/Parser";
|
|
28
30
|
import Session from "./util/Session";
|
|
@@ -67,6 +69,8 @@ declare class Glitch {
|
|
|
67
69
|
TipEmojis: typeof TipEmojis;
|
|
68
70
|
TipPackagePurchases: typeof TipPackagePurchases;
|
|
69
71
|
Publications: typeof Publications;
|
|
72
|
+
Newsletters: typeof Newsletters;
|
|
73
|
+
PlayTests: typeof PlayTests;
|
|
70
74
|
};
|
|
71
75
|
static util: {
|
|
72
76
|
Requests: typeof Requests;
|
package/dist/esm/index.js
CHANGED
|
@@ -10907,6 +10907,170 @@ var GameShows = /** @class */ (function () {
|
|
|
10907
10907
|
return GameShows;
|
|
10908
10908
|
}());
|
|
10909
10909
|
|
|
10910
|
+
var NewslettersRoutes = /** @class */ (function () {
|
|
10911
|
+
function NewslettersRoutes() {
|
|
10912
|
+
}
|
|
10913
|
+
NewslettersRoutes.routes = {
|
|
10914
|
+
downloadMarketingChecklist: { url: '/newsletters/downloadMarketingChecklist', method: HTTP_METHODS.POST },
|
|
10915
|
+
};
|
|
10916
|
+
return NewslettersRoutes;
|
|
10917
|
+
}());
|
|
10918
|
+
|
|
10919
|
+
var Newsletters = /** @class */ (function () {
|
|
10920
|
+
function Newsletters() {
|
|
10921
|
+
}
|
|
10922
|
+
/**
|
|
10923
|
+
* Download the list of publictions, podcasts and blogs.
|
|
10924
|
+
*
|
|
10925
|
+
* @see https://api.glitch.fun/api/documentation#/Newsletters/downloadMarketingChecklists
|
|
10926
|
+
*
|
|
10927
|
+
* @param data The data to be passed when creating a team.
|
|
10928
|
+
*
|
|
10929
|
+
* @returns Promise
|
|
10930
|
+
*/
|
|
10931
|
+
Newsletters.downloadMarketingChecklist = function (data, params) {
|
|
10932
|
+
return Requests.processRoute(NewslettersRoutes.routes.downloadMarketingChecklist, data, undefined, params);
|
|
10933
|
+
};
|
|
10934
|
+
return Newsletters;
|
|
10935
|
+
}());
|
|
10936
|
+
|
|
10937
|
+
var PlayTestsRoute = /** @class */ (function () {
|
|
10938
|
+
function PlayTestsRoute() {
|
|
10939
|
+
}
|
|
10940
|
+
PlayTestsRoute.routes = {
|
|
10941
|
+
index: { url: '/playtests/{title_id}', method: HTTP_METHODS.GET },
|
|
10942
|
+
request: { url: '/playtests/{title_id}/request', method: HTTP_METHODS.POST },
|
|
10943
|
+
invite: { url: '/playtests/{title_id}/invite', method: HTTP_METHODS.POST },
|
|
10944
|
+
submitAnswers: { url: '/playtests/{title_id}/answers/{playtest_id}', method: HTTP_METHODS.PUT },
|
|
10945
|
+
updateQuestions: { url: '/playtests/{title_id}/questions/{playtest_id}', method: HTTP_METHODS.PUT },
|
|
10946
|
+
acceptInvite: { url: '/playtests/{title_id}/accept/{playtest_id}', method: HTTP_METHODS.POST },
|
|
10947
|
+
rejectInvite: { url: '/playtests/{title_id}/reject/{playtest_id}', method: HTTP_METHODS.POST },
|
|
10948
|
+
approveRequest: { url: '/playtests/{title_id}/approve/{playtest_id}', method: HTTP_METHODS.POST },
|
|
10949
|
+
declineRequest: { url: '/playtests/{title_id}/decline/{playtest_id}', method: HTTP_METHODS.POST },
|
|
10950
|
+
cancelRequest: { url: '/playtests/{title_id}/cancel/{playtest_id}', method: HTTP_METHODS.POST },
|
|
10951
|
+
show: { url: '/playtests/{title_id}/view/{playtest_id}', method: HTTP_METHODS.GET },
|
|
10952
|
+
};
|
|
10953
|
+
return PlayTestsRoute;
|
|
10954
|
+
}());
|
|
10955
|
+
|
|
10956
|
+
var PlayTests = /** @class */ (function () {
|
|
10957
|
+
function PlayTests() {
|
|
10958
|
+
}
|
|
10959
|
+
/**
|
|
10960
|
+
* Get a list of play tests associated with a title.
|
|
10961
|
+
*
|
|
10962
|
+
* @param title_id The ID of the title.
|
|
10963
|
+
* @param params Optional query parameters.
|
|
10964
|
+
* @returns Promise
|
|
10965
|
+
*/
|
|
10966
|
+
PlayTests.index = function (title_id, params) {
|
|
10967
|
+
return Requests.processRoute(PlayTestsRoute.routes.index, undefined, { title_id: title_id }, params);
|
|
10968
|
+
};
|
|
10969
|
+
/**
|
|
10970
|
+
* User requests to test a title.
|
|
10971
|
+
*
|
|
10972
|
+
* @param title_id The ID of the title.
|
|
10973
|
+
* @param data Optional data for the request.
|
|
10974
|
+
* @returns Promise
|
|
10975
|
+
*/
|
|
10976
|
+
PlayTests.requestPlayTest = function (title_id, data) {
|
|
10977
|
+
return Requests.processRoute(PlayTestsRoute.routes.request, data, { title_id: title_id });
|
|
10978
|
+
};
|
|
10979
|
+
/**
|
|
10980
|
+
* Title administrator invites a user to test a title.
|
|
10981
|
+
*
|
|
10982
|
+
* @param title_id The ID of the title.
|
|
10983
|
+
* @param data The data containing user_id and other optional fields.
|
|
10984
|
+
* @returns Promise
|
|
10985
|
+
*/
|
|
10986
|
+
PlayTests.invitePlayTester = function (title_id, data) {
|
|
10987
|
+
return Requests.processRoute(PlayTestsRoute.routes.invite, data, { title_id: title_id });
|
|
10988
|
+
};
|
|
10989
|
+
/**
|
|
10990
|
+
* User submits or updates their answers for a play test.
|
|
10991
|
+
*
|
|
10992
|
+
* @param title_id The ID of the title.
|
|
10993
|
+
* @param playtest_id The ID of the play test.
|
|
10994
|
+
* @param data The answers data.
|
|
10995
|
+
* @returns Promise
|
|
10996
|
+
*/
|
|
10997
|
+
PlayTests.submitAnswers = function (title_id, playtest_id, data) {
|
|
10998
|
+
return Requests.processRoute(PlayTestsRoute.routes.submitAnswers, data, { title_id: title_id, playtest_id: playtest_id });
|
|
10999
|
+
};
|
|
11000
|
+
/**
|
|
11001
|
+
* Title admin updates test questions for a play test.
|
|
11002
|
+
*
|
|
11003
|
+
* @param title_id The ID of the title.
|
|
11004
|
+
* @param playtest_id The ID of the play test.
|
|
11005
|
+
* @param data The questions data.
|
|
11006
|
+
* @returns Promise
|
|
11007
|
+
*/
|
|
11008
|
+
PlayTests.updateQuestions = function (title_id, playtest_id, data) {
|
|
11009
|
+
return Requests.processRoute(PlayTestsRoute.routes.updateQuestions, data, { title_id: title_id, playtest_id: playtest_id });
|
|
11010
|
+
};
|
|
11011
|
+
/**
|
|
11012
|
+
* User accepts an invite to a play test.
|
|
11013
|
+
*
|
|
11014
|
+
* @param title_id The ID of the title.
|
|
11015
|
+
* @param playtest_id The ID of the play test.
|
|
11016
|
+
* @returns Promise
|
|
11017
|
+
*/
|
|
11018
|
+
PlayTests.acceptInvite = function (title_id, playtest_id) {
|
|
11019
|
+
return Requests.processRoute(PlayTestsRoute.routes.acceptInvite, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11020
|
+
};
|
|
11021
|
+
/**
|
|
11022
|
+
* User rejects an invite to a play test.
|
|
11023
|
+
*
|
|
11024
|
+
* @param title_id The ID of the title.
|
|
11025
|
+
* @param playtest_id The ID of the play test.
|
|
11026
|
+
* @returns Promise
|
|
11027
|
+
*/
|
|
11028
|
+
PlayTests.rejectInvite = function (title_id, playtest_id) {
|
|
11029
|
+
return Requests.processRoute(PlayTestsRoute.routes.rejectInvite, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11030
|
+
};
|
|
11031
|
+
/**
|
|
11032
|
+
* Title admin approves a user's play test request.
|
|
11033
|
+
*
|
|
11034
|
+
* @param title_id The ID of the title.
|
|
11035
|
+
* @param playtest_id The ID of the play test.
|
|
11036
|
+
* @returns Promise
|
|
11037
|
+
*/
|
|
11038
|
+
PlayTests.approveRequest = function (title_id, playtest_id) {
|
|
11039
|
+
return Requests.processRoute(PlayTestsRoute.routes.approveRequest, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11040
|
+
};
|
|
11041
|
+
/**
|
|
11042
|
+
* Title admin declines a user's play test request.
|
|
11043
|
+
*
|
|
11044
|
+
* @param title_id The ID of the title.
|
|
11045
|
+
* @param playtest_id The ID of the play test.
|
|
11046
|
+
* @returns Promise
|
|
11047
|
+
*/
|
|
11048
|
+
PlayTests.declineRequest = function (title_id, playtest_id) {
|
|
11049
|
+
return Requests.processRoute(PlayTestsRoute.routes.declineRequest, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11050
|
+
};
|
|
11051
|
+
/**
|
|
11052
|
+
* User cancels their own play test request.
|
|
11053
|
+
*
|
|
11054
|
+
* @param title_id The ID of the title.
|
|
11055
|
+
* @param playtest_id The ID of the play test.
|
|
11056
|
+
* @returns Promise
|
|
11057
|
+
*/
|
|
11058
|
+
PlayTests.cancelRequest = function (title_id, playtest_id) {
|
|
11059
|
+
return Requests.processRoute(PlayTestsRoute.routes.cancelRequest, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11060
|
+
};
|
|
11061
|
+
/**
|
|
11062
|
+
* Retrieve a single play test.
|
|
11063
|
+
*
|
|
11064
|
+
* @param title_id The ID of the title.
|
|
11065
|
+
* @param playtest_id The ID of the play test.
|
|
11066
|
+
* @returns Promise
|
|
11067
|
+
*/
|
|
11068
|
+
PlayTests.show = function (title_id, playtest_id) {
|
|
11069
|
+
return Requests.processRoute(PlayTestsRoute.routes.show, {}, { title_id: title_id, playtest_id: playtest_id });
|
|
11070
|
+
};
|
|
11071
|
+
return PlayTests;
|
|
11072
|
+
}());
|
|
11073
|
+
|
|
10910
11074
|
var Parser = /** @class */ (function () {
|
|
10911
11075
|
function Parser() {
|
|
10912
11076
|
}
|
|
@@ -11328,7 +11492,9 @@ var Glitch = /** @class */ (function () {
|
|
|
11328
11492
|
TipPackages: TipPackages,
|
|
11329
11493
|
TipEmojis: TipEmojis,
|
|
11330
11494
|
TipPackagePurchases: TipPackagePurchases,
|
|
11331
|
-
Publications: Publications
|
|
11495
|
+
Publications: Publications,
|
|
11496
|
+
Newsletters: Newsletters,
|
|
11497
|
+
PlayTests: PlayTests
|
|
11332
11498
|
};
|
|
11333
11499
|
Glitch.util = {
|
|
11334
11500
|
Requests: Requests,
|