glitch-javascript-sdk 0.7.4 → 0.7.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 +98 -14
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +1 -1
- package/dist/esm/api/Events.d.ts +11 -11
- package/dist/esm/api/Titles.d.ts +64 -0
- package/dist/esm/index.js +98 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +76 -12
- package/package.json +1 -1
- package/src/api/Campaigns.ts +2 -2
- package/src/api/Events.ts +3 -3
- package/src/api/Titles.ts +96 -0
- package/src/routes/TitlesRoute.ts +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -1233,15 +1233,15 @@ declare class Events {
|
|
|
1233
1233
|
*/
|
|
1234
1234
|
static syncAsLive<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1235
1235
|
/**
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1236
|
+
* Updates the main image for the event using a File object.
|
|
1237
|
+
*
|
|
1238
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
1239
|
+
*
|
|
1240
|
+
* @param file The file object to upload.
|
|
1241
|
+
* @param data Any additional data to pass along to the upload.
|
|
1242
|
+
*
|
|
1243
|
+
* @returns promise
|
|
1244
|
+
*/
|
|
1245
1245
|
static uploadMainImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1246
1246
|
/**
|
|
1247
1247
|
* Updates the main image for the event using a Blob.
|
|
@@ -1255,7 +1255,7 @@ declare class Events {
|
|
|
1255
1255
|
*/
|
|
1256
1256
|
static uploadMainImageBlob<T>(event_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1257
1257
|
/**
|
|
1258
|
-
* Updates the banner image for the
|
|
1258
|
+
* Updates the banner image for the event using a File object.
|
|
1259
1259
|
*
|
|
1260
1260
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
1261
1261
|
*
|
|
@@ -1266,7 +1266,7 @@ declare class Events {
|
|
|
1266
1266
|
*/
|
|
1267
1267
|
static uploadBannerImageFile<T>(event_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1268
1268
|
/**
|
|
1269
|
-
* Updates the banner image for the
|
|
1269
|
+
* Updates the banner image for the event using a Blob.
|
|
1270
1270
|
*
|
|
1271
1271
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
1272
1272
|
*
|
|
@@ -2169,6 +2169,70 @@ declare class Titles {
|
|
|
2169
2169
|
* @returns Promise
|
|
2170
2170
|
*/
|
|
2171
2171
|
static reject<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2172
|
+
/**
|
|
2173
|
+
* Add a user as an administrator to a title
|
|
2174
|
+
*
|
|
2175
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/addTitleAdministrator
|
|
2176
|
+
*
|
|
2177
|
+
* @param data The data to be passed when creating a title.
|
|
2178
|
+
*
|
|
2179
|
+
* @returns Promise
|
|
2180
|
+
*/
|
|
2181
|
+
static addAdministrator<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2182
|
+
/**
|
|
2183
|
+
* Remove a user as an administrator toa tile
|
|
2184
|
+
*
|
|
2185
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/removeTitleAdministrator
|
|
2186
|
+
*
|
|
2187
|
+
* @param data The data to be passed when creating a title.
|
|
2188
|
+
*
|
|
2189
|
+
* @returns Promise
|
|
2190
|
+
*/
|
|
2191
|
+
static removeAdministrator<T>(title_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2192
|
+
/**
|
|
2193
|
+
* Updates the main image for the title using a File object.
|
|
2194
|
+
*
|
|
2195
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
2196
|
+
*
|
|
2197
|
+
* @param file The file object to upload.
|
|
2198
|
+
* @param data Any additional data to pass along to the upload.
|
|
2199
|
+
*
|
|
2200
|
+
* @returns promise
|
|
2201
|
+
*/
|
|
2202
|
+
static uploadMainImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2203
|
+
/**
|
|
2204
|
+
* Updates the main image for the title using a Blob.
|
|
2205
|
+
*
|
|
2206
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
2207
|
+
*
|
|
2208
|
+
* @param blob The blob to upload.
|
|
2209
|
+
* @param data Any additional data to pass along to the upload
|
|
2210
|
+
*
|
|
2211
|
+
* @returns promise
|
|
2212
|
+
*/
|
|
2213
|
+
static uploadMainImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2214
|
+
/**
|
|
2215
|
+
* Updates the banner image for the title using a File object.
|
|
2216
|
+
*
|
|
2217
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
2218
|
+
*
|
|
2219
|
+
* @param file The file object to upload.
|
|
2220
|
+
* @param data Any additional data to pass along to the upload.
|
|
2221
|
+
*
|
|
2222
|
+
* @returns promise
|
|
2223
|
+
*/
|
|
2224
|
+
static uploadBannerImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2225
|
+
/**
|
|
2226
|
+
* Updates the banner image for the title using a Blob.
|
|
2227
|
+
*
|
|
2228
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
2229
|
+
*
|
|
2230
|
+
* @param blob The blob to upload.
|
|
2231
|
+
* @param data Any additional data to pass along to the upload
|
|
2232
|
+
*
|
|
2233
|
+
* @returns promise
|
|
2234
|
+
*/
|
|
2235
|
+
static uploadBannerImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2172
2236
|
}
|
|
2173
2237
|
|
|
2174
2238
|
declare class Campaigns {
|
|
@@ -2266,7 +2330,7 @@ declare class Campaigns {
|
|
|
2266
2330
|
*
|
|
2267
2331
|
* @returns promise
|
|
2268
2332
|
*/
|
|
2269
|
-
static listInfluencerCampaigns<T>(
|
|
2333
|
+
static listInfluencerCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2270
2334
|
/**
|
|
2271
2335
|
* Create an influencer campaign
|
|
2272
2336
|
*
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -134,8 +134,8 @@ class Campaigns {
|
|
|
134
134
|
*
|
|
135
135
|
* @returns promise
|
|
136
136
|
*/
|
|
137
|
-
public static listInfluencerCampaigns<T>(
|
|
138
|
-
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaigns, undefined,
|
|
137
|
+
public static listInfluencerCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
138
|
+
return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaigns, undefined, undefined, params);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
package/src/api/Events.ts
CHANGED
|
@@ -193,7 +193,7 @@ class Events {
|
|
|
193
193
|
return Requests.processRoute(EventsRoutes.routes.syncAsLive, data, { event_id: event_id }, params);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
/**
|
|
197
197
|
* Updates the main image for the event using a File object.
|
|
198
198
|
*
|
|
199
199
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadMainEventImage
|
|
@@ -228,7 +228,7 @@ class Events {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
|
-
* Updates the banner image for the
|
|
231
|
+
* Updates the banner image for the event using a File object.
|
|
232
232
|
*
|
|
233
233
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
234
234
|
*
|
|
@@ -245,7 +245,7 @@ class Events {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
|
-
* Updates the banner image for the
|
|
248
|
+
* Updates the banner image for the event using a Blob.
|
|
249
249
|
*
|
|
250
250
|
* @see https://api.glitch.fun/api/documentation#/Event%20Route/uploadBannerEventImage
|
|
251
251
|
*
|
package/src/api/Titles.ts
CHANGED
|
@@ -100,6 +100,102 @@ class Titles {
|
|
|
100
100
|
return Requests.processRoute(TitlesRoute.routes.reject, data, { title_id: title_id }, params);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Add a user as an administrator to a title
|
|
105
|
+
*
|
|
106
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/addTitleAdministrator
|
|
107
|
+
*
|
|
108
|
+
* @param data The data to be passed when creating a title.
|
|
109
|
+
*
|
|
110
|
+
* @returns Promise
|
|
111
|
+
*/
|
|
112
|
+
public static addAdministrator<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
113
|
+
|
|
114
|
+
return Requests.processRoute(TitlesRoute.routes.addAdministrator, data, { title_id: title_id }, params);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Remove a user as an administrator toa tile
|
|
119
|
+
*
|
|
120
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/removeTitleAdministrator
|
|
121
|
+
*
|
|
122
|
+
* @param data The data to be passed when creating a title.
|
|
123
|
+
*
|
|
124
|
+
* @returns Promise
|
|
125
|
+
*/
|
|
126
|
+
public static removeAdministrator<T>(title_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
127
|
+
|
|
128
|
+
return Requests.processRoute(TitlesRoute.routes.removeAdministrator, data, { title_id: title_id, user_id: user_id }, params);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Updates the main image for the title using a File object.
|
|
133
|
+
*
|
|
134
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
135
|
+
*
|
|
136
|
+
* @param file The file object to upload.
|
|
137
|
+
* @param data Any additional data to pass along to the upload.
|
|
138
|
+
*
|
|
139
|
+
* @returns promise
|
|
140
|
+
*/
|
|
141
|
+
public static uploadMainImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
142
|
+
|
|
143
|
+
let url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
|
|
144
|
+
|
|
145
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Updates the main image for the title using a Blob.
|
|
150
|
+
*
|
|
151
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleMainImage
|
|
152
|
+
*
|
|
153
|
+
* @param blob The blob to upload.
|
|
154
|
+
* @param data Any additional data to pass along to the upload
|
|
155
|
+
*
|
|
156
|
+
* @returns promise
|
|
157
|
+
*/
|
|
158
|
+
public static uploadMainImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
159
|
+
|
|
160
|
+
let url = TitlesRoute.routes.uploadMainImage.url.replace('{title_id}', title_id);
|
|
161
|
+
|
|
162
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Updates the banner image for the title using a File object.
|
|
167
|
+
*
|
|
168
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
169
|
+
*
|
|
170
|
+
* @param file The file object to upload.
|
|
171
|
+
* @param data Any additional data to pass along to the upload.
|
|
172
|
+
*
|
|
173
|
+
* @returns promise
|
|
174
|
+
*/
|
|
175
|
+
public static uploadBannerImageFile<T>(title_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
176
|
+
|
|
177
|
+
let url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
|
|
178
|
+
|
|
179
|
+
return Requests.uploadFile(url, 'image', file, data);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Updates the banner image for the title using a Blob.
|
|
184
|
+
*
|
|
185
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/uploadTitleBannerImage
|
|
186
|
+
*
|
|
187
|
+
* @param blob The blob to upload.
|
|
188
|
+
* @param data Any additional data to pass along to the upload
|
|
189
|
+
*
|
|
190
|
+
* @returns promise
|
|
191
|
+
*/
|
|
192
|
+
public static uploadBannerImageBlob<T>(title_id: string, blob: Blob, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
193
|
+
|
|
194
|
+
let url = TitlesRoute.routes.uploadBannerImage.url.replace('{title_id}', title_id);
|
|
195
|
+
|
|
196
|
+
return Requests.uploadBlob(url, 'image', blob, data);
|
|
197
|
+
}
|
|
198
|
+
|
|
103
199
|
}
|
|
104
200
|
|
|
105
201
|
export default Titles;
|
|
@@ -10,7 +10,11 @@ class TitlesRoute {
|
|
|
10
10
|
update :{ url: '/titles/{title_id}', method: HTTP_METHODS.PUT },
|
|
11
11
|
delete : { url: '/titles/{title_id}', method: HTTP_METHODS.DELETE },
|
|
12
12
|
approve : { url: '/titles/{title_id}/approve', method: HTTP_METHODS.POST },
|
|
13
|
-
reject : { url: '
|
|
13
|
+
reject : { url: '/titles/{title_id}/reject', method: HTTP_METHODS.POST },
|
|
14
|
+
uploadMainImage : {url : '/titles/{title_id}/uploadMainImage', method: HTTP_METHODS.POST},
|
|
15
|
+
uploadBannerImage : {url : '/titles/{title_id}/uploadBannerImage', method: HTTP_METHODS.POST},
|
|
16
|
+
addAdministrator : { url: '/titles/{title_id}/addAdministrator', method: HTTP_METHODS.POST },
|
|
17
|
+
removeAdministrator : { url: '/titles/{title_id}/removeAdministrator/{user_id}', method: HTTP_METHODS.DELETE },
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
}
|