glitch-javascript-sdk 0.8.5 → 0.8.7
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 +148 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +60 -0
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/api/Utility.d.ts +32 -0
- package/dist/esm/index.js +148 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +112 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +84 -0
- package/src/api/Users.ts +28 -0
- package/src/api/Utility.ts +44 -0
- package/src/routes/CampaignsRoute.ts +7 -1
- package/src/routes/UserRoutes.ts +2 -0
- package/src/routes/UtilityRoutes.ts +4 -0
|
@@ -204,5 +204,65 @@ declare class Campaigns {
|
|
|
204
204
|
* @returns promise
|
|
205
205
|
*/
|
|
206
206
|
static deleteCampaignMention<T>(campaign_id: string, mention_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
207
|
+
/**
|
|
208
|
+
* Associate a country with the campaign.
|
|
209
|
+
*
|
|
210
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addCountryToCampaign
|
|
211
|
+
*
|
|
212
|
+
* @param data The country information to be passed to update the country campaigns information.
|
|
213
|
+
*
|
|
214
|
+
* @returns Promise
|
|
215
|
+
*/
|
|
216
|
+
static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
217
|
+
/**
|
|
218
|
+
* Remove a country
|
|
219
|
+
*
|
|
220
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeCountry
|
|
221
|
+
*
|
|
222
|
+
* @param country_id The id of the country to remove.
|
|
223
|
+
*
|
|
224
|
+
* @returns Promise
|
|
225
|
+
*/
|
|
226
|
+
static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
227
|
+
/**
|
|
228
|
+
* Associate a gender with the campaign.
|
|
229
|
+
*
|
|
230
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
231
|
+
*
|
|
232
|
+
* @param data The gener information to be passed to update the gender information.
|
|
233
|
+
*
|
|
234
|
+
* @returns Promise
|
|
235
|
+
*/
|
|
236
|
+
static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
237
|
+
/**
|
|
238
|
+
* Remove a gender
|
|
239
|
+
*
|
|
240
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
241
|
+
*
|
|
242
|
+
* @param gender_id The id of the gender to remove.
|
|
243
|
+
*
|
|
244
|
+
* @returns Promise
|
|
245
|
+
*/
|
|
246
|
+
static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
247
|
+
/**
|
|
248
|
+
* Associate an ethnicity with the campaign.
|
|
249
|
+
*
|
|
250
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
251
|
+
*
|
|
252
|
+
* @param data The ethnicity information to be passed to update the campaign information.
|
|
253
|
+
*
|
|
254
|
+
* @returns Promise
|
|
255
|
+
*/
|
|
256
|
+
static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
257
|
+
/**
|
|
258
|
+
* Remove an ethnicity
|
|
259
|
+
*
|
|
260
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
261
|
+
*
|
|
262
|
+
* @param gender_id The id of the ethnicity to remove.
|
|
263
|
+
*
|
|
264
|
+
* @returns Promise
|
|
265
|
+
*/
|
|
266
|
+
static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
207
267
|
}
|
|
208
268
|
export default Campaigns;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -223,5 +223,25 @@ declare class Users {
|
|
|
223
223
|
* @returns promise
|
|
224
224
|
*/
|
|
225
225
|
static getFacebookGroups<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
226
|
+
/**
|
|
227
|
+
* Add a genre to a user.
|
|
228
|
+
*
|
|
229
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
230
|
+
*
|
|
231
|
+
* @param data The genre information to be passed to update the genre information.
|
|
232
|
+
*
|
|
233
|
+
* @returns Promise
|
|
234
|
+
*/
|
|
235
|
+
static addGenre<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
236
|
+
/**
|
|
237
|
+
* Remove a genre from a user.
|
|
238
|
+
*
|
|
239
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
240
|
+
*
|
|
241
|
+
* @param genre_id The id of the genre to remove.
|
|
242
|
+
*
|
|
243
|
+
* @returns Promise
|
|
244
|
+
*/
|
|
245
|
+
static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
226
246
|
}
|
|
227
247
|
export default Users;
|
|
@@ -9,5 +9,37 @@ declare class Utility {
|
|
|
9
9
|
* @returns promise
|
|
10
10
|
*/
|
|
11
11
|
static listSocialInteractions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get all the genres available on the platform.
|
|
14
|
+
*
|
|
15
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
16
|
+
*
|
|
17
|
+
* @returns promise
|
|
18
|
+
*/
|
|
19
|
+
static listGenres<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get all the genders available on the platform.
|
|
22
|
+
*
|
|
23
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenders
|
|
24
|
+
*
|
|
25
|
+
* @returns promise
|
|
26
|
+
*/
|
|
27
|
+
static listGenders<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
28
|
+
/**
|
|
29
|
+
* Get all the countries available on the platform.
|
|
30
|
+
*
|
|
31
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
32
|
+
*
|
|
33
|
+
* @returns promise
|
|
34
|
+
*/
|
|
35
|
+
static listCountries<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
36
|
+
/**
|
|
37
|
+
* Get all the ethnicities available on the platform.
|
|
38
|
+
*
|
|
39
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
40
|
+
*
|
|
41
|
+
* @returns promise
|
|
42
|
+
*/
|
|
43
|
+
static listEthnicities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
12
44
|
}
|
|
13
45
|
export default Utility;
|
package/dist/esm/index.js
CHANGED
|
@@ -6878,6 +6878,8 @@ var UserRoutes = /** @class */ (function () {
|
|
|
6878
6878
|
aggregateMonthlyGivenTips: { url: '/users/aggregateMonthlyGivenTips', method: HTTP_METHODS.GET },
|
|
6879
6879
|
getYoutubeChannels: { url: '/users/getYoutubeChannels', method: HTTP_METHODS.GET },
|
|
6880
6880
|
getFacebookGroups: { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
|
|
6881
|
+
addGenre: { url: '/users/addGenre', method: HTTP_METHODS.POST },
|
|
6882
|
+
removeGenre: { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
6881
6883
|
};
|
|
6882
6884
|
return UserRoutes;
|
|
6883
6885
|
}());
|
|
@@ -7157,6 +7159,30 @@ var Users = /** @class */ (function () {
|
|
|
7157
7159
|
Users.getFacebookGroups = function (params) {
|
|
7158
7160
|
return Requests.processRoute(UserRoutes.routes.getFacebookGroups, undefined, undefined, params);
|
|
7159
7161
|
};
|
|
7162
|
+
/**
|
|
7163
|
+
* Add a genre to a user.
|
|
7164
|
+
*
|
|
7165
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
7166
|
+
*
|
|
7167
|
+
* @param data The genre information to be passed to update the genre information.
|
|
7168
|
+
*
|
|
7169
|
+
* @returns Promise
|
|
7170
|
+
*/
|
|
7171
|
+
Users.addGenre = function (data, params) {
|
|
7172
|
+
return Requests.processRoute(UserRoutes.routes.addGenre, data, undefined, params);
|
|
7173
|
+
};
|
|
7174
|
+
/**
|
|
7175
|
+
* Remove a genre from a user.
|
|
7176
|
+
*
|
|
7177
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
7178
|
+
*
|
|
7179
|
+
* @param genre_id The id of the genre to remove.
|
|
7180
|
+
*
|
|
7181
|
+
* @returns Promise
|
|
7182
|
+
*/
|
|
7183
|
+
Users.removeGenre = function (genre_id, params) {
|
|
7184
|
+
return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, { genre_id: genre_id }, params);
|
|
7185
|
+
};
|
|
7160
7186
|
return Users;
|
|
7161
7187
|
}());
|
|
7162
7188
|
|
|
@@ -8360,6 +8386,10 @@ var UtilityRoutes = /** @class */ (function () {
|
|
|
8360
8386
|
}
|
|
8361
8387
|
UtilityRoutes.routes = {
|
|
8362
8388
|
social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
|
|
8389
|
+
genres: { url: '/util/genres', method: HTTP_METHODS.GET },
|
|
8390
|
+
countries: { url: '/util/countries', method: HTTP_METHODS.GET },
|
|
8391
|
+
genders: { url: '/util/genders', method: HTTP_METHODS.GET },
|
|
8392
|
+
ethnicities: { url: '/util/ethnicities', method: HTTP_METHODS.GET },
|
|
8363
8393
|
};
|
|
8364
8394
|
return UtilityRoutes;
|
|
8365
8395
|
}());
|
|
@@ -8377,6 +8407,46 @@ var Utility = /** @class */ (function () {
|
|
|
8377
8407
|
Utility.listSocialInteractions = function (params) {
|
|
8378
8408
|
return Requests.processRoute(UtilityRoutes.routes.social_interactions, undefined, undefined, params);
|
|
8379
8409
|
};
|
|
8410
|
+
/**
|
|
8411
|
+
* Get all the genres available on the platform.
|
|
8412
|
+
*
|
|
8413
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
8414
|
+
*
|
|
8415
|
+
* @returns promise
|
|
8416
|
+
*/
|
|
8417
|
+
Utility.listGenres = function (params) {
|
|
8418
|
+
return Requests.processRoute(UtilityRoutes.routes.genres, undefined, undefined, params);
|
|
8419
|
+
};
|
|
8420
|
+
/**
|
|
8421
|
+
* Get all the genders available on the platform.
|
|
8422
|
+
*
|
|
8423
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenders
|
|
8424
|
+
*
|
|
8425
|
+
* @returns promise
|
|
8426
|
+
*/
|
|
8427
|
+
Utility.listGenders = function (params) {
|
|
8428
|
+
return Requests.processRoute(UtilityRoutes.routes.genders, undefined, undefined, params);
|
|
8429
|
+
};
|
|
8430
|
+
/**
|
|
8431
|
+
* Get all the countries available on the platform.
|
|
8432
|
+
*
|
|
8433
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
8434
|
+
*
|
|
8435
|
+
* @returns promise
|
|
8436
|
+
*/
|
|
8437
|
+
Utility.listCountries = function (params) {
|
|
8438
|
+
return Requests.processRoute(UtilityRoutes.routes.countries, undefined, undefined, params);
|
|
8439
|
+
};
|
|
8440
|
+
/**
|
|
8441
|
+
* Get all the ethnicities available on the platform.
|
|
8442
|
+
*
|
|
8443
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
8444
|
+
*
|
|
8445
|
+
* @returns promise
|
|
8446
|
+
*/
|
|
8447
|
+
Utility.listEthnicities = function (params) {
|
|
8448
|
+
return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
|
|
8449
|
+
};
|
|
8380
8450
|
return Utility;
|
|
8381
8451
|
}());
|
|
8382
8452
|
|
|
@@ -8867,6 +8937,12 @@ var CampaignsRoute = /** @class */ (function () {
|
|
|
8867
8937
|
getCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
8868
8938
|
updateCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
8869
8939
|
deleteCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
8940
|
+
addCountry: { url: '/users/addCountry', method: HTTP_METHODS.POST },
|
|
8941
|
+
removeCountry: { url: '/users/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
|
|
8942
|
+
addGender: { url: '/users/addGender', method: HTTP_METHODS.POST },
|
|
8943
|
+
removeGender: { url: '/users/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
|
|
8944
|
+
addEthnicity: { url: '/users/addEthnicity', method: HTTP_METHODS.POST },
|
|
8945
|
+
removeEthnicity: { url: '/users/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
8870
8946
|
};
|
|
8871
8947
|
return CampaignsRoute;
|
|
8872
8948
|
}());
|
|
@@ -9119,6 +9195,78 @@ var Campaigns = /** @class */ (function () {
|
|
|
9119
9195
|
Campaigns.deleteCampaignMention = function (campaign_id, mention_id, params) {
|
|
9120
9196
|
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
9121
9197
|
};
|
|
9198
|
+
/**
|
|
9199
|
+
* Associate a country with the campaign.
|
|
9200
|
+
*
|
|
9201
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addCountryToCampaign
|
|
9202
|
+
*
|
|
9203
|
+
* @param data The country information to be passed to update the country campaigns information.
|
|
9204
|
+
*
|
|
9205
|
+
* @returns Promise
|
|
9206
|
+
*/
|
|
9207
|
+
Campaigns.addCountry = function (data, params) {
|
|
9208
|
+
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, undefined, params);
|
|
9209
|
+
};
|
|
9210
|
+
/**
|
|
9211
|
+
* Remove a country
|
|
9212
|
+
*
|
|
9213
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeCountry
|
|
9214
|
+
*
|
|
9215
|
+
* @param country_id The id of the country to remove.
|
|
9216
|
+
*
|
|
9217
|
+
* @returns Promise
|
|
9218
|
+
*/
|
|
9219
|
+
Campaigns.removeCountry = function (country_id, params) {
|
|
9220
|
+
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, { country_id: country_id }, params);
|
|
9221
|
+
};
|
|
9222
|
+
/**
|
|
9223
|
+
* Associate a gender with the campaign.
|
|
9224
|
+
*
|
|
9225
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
9226
|
+
*
|
|
9227
|
+
* @param data The gener information to be passed to update the gender information.
|
|
9228
|
+
*
|
|
9229
|
+
* @returns Promise
|
|
9230
|
+
*/
|
|
9231
|
+
Campaigns.addGender = function (data, params) {
|
|
9232
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
|
|
9233
|
+
};
|
|
9234
|
+
/**
|
|
9235
|
+
* Remove a gender
|
|
9236
|
+
*
|
|
9237
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
9238
|
+
*
|
|
9239
|
+
* @param gender_id The id of the gender to remove.
|
|
9240
|
+
*
|
|
9241
|
+
* @returns Promise
|
|
9242
|
+
*/
|
|
9243
|
+
Campaigns.removeGender = function (gender_id, params) {
|
|
9244
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { gender_id: gender_id }, params);
|
|
9245
|
+
};
|
|
9246
|
+
/**
|
|
9247
|
+
* Associate an ethnicity with the campaign.
|
|
9248
|
+
*
|
|
9249
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
9250
|
+
*
|
|
9251
|
+
* @param data The ethnicity information to be passed to update the campaign information.
|
|
9252
|
+
*
|
|
9253
|
+
* @returns Promise
|
|
9254
|
+
*/
|
|
9255
|
+
Campaigns.addEthnicity = function (data, params) {
|
|
9256
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, undefined, params);
|
|
9257
|
+
};
|
|
9258
|
+
/**
|
|
9259
|
+
* Remove an ethnicity
|
|
9260
|
+
*
|
|
9261
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
9262
|
+
*
|
|
9263
|
+
* @param gender_id The id of the ethnicity to remove.
|
|
9264
|
+
*
|
|
9265
|
+
* @returns Promise
|
|
9266
|
+
*/
|
|
9267
|
+
Campaigns.removeEthnicity = function (ethnicity_id, params) {
|
|
9268
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { ethnicity_id: ethnicity_id }, params);
|
|
9269
|
+
};
|
|
9122
9270
|
return Campaigns;
|
|
9123
9271
|
}());
|
|
9124
9272
|
|