glitch-javascript-sdk 0.8.6 → 0.8.8
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 +111 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +60 -0
- package/dist/esm/api/Utility.d.ts +24 -0
- package/dist/esm/index.js +111 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +84 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +84 -0
- package/src/api/Utility.ts +33 -0
- package/src/routes/CampaignsRoute.ts +7 -1
- package/src/routes/UtilityRoutes.ts +3 -0
package/dist/cjs/index.js
CHANGED
|
@@ -21571,6 +21571,9 @@ var UtilityRoutes = /** @class */ (function () {
|
|
|
21571
21571
|
UtilityRoutes.routes = {
|
|
21572
21572
|
social_interactions: { url: '/util/socialinteractions', method: HTTP_METHODS.GET },
|
|
21573
21573
|
genres: { url: '/util/genres', method: HTTP_METHODS.GET },
|
|
21574
|
+
countries: { url: '/util/countries', method: HTTP_METHODS.GET },
|
|
21575
|
+
genders: { url: '/util/genders', method: HTTP_METHODS.GET },
|
|
21576
|
+
ethnicities: { url: '/util/ethnicities', method: HTTP_METHODS.GET },
|
|
21574
21577
|
};
|
|
21575
21578
|
return UtilityRoutes;
|
|
21576
21579
|
}());
|
|
@@ -21598,6 +21601,36 @@ var Utility = /** @class */ (function () {
|
|
|
21598
21601
|
Utility.listGenres = function (params) {
|
|
21599
21602
|
return Requests.processRoute(UtilityRoutes.routes.genres, undefined, undefined, params);
|
|
21600
21603
|
};
|
|
21604
|
+
/**
|
|
21605
|
+
* Get all the genders available on the platform.
|
|
21606
|
+
*
|
|
21607
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenders
|
|
21608
|
+
*
|
|
21609
|
+
* @returns promise
|
|
21610
|
+
*/
|
|
21611
|
+
Utility.listGenders = function (params) {
|
|
21612
|
+
return Requests.processRoute(UtilityRoutes.routes.genders, undefined, undefined, params);
|
|
21613
|
+
};
|
|
21614
|
+
/**
|
|
21615
|
+
* Get all the countries available on the platform.
|
|
21616
|
+
*
|
|
21617
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
21618
|
+
*
|
|
21619
|
+
* @returns promise
|
|
21620
|
+
*/
|
|
21621
|
+
Utility.listCountries = function (params) {
|
|
21622
|
+
return Requests.processRoute(UtilityRoutes.routes.countries, undefined, undefined, params);
|
|
21623
|
+
};
|
|
21624
|
+
/**
|
|
21625
|
+
* Get all the ethnicities available on the platform.
|
|
21626
|
+
*
|
|
21627
|
+
* @see https://api.glitch.fun/api/documentation#/Utility%20Route/getUtilGenres
|
|
21628
|
+
*
|
|
21629
|
+
* @returns promise
|
|
21630
|
+
*/
|
|
21631
|
+
Utility.listEthnicities = function (params) {
|
|
21632
|
+
return Requests.processRoute(UtilityRoutes.routes.ethnicities, undefined, undefined, params);
|
|
21633
|
+
};
|
|
21601
21634
|
return Utility;
|
|
21602
21635
|
}());
|
|
21603
21636
|
|
|
@@ -22088,6 +22121,12 @@ var CampaignsRoute = /** @class */ (function () {
|
|
|
22088
22121
|
getCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
22089
22122
|
updateCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
22090
22123
|
deleteCampaignMention: { url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
22124
|
+
addCountry: { url: '/campaigns/{campaign_id}/addCountry', method: HTTP_METHODS.POST },
|
|
22125
|
+
removeCountry: { url: '/campaigns/{campaign_id}/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
|
|
22126
|
+
addGender: { url: '/campaigns/{campaign_id}/addGender', method: HTTP_METHODS.POST },
|
|
22127
|
+
removeGender: { url: '/campaigns/{campaign_id}/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
|
|
22128
|
+
addEthnicity: { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
|
|
22129
|
+
removeEthnicity: { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
22091
22130
|
};
|
|
22092
22131
|
return CampaignsRoute;
|
|
22093
22132
|
}());
|
|
@@ -22340,6 +22379,78 @@ var Campaigns = /** @class */ (function () {
|
|
|
22340
22379
|
Campaigns.deleteCampaignMention = function (campaign_id, mention_id, params) {
|
|
22341
22380
|
return Requests.processRoute(CampaignsRoute.routes.deleteCampaignMention, {}, { campaign_id: campaign_id, mention_id: mention_id }, params);
|
|
22342
22381
|
};
|
|
22382
|
+
/**
|
|
22383
|
+
* Associate a country with the campaign.
|
|
22384
|
+
*
|
|
22385
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addCountryToCampaign
|
|
22386
|
+
*
|
|
22387
|
+
* @param data The country information to be passed to update the country campaigns information.
|
|
22388
|
+
*
|
|
22389
|
+
* @returns Promise
|
|
22390
|
+
*/
|
|
22391
|
+
Campaigns.addCountry = function (campaign_id, data, params) {
|
|
22392
|
+
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, { campaign_id: campaign_id }, params);
|
|
22393
|
+
};
|
|
22394
|
+
/**
|
|
22395
|
+
* Remove a country
|
|
22396
|
+
*
|
|
22397
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeCountry
|
|
22398
|
+
*
|
|
22399
|
+
* @param country_id The id of the country to remove.
|
|
22400
|
+
*
|
|
22401
|
+
* @returns Promise
|
|
22402
|
+
*/
|
|
22403
|
+
Campaigns.removeCountry = function (campaign_id, country_id, params) {
|
|
22404
|
+
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, { campaign_id: campaign_id, country_id: country_id }, params);
|
|
22405
|
+
};
|
|
22406
|
+
/**
|
|
22407
|
+
* Associate a gender with the campaign.
|
|
22408
|
+
*
|
|
22409
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
22410
|
+
*
|
|
22411
|
+
* @param data The gener information to be passed to update the gender information.
|
|
22412
|
+
*
|
|
22413
|
+
* @returns Promise
|
|
22414
|
+
*/
|
|
22415
|
+
Campaigns.addGender = function (campaign_id, data, params) {
|
|
22416
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, { campaign_id: campaign_id }, params);
|
|
22417
|
+
};
|
|
22418
|
+
/**
|
|
22419
|
+
* Remove a gender
|
|
22420
|
+
*
|
|
22421
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
22422
|
+
*
|
|
22423
|
+
* @param gender_id The id of the gender to remove.
|
|
22424
|
+
*
|
|
22425
|
+
* @returns Promise
|
|
22426
|
+
*/
|
|
22427
|
+
Campaigns.removeGender = function (campaign_id, gender_id, params) {
|
|
22428
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { campaign_id: campaign_id, gender_id: gender_id }, params);
|
|
22429
|
+
};
|
|
22430
|
+
/**
|
|
22431
|
+
* Associate an ethnicity with the campaign.
|
|
22432
|
+
*
|
|
22433
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
22434
|
+
*
|
|
22435
|
+
* @param data The ethnicity information to be passed to update the campaign information.
|
|
22436
|
+
*
|
|
22437
|
+
* @returns Promise
|
|
22438
|
+
*/
|
|
22439
|
+
Campaigns.addEthnicity = function (campaign_id, data, params) {
|
|
22440
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, { campaign_id: campaign_id }, params);
|
|
22441
|
+
};
|
|
22442
|
+
/**
|
|
22443
|
+
* Remove an ethnicity
|
|
22444
|
+
*
|
|
22445
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
22446
|
+
*
|
|
22447
|
+
* @param gender_id The id of the ethnicity to remove.
|
|
22448
|
+
*
|
|
22449
|
+
* @returns Promise
|
|
22450
|
+
*/
|
|
22451
|
+
Campaigns.removeEthnicity = function (campaign_id, ethnicity_id, params) {
|
|
22452
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, { campaign_id: campaign_id, ethnicity_id: ethnicity_id }, params);
|
|
22453
|
+
};
|
|
22343
22454
|
return Campaigns;
|
|
22344
22455
|
}());
|
|
22345
22456
|
|