glitch-javascript-sdk 0.8.7 → 0.8.9
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 +70 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +26 -6
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/index.js +70 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +46 -6
- package/package.json +1 -1
- package/src/api/Campaigns.ts +40 -12
- package/src/api/Users.ts +29 -0
- package/src/routes/CampaignsRoute.ts +8 -6
- package/src/routes/UserRoutes.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1113,6 +1113,26 @@ declare class Users {
|
|
|
1113
1113
|
* @returns Promise
|
|
1114
1114
|
*/
|
|
1115
1115
|
static removeGenre<T>(genre_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Add a type to a user.
|
|
1118
|
+
*
|
|
1119
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1120
|
+
*
|
|
1121
|
+
* @param data The genre information to be passed to update the type information.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns Promise
|
|
1124
|
+
*/
|
|
1125
|
+
static addType<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Remove a genre from a user.
|
|
1128
|
+
*
|
|
1129
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
1130
|
+
*
|
|
1131
|
+
* @param genre_id The id of the genre to remove.
|
|
1132
|
+
*
|
|
1133
|
+
* @returns Promise
|
|
1134
|
+
*/
|
|
1135
|
+
static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1116
1136
|
}
|
|
1117
1137
|
|
|
1118
1138
|
declare class Events {
|
|
@@ -2501,7 +2521,7 @@ declare class Campaigns {
|
|
|
2501
2521
|
*
|
|
2502
2522
|
* @returns Promise
|
|
2503
2523
|
*/
|
|
2504
|
-
static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2524
|
+
static addCountry<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2505
2525
|
/**
|
|
2506
2526
|
* Remove a country
|
|
2507
2527
|
*
|
|
@@ -2511,7 +2531,7 @@ declare class Campaigns {
|
|
|
2511
2531
|
*
|
|
2512
2532
|
* @returns Promise
|
|
2513
2533
|
*/
|
|
2514
|
-
static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2534
|
+
static removeCountry<T>(campaign_id: string, country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2515
2535
|
/**
|
|
2516
2536
|
* Associate a gender with the campaign.
|
|
2517
2537
|
*
|
|
@@ -2521,7 +2541,7 @@ declare class Campaigns {
|
|
|
2521
2541
|
*
|
|
2522
2542
|
* @returns Promise
|
|
2523
2543
|
*/
|
|
2524
|
-
static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2544
|
+
static addGender<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2525
2545
|
/**
|
|
2526
2546
|
* Remove a gender
|
|
2527
2547
|
*
|
|
@@ -2531,7 +2551,7 @@ declare class Campaigns {
|
|
|
2531
2551
|
*
|
|
2532
2552
|
* @returns Promise
|
|
2533
2553
|
*/
|
|
2534
|
-
static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2554
|
+
static removeGender<T>(campaign_id: string, gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2535
2555
|
/**
|
|
2536
2556
|
* Associate an ethnicity with the campaign.
|
|
2537
2557
|
*
|
|
@@ -2541,7 +2561,7 @@ declare class Campaigns {
|
|
|
2541
2561
|
*
|
|
2542
2562
|
* @returns Promise
|
|
2543
2563
|
*/
|
|
2544
|
-
static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2564
|
+
static addEthnicity<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2545
2565
|
/**
|
|
2546
2566
|
* Remove an ethnicity
|
|
2547
2567
|
*
|
|
@@ -2551,7 +2571,27 @@ declare class Campaigns {
|
|
|
2551
2571
|
*
|
|
2552
2572
|
* @returns Promise
|
|
2553
2573
|
*/
|
|
2554
|
-
static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2574
|
+
static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2575
|
+
/**
|
|
2576
|
+
* Associate a type with the campaign.
|
|
2577
|
+
*
|
|
2578
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
2579
|
+
*
|
|
2580
|
+
* @param data The type information to be passed to update the campaign information.
|
|
2581
|
+
*
|
|
2582
|
+
* @returns Promise
|
|
2583
|
+
*/
|
|
2584
|
+
static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2585
|
+
/**
|
|
2586
|
+
* Remove an type
|
|
2587
|
+
*
|
|
2588
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
2589
|
+
*
|
|
2590
|
+
* @param type_id The id of the ethnicity to remove.
|
|
2591
|
+
*
|
|
2592
|
+
* @returns Promise
|
|
2593
|
+
*/
|
|
2594
|
+
static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2555
2595
|
}
|
|
2556
2596
|
|
|
2557
2597
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -296,9 +296,9 @@ class Campaigns {
|
|
|
296
296
|
*
|
|
297
297
|
* @returns Promise
|
|
298
298
|
*/
|
|
299
|
-
public static addCountry<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
299
|
+
public static addCountry<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
300
300
|
|
|
301
|
-
return Requests.processRoute(CampaignsRoute.routes.addCountry, data,
|
|
301
|
+
return Requests.processRoute(CampaignsRoute.routes.addCountry, data, {campaign_id : campaign_id}, params);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
/**
|
|
@@ -310,9 +310,9 @@ class Campaigns {
|
|
|
310
310
|
*
|
|
311
311
|
* @returns Promise
|
|
312
312
|
*/
|
|
313
|
-
public static removeCountry<T>(country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
313
|
+
public static removeCountry<T>(campaign_id: string, country_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
314
314
|
|
|
315
|
-
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, {country_id : country_id}, params);
|
|
315
|
+
return Requests.processRoute(CampaignsRoute.routes.removeCountry, undefined, {campaign_id : campaign_id, country_id : country_id}, params);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
/**
|
|
@@ -324,9 +324,9 @@ class Campaigns {
|
|
|
324
324
|
*
|
|
325
325
|
* @returns Promise
|
|
326
326
|
*/
|
|
327
|
-
public static addGender<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
327
|
+
public static addGender<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
328
328
|
|
|
329
|
-
return Requests.processRoute(CampaignsRoute.routes.addGender, data,
|
|
329
|
+
return Requests.processRoute(CampaignsRoute.routes.addGender, data, {campaign_id : campaign_id}, params);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/**
|
|
@@ -338,9 +338,9 @@ class Campaigns {
|
|
|
338
338
|
*
|
|
339
339
|
* @returns Promise
|
|
340
340
|
*/
|
|
341
|
-
public static removeGender<T>(gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
341
|
+
public static removeGender<T>(campaign_id : string, gender_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
342
342
|
|
|
343
|
-
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, {gender_id : gender_id}, params);
|
|
343
|
+
return Requests.processRoute(CampaignsRoute.routes.removeGender, undefined, {campaign_id : campaign_id, gender_id : gender_id}, params);
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
/**
|
|
@@ -352,9 +352,9 @@ class Campaigns {
|
|
|
352
352
|
*
|
|
353
353
|
* @returns Promise
|
|
354
354
|
*/
|
|
355
|
-
public static addEthnicity<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
355
|
+
public static addEthnicity<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
356
356
|
|
|
357
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
357
|
+
return Requests.processRoute(CampaignsRoute.routes.addEthnicity, data, {campaign_id : campaign_id}, params);
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/**
|
|
@@ -366,9 +366,37 @@ class Campaigns {
|
|
|
366
366
|
*
|
|
367
367
|
* @returns Promise
|
|
368
368
|
*/
|
|
369
|
-
public static removeEthnicity<T>(ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
369
|
+
public static removeEthnicity<T>(campaign_id: string, ethnicity_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
370
370
|
|
|
371
|
-
return Requests.processRoute(CampaignsRoute.routes.
|
|
371
|
+
return Requests.processRoute(CampaignsRoute.routes.removeEthnicity, undefined, {campaign_id : campaign_id, ethnicity_id : ethnicity_id}, params);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Associate a type with the campaign.
|
|
376
|
+
*
|
|
377
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/addGenderToCampaign
|
|
378
|
+
*
|
|
379
|
+
* @param data The type information to be passed to update the campaign information.
|
|
380
|
+
*
|
|
381
|
+
* @returns Promise
|
|
382
|
+
*/
|
|
383
|
+
public static addType<T>(campaign_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
384
|
+
|
|
385
|
+
return Requests.processRoute(CampaignsRoute.routes.addType, data, {campaign_id : campaign_id}, params);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Remove an type
|
|
390
|
+
*
|
|
391
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/removeGender
|
|
392
|
+
*
|
|
393
|
+
* @param type_id The id of the ethnicity to remove.
|
|
394
|
+
*
|
|
395
|
+
* @returns Promise
|
|
396
|
+
*/
|
|
397
|
+
public static removeType<T>(campaign_id: string, type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
398
|
+
|
|
399
|
+
return Requests.processRoute(CampaignsRoute.routes.removeType, undefined, {campaign_id : campaign_id, type_id : type_id}, params);
|
|
372
400
|
}
|
|
373
401
|
|
|
374
402
|
|
package/src/api/Users.ts
CHANGED
|
@@ -355,6 +355,35 @@ class Users {
|
|
|
355
355
|
return Requests.processRoute(UserRoutes.routes.removeGenre, undefined, {genre_id : genre_id}, params);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
+
/**
|
|
359
|
+
* Add a type to a user.
|
|
360
|
+
*
|
|
361
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
362
|
+
*
|
|
363
|
+
* @param data The genre information to be passed to update the type information.
|
|
364
|
+
*
|
|
365
|
+
* @returns Promise
|
|
366
|
+
*/
|
|
367
|
+
public static addType<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
368
|
+
|
|
369
|
+
return Requests.processRoute(UserRoutes.routes.addType, data, undefined, params);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Remove a genre from a user.
|
|
374
|
+
*
|
|
375
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser
|
|
376
|
+
*
|
|
377
|
+
* @param genre_id The id of the genre to remove.
|
|
378
|
+
*
|
|
379
|
+
* @returns Promise
|
|
380
|
+
*/
|
|
381
|
+
public static removeType<T>(type_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
382
|
+
|
|
383
|
+
return Requests.processRoute(UserRoutes.routes.removeType, undefined, {type_id : type_id}, params);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
358
387
|
|
|
359
388
|
|
|
360
389
|
|
|
@@ -25,12 +25,14 @@ class CampaignsRoute {
|
|
|
25
25
|
getCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.GET },
|
|
26
26
|
updateCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.PUT },
|
|
27
27
|
deleteCampaignMention :{ url: '/campaigns/{campaign_id}/mentions/{mention_id}', method: HTTP_METHODS.DELETE },
|
|
28
|
-
addCountry : { url: '/
|
|
29
|
-
removeCountry : { url: '/
|
|
30
|
-
addGender : { url: '/
|
|
31
|
-
removeGender : { url: '/
|
|
32
|
-
addEthnicity : { url: '/
|
|
33
|
-
removeEthnicity : { url: '/
|
|
28
|
+
addCountry : { url: '/campaigns/{campaign_id}/addCountry', method: HTTP_METHODS.POST },
|
|
29
|
+
removeCountry : { url: '/campaigns/{campaign_id}/removeCountry/{country_id}', method: HTTP_METHODS.DELETE },
|
|
30
|
+
addGender : { url: '/campaigns/{campaign_id}/addGender', method: HTTP_METHODS.POST },
|
|
31
|
+
removeGender : { url: '/campaigns/{campaign_id}/removeGender/{gender_id}', method: HTTP_METHODS.DELETE },
|
|
32
|
+
addEthnicity : { url: '/campaigns/{campaign_id}/addEthnicity', method: HTTP_METHODS.POST },
|
|
33
|
+
removeEthnicity : { url: '/campaigns/{campaign_id}/removeEthnicity/{ethnicity_id}', method: HTTP_METHODS.DELETE },
|
|
34
|
+
addType : { url: '/campaigns/{campaign_id}/addType', method: HTTP_METHODS.POST },
|
|
35
|
+
removeType : { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -30,6 +30,8 @@ class UserRoutes {
|
|
|
30
30
|
getFacebookGroups : { url: '/users/getFacebookGroups', method: HTTP_METHODS.GET },
|
|
31
31
|
addGenre : { url: '/users/addGenre', method: HTTP_METHODS.POST },
|
|
32
32
|
removeGenre : { url: '/users/removeGenre/{genre_id}', method: HTTP_METHODS.DELETE },
|
|
33
|
+
addType : { url: '/users/addType', method: HTTP_METHODS.POST },
|
|
34
|
+
removeType : { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
}
|