glitch-javascript-sdk 1.1.8 → 1.2.0
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 +85 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +48 -0
- package/dist/esm/api/Influencers.d.ts +16 -0
- package/dist/esm/index.js +85 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +64 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +66 -0
- package/src/api/Influencers.ts +22 -0
- package/src/routes/CommunitiesRoute.ts +5 -0
- package/src/routes/InfluencerRoutes.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -932,6 +932,54 @@ declare class Communities {
|
|
|
932
932
|
* @returns promise
|
|
933
933
|
*/
|
|
934
934
|
static clearHellosignAuth<T>(community_id: string): AxiosPromise<Response<T>>;
|
|
935
|
+
/**
|
|
936
|
+
* List all the saved email templates for the community.
|
|
937
|
+
*
|
|
938
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/resourceCommunityList
|
|
939
|
+
*
|
|
940
|
+
* @returns promise
|
|
941
|
+
*/
|
|
942
|
+
static listEmailTemplates<T>(community_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
943
|
+
/**
|
|
944
|
+
* Create a new email template for the community
|
|
945
|
+
*
|
|
946
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/newCommunityResourceStorage
|
|
947
|
+
*
|
|
948
|
+
* @param data The data to be passed when creating a community.
|
|
949
|
+
*
|
|
950
|
+
* @returns Promise
|
|
951
|
+
*/
|
|
952
|
+
static createEmailTemplate<T>(community_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
953
|
+
/**
|
|
954
|
+
* Update an email template for the community.
|
|
955
|
+
*
|
|
956
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
|
|
957
|
+
*
|
|
958
|
+
* @param community_id The id of the community to update.
|
|
959
|
+
* @param data The data to update.
|
|
960
|
+
*
|
|
961
|
+
* @returns promise
|
|
962
|
+
*/
|
|
963
|
+
static updateEmailTemplate<T>(community_id: string, template_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
964
|
+
/**
|
|
965
|
+
* Retrieve a single email template for the community.
|
|
966
|
+
*
|
|
967
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/showCommunityStorage
|
|
968
|
+
*
|
|
969
|
+
* @param community_id The id fo the community to retrieve.
|
|
970
|
+
*
|
|
971
|
+
* @returns promise
|
|
972
|
+
*/
|
|
973
|
+
static viewEmailTemplate<T>(community_id: string, template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
974
|
+
/**
|
|
975
|
+
* Deletes an email template for the community.
|
|
976
|
+
*
|
|
977
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/destoryCommunityStorage
|
|
978
|
+
*
|
|
979
|
+
* @param community_id The id of the community to delete.
|
|
980
|
+
* @returns promise
|
|
981
|
+
*/
|
|
982
|
+
static deleteEmailTemplate<T>(community_id: string, template_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
935
983
|
}
|
|
936
984
|
|
|
937
985
|
declare class Users {
|
|
@@ -3157,6 +3205,14 @@ declare class Feedback {
|
|
|
3157
3205
|
}
|
|
3158
3206
|
|
|
3159
3207
|
declare class Influencers {
|
|
3208
|
+
/**
|
|
3209
|
+
* Add a new influencer to the platform.
|
|
3210
|
+
*
|
|
3211
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/createInfluencersNotes
|
|
3212
|
+
*
|
|
3213
|
+
* @returns promise
|
|
3214
|
+
*/
|
|
3215
|
+
static addInfluencer<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3160
3216
|
/**
|
|
3161
3217
|
* Get a list of influencers available on he platform.
|
|
3162
3218
|
*
|
|
@@ -3221,6 +3277,14 @@ declare class Influencers {
|
|
|
3221
3277
|
* @returns promise
|
|
3222
3278
|
*/
|
|
3223
3279
|
static deleteNote<T>(influencer_id: string, note_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3280
|
+
/**
|
|
3281
|
+
* Get a list of contracts associated with an influencer.
|
|
3282
|
+
*
|
|
3283
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencers
|
|
3284
|
+
*
|
|
3285
|
+
* @returns promise
|
|
3286
|
+
*/
|
|
3287
|
+
static listContracts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3224
3288
|
}
|
|
3225
3289
|
|
|
3226
3290
|
declare class Games {
|
package/package.json
CHANGED
package/src/api/Communities.ts
CHANGED
|
@@ -409,6 +409,72 @@ class Communities {
|
|
|
409
409
|
return Requests.processRoute(CommunitiesRoute.routes.clearHellosignAuth, {}, {community_id : community_id});
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
+
/**
|
|
413
|
+
* List all the saved email templates for the community.
|
|
414
|
+
*
|
|
415
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/resourceCommunityList
|
|
416
|
+
*
|
|
417
|
+
* @returns promise
|
|
418
|
+
*/
|
|
419
|
+
public static listEmailTemplates<T>(community_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
420
|
+
return Requests.processRoute(CommunitiesRoute.routes.listEmailTemplates, undefined, {community_id : community_id}, params);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Create a new email template for the community
|
|
425
|
+
*
|
|
426
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/newCommunityResourceStorage
|
|
427
|
+
*
|
|
428
|
+
* @param data The data to be passed when creating a community.
|
|
429
|
+
*
|
|
430
|
+
* @returns Promise
|
|
431
|
+
*/
|
|
432
|
+
public static createEmailTemplate<T>(community_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
433
|
+
|
|
434
|
+
return Requests.processRoute(CommunitiesRoute.routes.createEmailTemplate, data, {community_id : community_id}, params);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Update an email template for the community.
|
|
439
|
+
*
|
|
440
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/updateCommunityStorage
|
|
441
|
+
*
|
|
442
|
+
* @param community_id The id of the community to update.
|
|
443
|
+
* @param data The data to update.
|
|
444
|
+
*
|
|
445
|
+
* @returns promise
|
|
446
|
+
*/
|
|
447
|
+
public static updateEmailTemplate<T>(community_id : string, template_id : string, data : object, params?: Record<string, any>) : AxiosPromise<Response<T>>{
|
|
448
|
+
|
|
449
|
+
return Requests.processRoute(CommunitiesRoute.routes.updateEmailTemplate, data, {community_id : community_id, template_id : template_id}, params);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Retrieve a single email template for the community.
|
|
454
|
+
*
|
|
455
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/showCommunityStorage
|
|
456
|
+
*
|
|
457
|
+
* @param community_id The id fo the community to retrieve.
|
|
458
|
+
*
|
|
459
|
+
* @returns promise
|
|
460
|
+
*/
|
|
461
|
+
public static viewEmailTemplate<T>(community_id : string, template_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
462
|
+
|
|
463
|
+
return Requests.processRoute(CommunitiesRoute.routes.viewEmailTemplate, {}, {community_id : community_id, template_id : template_id}, params);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Deletes an email template for the community.
|
|
468
|
+
*
|
|
469
|
+
* @see https://api.glitch.fun/api/documentation#/Community%20Route/destoryCommunityStorage
|
|
470
|
+
*
|
|
471
|
+
* @param community_id The id of the community to delete.
|
|
472
|
+
* @returns promise
|
|
473
|
+
*/
|
|
474
|
+
public static deleteEmailTemplate<T>(community_id : string, template_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
475
|
+
|
|
476
|
+
return Requests.processRoute(CommunitiesRoute.routes.deleteEmailTemplate, {}, {community_id : community_id, template_id : template_id});
|
|
477
|
+
}
|
|
412
478
|
|
|
413
479
|
|
|
414
480
|
|
package/src/api/Influencers.ts
CHANGED
|
@@ -5,6 +5,17 @@ import { AxiosPromise } from "axios";
|
|
|
5
5
|
|
|
6
6
|
class Influencers {
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Add a new influencer to the platform.
|
|
10
|
+
*
|
|
11
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/createInfluencersNotes
|
|
12
|
+
*
|
|
13
|
+
* @returns promise
|
|
14
|
+
*/
|
|
15
|
+
public static addInfluencer<T>(data?: object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(InfluencerRoutes.routes.addInfluencer, data, {}, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
/**
|
|
9
20
|
* Get a list of influencers available on he platform.
|
|
10
21
|
*
|
|
@@ -93,6 +104,17 @@ class Influencers {
|
|
|
93
104
|
return Requests.processRoute(InfluencerRoutes.routes.deleteNote, data, {influencer_id : influencer_id, note_id : note_id}, params);
|
|
94
105
|
}
|
|
95
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Get a list of contracts associated with an influencer.
|
|
109
|
+
*
|
|
110
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/getInfluencers
|
|
111
|
+
*
|
|
112
|
+
* @returns promise
|
|
113
|
+
*/
|
|
114
|
+
public static listContracts<T>(params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
115
|
+
return Requests.processRoute(InfluencerRoutes.routes.listContracts, undefined, undefined, params);
|
|
116
|
+
}
|
|
117
|
+
|
|
96
118
|
|
|
97
119
|
}
|
|
98
120
|
|
|
@@ -30,6 +30,11 @@ class CommunitiesRoute {
|
|
|
30
30
|
clearDocusignAuth : { url: '/communities/{community_id}/clearDocusignAuth', method: HTTP_METHODS.DELETE },
|
|
31
31
|
clearHellosignAuth : { url: '/communities/{community_id}/clearHellosignAuth', method: HTTP_METHODS.DELETE },
|
|
32
32
|
clearSimplesignAuth : { url: '/communities/{community_id}/clearSimplesignAuth', method: HTTP_METHODS.DELETE },
|
|
33
|
+
listEmailTemplates : { url: '/communities/{community_id}/emails/templates', method: HTTP_METHODS.GET },
|
|
34
|
+
createEmailTemplate: { url: '/communities/{community_id}/emails/templates', method: HTTP_METHODS.POST },
|
|
35
|
+
viewEmailTemplate : { url: '/communities/{community_id}/emails/templates/{template_id}', method: HTTP_METHODS.GET },
|
|
36
|
+
updateEmailTemplate :{ url: '/communities/{community_id}/emails/templates/{template_id}', method: HTTP_METHODS.PUT },
|
|
37
|
+
deleteEmailTemplate : { url: '/communities/{community_id}/emails/templates/{template_id}', method: HTTP_METHODS.DELETE },
|
|
33
38
|
|
|
34
39
|
};
|
|
35
40
|
|
|
@@ -4,6 +4,7 @@ import HTTP_METHODS from "../constants/HttpMethods";
|
|
|
4
4
|
class InfluencerRoutes {
|
|
5
5
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
|
+
addInfluencer : { url: '/influencers', method: HTTP_METHODS.POST },
|
|
7
8
|
listInfluencers: { url: '/influencers', method: HTTP_METHODS.GET },
|
|
8
9
|
viewInfluencer: { url: '/influencers/{influencer_id}', method: HTTP_METHODS.GET },
|
|
9
10
|
generateProfile: { url: '/influencers/{influencer_id}/generateProfile', method: HTTP_METHODS.POST },
|
|
@@ -12,6 +13,7 @@ class InfluencerRoutes {
|
|
|
12
13
|
createNote: { url: '/influencers/{influencer_id}/notes', method: HTTP_METHODS.POST },
|
|
13
14
|
updateNote: { url: '/influencers/{influencer_id}/notes/{note_id}', method: HTTP_METHODS.PUT },
|
|
14
15
|
deleteNote: { url: '/influencers/{influencer_id}/notes/{note_id}', method: HTTP_METHODS.DELETE },
|
|
16
|
+
listContracts: { url: '/influencers/contracts', method: HTTP_METHODS.GET },
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
}
|