glitch-javascript-sdk 0.6.4 → 0.6.6
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 +1137 -743
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +159 -0
- package/dist/esm/api/Titles.d.ts +73 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +1241 -824
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/CampaignsRoute.d.ts +7 -0
- package/dist/esm/routes/TitlesRoute.d.ts +7 -0
- package/dist/index.d.ts +230 -0
- package/package.json +13 -13
- package/src/api/Campaigns.ts +224 -0
- package/src/api/Titles.ts +105 -0
- package/src/api/index.ts +5 -1
- package/src/index.ts +4 -0
- package/src/routes/CampaignsRoute.ts +27 -0
- package/src/routes/TitlesRoute.ts +18 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class Campaigns {
|
|
4
|
+
/**
|
|
5
|
+
* List all the Campaigns.
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/edab2e3b061347b06c82258622d239e2
|
|
8
|
+
*
|
|
9
|
+
* @returns promise
|
|
10
|
+
*/
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new campaign.
|
|
14
|
+
*
|
|
15
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/createCampaign
|
|
16
|
+
*
|
|
17
|
+
* @param data The data to be passed when creating a campaign.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise
|
|
20
|
+
*/
|
|
21
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Update a campaign.
|
|
24
|
+
*
|
|
25
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/updateCampaign
|
|
26
|
+
*
|
|
27
|
+
* @param campaign_id The id of the campaign to update.
|
|
28
|
+
* @param data The data to update.
|
|
29
|
+
*
|
|
30
|
+
* @returns promise
|
|
31
|
+
*/
|
|
32
|
+
static update<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve the information for a single campaign.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignByUuid
|
|
37
|
+
*
|
|
38
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
39
|
+
*
|
|
40
|
+
* @returns promise
|
|
41
|
+
*/
|
|
42
|
+
static view<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes a campaign.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/deleteCampaign
|
|
47
|
+
*
|
|
48
|
+
* @param campaign_id The id of the campaign to delete.
|
|
49
|
+
* @returns promise
|
|
50
|
+
*/
|
|
51
|
+
static delete<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* List all the campaign links.
|
|
54
|
+
*
|
|
55
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLinks
|
|
56
|
+
*
|
|
57
|
+
* @returns promise
|
|
58
|
+
*/
|
|
59
|
+
static listCampaignLinks<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
60
|
+
/**
|
|
61
|
+
* Create a new campaign link.
|
|
62
|
+
*
|
|
63
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/storeCampaignLink
|
|
64
|
+
*
|
|
65
|
+
* @param data The data to be passed when creating a campaign.
|
|
66
|
+
*
|
|
67
|
+
* @returns Promise
|
|
68
|
+
*/
|
|
69
|
+
static createCampaignLink<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
70
|
+
/**
|
|
71
|
+
* Update a campaign.
|
|
72
|
+
*
|
|
73
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/1bb1492981b4529693604b03aade8bf6
|
|
74
|
+
*
|
|
75
|
+
* @param campaign_id The id of the campaign to update.
|
|
76
|
+
* @param data The data to update.
|
|
77
|
+
*
|
|
78
|
+
* @returns promise
|
|
79
|
+
*/
|
|
80
|
+
static updateCampaignLink<T>(campaign_id: string, link_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Retrieve the information for a single campaign.
|
|
83
|
+
*
|
|
84
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getCampaignLink
|
|
85
|
+
*
|
|
86
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
87
|
+
*
|
|
88
|
+
* @returns promise
|
|
89
|
+
*/
|
|
90
|
+
static getCampaignLink<T>(campaign_id: string, link_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
91
|
+
/**
|
|
92
|
+
* List all the influencers associated with a campaign.
|
|
93
|
+
*
|
|
94
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/getInfluencerCampaigns
|
|
95
|
+
*
|
|
96
|
+
* @returns promise
|
|
97
|
+
*/
|
|
98
|
+
static listInfluencerCampaigns<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
99
|
+
/**
|
|
100
|
+
* Create an influencer campaign
|
|
101
|
+
*
|
|
102
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/6d834c837c5f330d6a4cef5786c45c90
|
|
103
|
+
*
|
|
104
|
+
* @param data The data to be passed when creating a campaign.
|
|
105
|
+
*
|
|
106
|
+
* @returns Promise
|
|
107
|
+
*/
|
|
108
|
+
static createInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
109
|
+
/**
|
|
110
|
+
* Update an influencer campaign.
|
|
111
|
+
*
|
|
112
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/updateInfluencerCampaign
|
|
113
|
+
*
|
|
114
|
+
* @param campaign_id The id of the campaign to update.
|
|
115
|
+
* @param data The data to update.
|
|
116
|
+
*
|
|
117
|
+
* @returns promise
|
|
118
|
+
*/
|
|
119
|
+
static updateInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
120
|
+
/**
|
|
121
|
+
* Retrieve the information for a single campaign.
|
|
122
|
+
*
|
|
123
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/showInfluencerCampaign
|
|
124
|
+
*
|
|
125
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
126
|
+
*
|
|
127
|
+
* @returns promise
|
|
128
|
+
*/
|
|
129
|
+
static viewInfluencerCampaign<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
130
|
+
/**
|
|
131
|
+
* Mark an influencer campaign as completed.
|
|
132
|
+
*
|
|
133
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/markCompleted
|
|
134
|
+
*
|
|
135
|
+
* @param data The data to be passed when creating a campaign.
|
|
136
|
+
*
|
|
137
|
+
* @returns Promise
|
|
138
|
+
*/
|
|
139
|
+
static markInfluencerCampaignComplete<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
140
|
+
/**
|
|
141
|
+
* Mark an influencer campaign as incomplete.
|
|
142
|
+
*
|
|
143
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/afffdc7a0c7fc4d9740f10517c53933e
|
|
144
|
+
*
|
|
145
|
+
* @param data The data to be passed when creating a campaign.
|
|
146
|
+
*
|
|
147
|
+
* @returns Promise
|
|
148
|
+
*/
|
|
149
|
+
static markInfluencerCampaignIncomplete<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
150
|
+
/**
|
|
151
|
+
* Get all the links associated with an influencer's campaign.
|
|
152
|
+
*
|
|
153
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/edab2e3b061347b06c82258622d239e2
|
|
154
|
+
*
|
|
155
|
+
* @returns promise
|
|
156
|
+
*/
|
|
157
|
+
static listInfluencerCampaignLinks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
158
|
+
}
|
|
159
|
+
export default Campaigns;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class Titles {
|
|
4
|
+
/**
|
|
5
|
+
* List all the Titles.
|
|
6
|
+
*
|
|
7
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/edab2e3b061347b06c82258622d239e2
|
|
8
|
+
*
|
|
9
|
+
* @returns promise
|
|
10
|
+
*/
|
|
11
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new title.
|
|
14
|
+
*
|
|
15
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/storeTitle
|
|
16
|
+
*
|
|
17
|
+
* @param data The data to be passed when creating a title.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise
|
|
20
|
+
*/
|
|
21
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Update a title.
|
|
24
|
+
*
|
|
25
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateTitle
|
|
26
|
+
*
|
|
27
|
+
* @param title_id The id of the title to update.
|
|
28
|
+
* @param data The data to update.
|
|
29
|
+
*
|
|
30
|
+
* @returns promise
|
|
31
|
+
*/
|
|
32
|
+
static update<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve the information for a single title.
|
|
35
|
+
*
|
|
36
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/getTitleByUUID
|
|
37
|
+
*
|
|
38
|
+
* @param title_id The id fo the title to retrieve.
|
|
39
|
+
*
|
|
40
|
+
* @returns promise
|
|
41
|
+
*/
|
|
42
|
+
static view<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes a title.
|
|
45
|
+
*
|
|
46
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/deleteTitle
|
|
47
|
+
*
|
|
48
|
+
* @param title_id The id of the title to delete.
|
|
49
|
+
* @returns promise
|
|
50
|
+
*/
|
|
51
|
+
static delete<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* Approve a title
|
|
54
|
+
*
|
|
55
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/approveTitle
|
|
56
|
+
*
|
|
57
|
+
* @param data The data to be passed when creating a title.
|
|
58
|
+
*
|
|
59
|
+
* @returns Promise
|
|
60
|
+
*/
|
|
61
|
+
static approve<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Reject a title
|
|
64
|
+
*
|
|
65
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/rejectTitle
|
|
66
|
+
*
|
|
67
|
+
* @param data The data to be passed when creating a title.
|
|
68
|
+
*
|
|
69
|
+
* @returns Promise
|
|
70
|
+
*/
|
|
71
|
+
static reject<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
72
|
+
}
|
|
73
|
+
export default Titles;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import TipEmojis from "./TipEmojis";
|
|
|
14
14
|
import TipPackages from "./TipPackages";
|
|
15
15
|
import TipPackagePurchases from "./TipPackagePurchases";
|
|
16
16
|
import SocialPosts from "./SocialPosts";
|
|
17
|
+
import Titles from "./Titles";
|
|
18
|
+
import Campaigns from "./Campaigns";
|
|
17
19
|
export { Auth };
|
|
18
20
|
export { Competitions };
|
|
19
21
|
export { Communities };
|
|
@@ -30,3 +32,5 @@ export { TipEmojis };
|
|
|
30
32
|
export { TipPackages };
|
|
31
33
|
export { TipPackagePurchases };
|
|
32
34
|
export { SocialPosts };
|
|
35
|
+
export { Titles };
|
|
36
|
+
export { Campaigns };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { TipPackages } from "./api";
|
|
|
14
14
|
import { TipEmojis } from "./api";
|
|
15
15
|
import { TipPackagePurchases } from "./api";
|
|
16
16
|
import { SocialPosts } from "./api";
|
|
17
|
+
import { Titles } from "./api";
|
|
18
|
+
import { Campaigns } from "./api";
|
|
17
19
|
import Requests from "./util/Requests";
|
|
18
20
|
import Parser from "./util/Parser";
|
|
19
21
|
import Session from "./util/Session";
|
|
@@ -34,6 +36,7 @@ declare class Glitch {
|
|
|
34
36
|
};
|
|
35
37
|
static api: {
|
|
36
38
|
Auth: typeof Auth;
|
|
39
|
+
Campaigns: typeof Campaigns;
|
|
37
40
|
Competitions: typeof Competitions;
|
|
38
41
|
Communities: typeof Communities;
|
|
39
42
|
Users: typeof Users;
|
|
@@ -44,6 +47,7 @@ declare class Glitch {
|
|
|
44
47
|
Waitlists: typeof Waitlists;
|
|
45
48
|
Utility: typeof Utility;
|
|
46
49
|
Tips: typeof Tips;
|
|
50
|
+
Titles: typeof Titles;
|
|
47
51
|
Social: typeof Social;
|
|
48
52
|
SocialPosts: typeof SocialPosts;
|
|
49
53
|
TipPackages: typeof TipPackages;
|