glitch-javascript-sdk 1.0.3 → 1.0.5
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 +38 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +10 -0
- package/dist/esm/api/Influencers.d.ts +8 -0
- package/dist/esm/api/Users.d.ts +11 -0
- package/dist/esm/index.js +38 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +29 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +15 -0
- package/src/api/Influencers.ts +11 -0
- package/src/api/Users.ts +16 -0
- package/src/routes/CampaignsRoute.ts +1 -0
- package/src/routes/InfluencerRoutes.ts +2 -0
- package/src/routes/UserRoutes.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -973,6 +973,17 @@ declare class Users {
|
|
|
973
973
|
* @returns promise
|
|
974
974
|
*/
|
|
975
975
|
static syncInfluencer<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
976
|
+
/**
|
|
977
|
+
* Create profile data for an influencer based on their synced information and social media posts.
|
|
978
|
+
*
|
|
979
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/generateUserInfluencerProfile
|
|
980
|
+
*
|
|
981
|
+
* @param user_id The id of the user to update.
|
|
982
|
+
* @param data The data to update.
|
|
983
|
+
*
|
|
984
|
+
* @returns promise
|
|
985
|
+
*/
|
|
986
|
+
static generateInfluencerProfile<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
976
987
|
/**
|
|
977
988
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
978
989
|
*
|
|
@@ -2719,6 +2730,16 @@ declare class Campaigns {
|
|
|
2719
2730
|
* @returns promise
|
|
2720
2731
|
*/
|
|
2721
2732
|
static viewInfluencerInvite<T>(campaign_id: string, influencer_id: string, token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2733
|
+
/**
|
|
2734
|
+
* Updates the influencer invite information.
|
|
2735
|
+
*
|
|
2736
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/updateInfluencerInvite
|
|
2737
|
+
*
|
|
2738
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
2739
|
+
*
|
|
2740
|
+
* @returns promise
|
|
2741
|
+
*/
|
|
2742
|
+
static updateInfluencerInvite<T>(campaign_id: string, data: object, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2722
2743
|
/**
|
|
2723
2744
|
* The route for an influencer to accept an invite.
|
|
2724
2745
|
*
|
|
@@ -2966,6 +2987,14 @@ declare class Influencers {
|
|
|
2966
2987
|
* @returns promise
|
|
2967
2988
|
*/
|
|
2968
2989
|
static viewInfluencer<T>(influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2990
|
+
/**
|
|
2991
|
+
* Generate a profile for an influencer based on their data.
|
|
2992
|
+
*
|
|
2993
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/generateInfluencerProfile
|
|
2994
|
+
*
|
|
2995
|
+
* @returns promise
|
|
2996
|
+
*/
|
|
2997
|
+
static generateProfile<T>(influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2969
2998
|
}
|
|
2970
2999
|
|
|
2971
3000
|
declare class Games {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -473,6 +473,21 @@ class Campaigns {
|
|
|
473
473
|
);
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
+
/**
|
|
477
|
+
* Updates the influencer invite information.
|
|
478
|
+
*
|
|
479
|
+
* @see https://api.glitch.fun/api/documentation#/Campaigns/updateInfluencerInvite
|
|
480
|
+
*
|
|
481
|
+
* @param campaign_id The id fo the campaign to retrieve.
|
|
482
|
+
*
|
|
483
|
+
* @returns promise
|
|
484
|
+
*/
|
|
485
|
+
public static updateInfluencerInvite<T>(campaign_id: string, data: object, influencer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
return Requests.processRoute(CampaignsRoute.routes.updateInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
|
|
489
|
+
}
|
|
490
|
+
|
|
476
491
|
/**
|
|
477
492
|
* The route for an influencer to accept an invite.
|
|
478
493
|
*
|
package/src/api/Influencers.ts
CHANGED
|
@@ -27,6 +27,17 @@ class Influencers {
|
|
|
27
27
|
return Requests.processRoute(InfluencerRoutes.routes.viewInfluencer, undefined, {influencer_id : influencer_id}, params);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Generate a profile for an influencer based on their data.
|
|
32
|
+
*
|
|
33
|
+
* @see https://api.glitch.fun/api/documentation#/Influencers/generateInfluencerProfile
|
|
34
|
+
*
|
|
35
|
+
* @returns promise
|
|
36
|
+
*/
|
|
37
|
+
public static generateProfile<T>(influencer_id : string, params?: Record<string, any>) : AxiosPromise<Response<T>> {
|
|
38
|
+
return Requests.processRoute(InfluencerRoutes.routes.generateProfile, undefined, {influencer_id : influencer_id}, params);
|
|
39
|
+
}
|
|
40
|
+
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
export default Influencers;
|
package/src/api/Users.ts
CHANGED
|
@@ -91,6 +91,22 @@ class Users {
|
|
|
91
91
|
return Requests.processRoute(UserRoutes.routes.syncInfluencer, {}, undefined, params);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Create profile data for an influencer based on their synced information and social media posts.
|
|
96
|
+
*
|
|
97
|
+
* @see https://api.glitch.fun/api/documentation#/Users%20Route/generateUserInfluencerProfile
|
|
98
|
+
*
|
|
99
|
+
* @param user_id The id of the user to update.
|
|
100
|
+
* @param data The data to update.
|
|
101
|
+
*
|
|
102
|
+
* @returns promise
|
|
103
|
+
*/
|
|
104
|
+
public static generateInfluencerProfile<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
105
|
+
|
|
106
|
+
return Requests.processRoute(UserRoutes.routes.generateInfluencerProfile, {}, undefined, params);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
94
110
|
/**
|
|
95
111
|
* Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower.
|
|
96
112
|
*
|
|
@@ -37,6 +37,7 @@ class CampaignsRoute {
|
|
|
37
37
|
removeType : { url: '/campaigns/{campaign_id}/removeType/{type_id}', method: HTTP_METHODS.DELETE },
|
|
38
38
|
inviteInfluencer : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
39
39
|
viewInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.GET },
|
|
40
|
+
updateInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}', method: HTTP_METHODS.PUT },
|
|
40
41
|
listInfluencerInvites : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.GET },
|
|
41
42
|
sendInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites', method: HTTP_METHODS.POST },
|
|
42
43
|
acceptInfluencerInvite : { url: '/campaigns/{campaign_id}/influencers/invites/{influencer_id}/accept', method: HTTP_METHODS.POST },
|
|
@@ -6,6 +6,8 @@ class InfluencerRoutes {
|
|
|
6
6
|
public static routes: { [key: string]: Route } = {
|
|
7
7
|
listInfluencers: { url: '/influencers', method: HTTP_METHODS.GET },
|
|
8
8
|
viewInfluencer: { url: '/influencers/{influencer_id}', method: HTTP_METHODS.GET },
|
|
9
|
+
generateProfile: { url: '/influencers/{influencer_id}/generateProfile', method: HTTP_METHODS.POST },
|
|
10
|
+
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
}
|
package/src/routes/UserRoutes.ts
CHANGED
|
@@ -10,6 +10,7 @@ class UserRoutes {
|
|
|
10
10
|
profile :{ url: '/users/{user_id}/profile', method: HTTP_METHODS.GET },
|
|
11
11
|
me : { url: '/users/me', method: HTTP_METHODS.GET },
|
|
12
12
|
syncInfluencer : { url: '/users/syncInfluencer', method: HTTP_METHODS.POST },
|
|
13
|
+
generateInfluencerProfile : { url: '/users/generateInfluencerProfile', method: HTTP_METHODS.POST },
|
|
13
14
|
oneTimeToken : { url: '/users/oneTimeToken', method: HTTP_METHODS.GET },
|
|
14
15
|
uploadAvatar : { url: '/users/uploadAvatarImage', method: HTTP_METHODS.POST },
|
|
15
16
|
uploadBanner : { url: '/users/uploadBannerImage', method: HTTP_METHODS.POST },
|