glitch-javascript-sdk 3.2.6 → 3.2.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/index.d.ts CHANGED
@@ -3693,7 +3693,7 @@ declare class SocialPosts {
3693
3693
  *
3694
3694
  * @returns promise
3695
3695
  */
3696
- static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
3696
+ static reports<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3697
3697
  /**
3698
3698
  * Update the information about a post impressions, for posts who API do not give view counts.
3699
3699
  *
@@ -4770,6 +4770,14 @@ declare class Campaigns {
4770
4770
  * @returns promise
4771
4771
  */
4772
4772
  static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
4773
+ /**
4774
+ * List public influencer campaigns.
4775
+ *
4776
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/getPublicCampaigns
4777
+ *
4778
+ * @returns promise
4779
+ */
4780
+ static listPublic<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
4773
4781
  /**
4774
4782
  * Create a new campaign.
4775
4783
  *
@@ -4926,6 +4934,13 @@ declare class Campaigns {
4926
4934
  * @returns promise
4927
4935
  */
4928
4936
  static updateInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4937
+ /**
4938
+ * Delete an influencer campaign relationship.
4939
+ *
4940
+ * The backend route currently exists, but the controller destroy implementation is intentionally
4941
+ * treated as an agent/admin stop-gate because removal can orphan posts, payouts, or contracts.
4942
+ */
4943
+ static deleteInfluencerCampaign<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4929
4944
  /**
4930
4945
  * Retrieve the information for a single campaign.
4931
4946
  *
@@ -5683,6 +5698,14 @@ declare class Messages {
5683
5698
  * @returns A promise
5684
5699
  */
5685
5700
  static sendMessage<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5701
+ /**
5702
+ * Updates a message.
5703
+ *
5704
+ * @see https://api.glitch.fun/api/documentation#/Messages/updateMessage
5705
+ *
5706
+ * @returns A promise
5707
+ */
5708
+ static updateMessage<T>(message_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5686
5709
  /**
5687
5710
  * Deletes a message.
5688
5711
  *
@@ -6884,6 +6907,14 @@ declare class Scheduler {
6884
6907
  * @returns promise
6885
6908
  */
6886
6909
  static getRedditSubredditFlairs<T>(scheduler_id: string, subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
6910
+ /**
6911
+ * Get posting rules for a specific Reddit subreddit.
6912
+ *
6913
+ * @param scheduler_id The ID of the promotion schedule.
6914
+ * @param subreddit The name of the subreddit.
6915
+ * @returns promise
6916
+ */
6917
+ static getRedditSubredditRules<T>(scheduler_id: string, subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
6887
6918
  /**
6888
6919
  * Get Discord channels associated with the scheduler's Discord account.
6889
6920
  *
@@ -6974,6 +7005,36 @@ declare class Scheduler {
6974
7005
  * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
6975
7006
  */
6976
7007
  static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7008
+ /**
7009
+ * Search cross-promote opportunities using the normalized route family.
7010
+ * GET /schedulers/cross-promote/search
7011
+ */
7012
+ static crossPromoteSearch<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
7013
+ /**
7014
+ * Send a normalized cross-promote invitation.
7015
+ * POST /schedulers/cross-promote/invitations
7016
+ */
7017
+ static crossPromoteInvitationSend<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
7018
+ /**
7019
+ * Respond to a normalized cross-promote invitation.
7020
+ * POST /schedulers/cross-promote/invitations/{invitation_id}/respond
7021
+ */
7022
+ static crossPromoteInvitationRespond<T>(invitation_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
7023
+ /**
7024
+ * List normalized cross-promote relationships.
7025
+ * GET /schedulers/cross-promote/relationships
7026
+ */
7027
+ static crossPromoteRelationshipsList<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
7028
+ /**
7029
+ * End a normalized cross-promote relationship.
7030
+ * POST /schedulers/cross-promote/relationships/{relationship_id}/end
7031
+ */
7032
+ static crossPromoteRelationshipEnd<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7033
+ /**
7034
+ * List normalized cross-promote relationship logs.
7035
+ * GET /schedulers/cross-promote/relationships/{relationship_id}/logs
7036
+ */
7037
+ static crossPromoteRelationshipLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
6977
7038
  /**
6978
7039
  * List platform-level businesses for the given campaign ID,
6979
7040
  * as defined by /schedulers/{scheduler_id}/businesses on the backend.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,6 +16,17 @@ class Campaigns {
16
16
  return Requests.processRoute(CampaignsRoute.routes.listCampaigns, undefined, undefined, params);
17
17
  }
18
18
 
19
+ /**
20
+ * List public influencer campaigns.
21
+ *
22
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/getPublicCampaigns
23
+ *
24
+ * @returns promise
25
+ */
26
+ public static listPublic<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
27
+ return Requests.processRoute(CampaignsRoute.routes.listPublicCampaigns, undefined, undefined, params);
28
+ }
29
+
19
30
  /**
20
31
  * Create a new campaign.
21
32
  *
@@ -233,6 +244,17 @@ class Campaigns {
233
244
  return Requests.processRoute(CampaignsRoute.routes.updateInfluencerCampaign, data, { campaign_id: campaign_id, user_id: user_id }, params);
234
245
  }
235
246
 
247
+ /**
248
+ * Delete an influencer campaign relationship.
249
+ *
250
+ * The backend route currently exists, but the controller destroy implementation is intentionally
251
+ * treated as an agent/admin stop-gate because removal can orphan posts, payouts, or contracts.
252
+ */
253
+ public static deleteInfluencerCampaign<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
254
+
255
+ return Requests.processRoute(CampaignsRoute.routes.deleteInfluencerCampaign, undefined, { campaign_id: campaign_id, user_id: user_id }, params);
256
+ }
257
+
236
258
  /**
237
259
  * Retrieve the information for a single campaign.
238
260
  *
@@ -734,7 +756,7 @@ class Campaigns {
734
756
  * @returns promise
735
757
  */
736
758
  public static listPayouts<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
737
- return Requests.processRoute(CampaignsRoute.routes.getLedger, undefined, { campaign_id: campaign_id }, params);
759
+ return Requests.processRoute(CampaignsRoute.routes.listPayouts, undefined, { campaign_id: campaign_id }, params);
738
760
  }
739
761
 
740
762
  /**
@@ -1075,4 +1097,4 @@ class Campaigns {
1075
1097
  }
1076
1098
  }
1077
1099
 
1078
- export default Campaigns;
1100
+ export default Campaigns;
@@ -27,6 +27,17 @@ class Messages {
27
27
  return Requests.processRoute(MessagesRoute.routes.sendMessage, data, {}, params);
28
28
  }
29
29
 
30
+ /**
31
+ * Updates a message.
32
+ *
33
+ * @see https://api.glitch.fun/api/documentation#/Messages/updateMessage
34
+ *
35
+ * @returns A promise
36
+ */
37
+ public static updateMessage<T>(message_id: string, data? : object, params?: Record<string, any>) : AxiosPromise<Response<T>> {
38
+ return Requests.processRoute(MessagesRoute.routes.updateMessage, data, {message_id : message_id}, params);
39
+ }
40
+
30
41
  /**
31
42
  * Deletes a message.
32
43
  *
@@ -65,4 +76,4 @@ class Messages {
65
76
 
66
77
  }
67
78
 
68
- export default Messages;
79
+ export default Messages;
@@ -410,6 +410,17 @@ class Scheduler {
410
410
  return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditFlairs, {}, { scheduler_id, subreddit }, params);
411
411
  }
412
412
 
413
+ /**
414
+ * Get posting rules for a specific Reddit subreddit.
415
+ *
416
+ * @param scheduler_id The ID of the promotion schedule.
417
+ * @param subreddit The name of the subreddit.
418
+ * @returns promise
419
+ */
420
+ public static getRedditSubredditRules<T>(scheduler_id: string, subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
421
+ return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditRules, {}, { scheduler_id, subreddit }, params);
422
+ }
423
+
413
424
  /**
414
425
  * Get Discord channels associated with the scheduler's Discord account.
415
426
  *
@@ -612,6 +623,84 @@ class Scheduler {
612
623
  );
613
624
  }
614
625
 
626
+ /**
627
+ * Search cross-promote opportunities using the normalized route family.
628
+ * GET /schedulers/cross-promote/search
629
+ */
630
+ public static crossPromoteSearch<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
631
+ return Requests.processRoute(
632
+ SchedulerRoute.routes.crossPromoteSearch,
633
+ {},
634
+ {},
635
+ params
636
+ );
637
+ }
638
+
639
+ /**
640
+ * Send a normalized cross-promote invitation.
641
+ * POST /schedulers/cross-promote/invitations
642
+ */
643
+ public static crossPromoteInvitationSend<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
644
+ return Requests.processRoute(
645
+ SchedulerRoute.routes.crossPromoteInvitationSend,
646
+ data,
647
+ {},
648
+ params
649
+ );
650
+ }
651
+
652
+ /**
653
+ * Respond to a normalized cross-promote invitation.
654
+ * POST /schedulers/cross-promote/invitations/{invitation_id}/respond
655
+ */
656
+ public static crossPromoteInvitationRespond<T>(invitation_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
657
+ return Requests.processRoute(
658
+ SchedulerRoute.routes.crossPromoteInvitationRespond,
659
+ data,
660
+ { invitation_id },
661
+ params
662
+ );
663
+ }
664
+
665
+ /**
666
+ * List normalized cross-promote relationships.
667
+ * GET /schedulers/cross-promote/relationships
668
+ */
669
+ public static crossPromoteRelationshipsList<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
670
+ return Requests.processRoute(
671
+ SchedulerRoute.routes.crossPromoteRelationshipsList,
672
+ {},
673
+ {},
674
+ params
675
+ );
676
+ }
677
+
678
+ /**
679
+ * End a normalized cross-promote relationship.
680
+ * POST /schedulers/cross-promote/relationships/{relationship_id}/end
681
+ */
682
+ public static crossPromoteRelationshipEnd<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
683
+ return Requests.processRoute(
684
+ SchedulerRoute.routes.crossPromoteRelationshipEnd,
685
+ {},
686
+ { relationship_id },
687
+ params
688
+ );
689
+ }
690
+
691
+ /**
692
+ * List normalized cross-promote relationship logs.
693
+ * GET /schedulers/cross-promote/relationships/{relationship_id}/logs
694
+ */
695
+ public static crossPromoteRelationshipLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
696
+ return Requests.processRoute(
697
+ SchedulerRoute.routes.crossPromoteRelationshipLogs,
698
+ {},
699
+ { relationship_id },
700
+ params
701
+ );
702
+ }
703
+
615
704
  /**
616
705
  * List platform-level businesses for the given campaign ID,
617
706
  * as defined by /schedulers/{scheduler_id}/businesses on the backend.
@@ -161,8 +161,8 @@ class SocialPosts {
161
161
  *
162
162
  * @returns promise
163
163
  */
164
- public static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
165
- return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
164
+ public static reports<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
165
+ return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, { post_id }, params);
166
166
  }
167
167
 
168
168
  /**
@@ -533,4 +533,4 @@ class SocialPosts {
533
533
  }
534
534
  }
535
535
 
536
- export default SocialPosts;
536
+ export default SocialPosts;
@@ -5,6 +5,7 @@ class CampaignsRoute {
5
5
 
6
6
  public static routes: { [key: string]: Route } = {
7
7
  listCampaigns: { url: '/campaigns', method: HTTP_METHODS.GET },
8
+ listPublicCampaigns: { url: '/campaigns/public', method: HTTP_METHODS.GET },
8
9
  createCampaign: { url: '/campaigns', method: HTTP_METHODS.POST },
9
10
  viewCampaign: { url: '/campaigns/{campaign_id}', method: HTTP_METHODS.GET },
10
11
  updateCampaign: { url: '/campaigns/{campaign_id}', method: HTTP_METHODS.PUT },
@@ -21,6 +22,7 @@ class CampaignsRoute {
21
22
  listInfluencerCampaigns: { url: '/campaigns/influencers', method: HTTP_METHODS.GET },
22
23
  viewInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.GET },
23
24
  updateInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.PUT },
25
+ deleteInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.DELETE },
24
26
  markInfluencerCampaignComplete: { url: '/campaigns/{campaign_id}/influencers/{user_id}/setComplete', method: HTTP_METHODS.POST },
25
27
  markInfluencerCampaignIncomplete: { url: '/campaigns/{campaign_id}/influencers/{user_id}/setIncomplete', method: HTTP_METHODS.POST },
26
28
  listInfluencerCampaignLinks: { url: '/campaigns/{campaign_id}/influencers/{user_id}/links', method: HTTP_METHODS.GET },
@@ -110,4 +112,4 @@ class CampaignsRoute {
110
112
 
111
113
  }
112
114
 
113
- export default CampaignsRoute;
115
+ export default CampaignsRoute;
@@ -6,6 +6,7 @@ class MessagesRoute {
6
6
  public static routes: { [key: string]: Route } = {
7
7
  listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
8
8
  sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
9
+ updateMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.PUT },
9
10
  deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
10
11
  createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
11
12
  getThread: { url: '/messages/thread/{thread_id}', method: HTTP_METHODS.GET },
@@ -13,4 +14,4 @@ class MessagesRoute {
13
14
 
14
15
  }
15
16
 
16
- export default MessagesRoute;
17
+ export default MessagesRoute;
@@ -13,10 +13,10 @@ class PostsRoute {
13
13
  join: { url: '/posts/{post_id}/join', method: HTTP_METHODS.POST },
14
14
  follow: { url: '/posts/{post_id}/follow', method: HTTP_METHODS.POST },
15
15
  leave: { url: '/posts/{post_id}/leave', method: HTTP_METHODS.DELETE },
16
- resolve: { url: '/posts/{post_id}/resolve', method: HTTP_METHODS.POST },
16
+ resolve: { url: '/posts/{post_id}/resolve', method: HTTP_METHODS.PATCH },
17
17
  updatePreferences: { url: '/posts/{post_id}/participants/me', method: HTTP_METHODS.PUT },
18
18
  };
19
19
 
20
20
  }
21
21
 
22
- export default PostsRoute;
22
+ export default PostsRoute;
@@ -48,6 +48,7 @@ class SchedulerRoute {
48
48
  getInstagramAccounts: { url: '/schedulers/{scheduler_id}/instagram/accounts', method: HTTP_METHODS.GET },
49
49
  getRedditSubreddits: { url: '/schedulers/{scheduler_id}/reddit/subreddits', method: HTTP_METHODS.GET },
50
50
  getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
51
+ getRedditSubredditRules: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/rules', method: HTTP_METHODS.GET },
51
52
  getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
52
53
 
53
54
  crossPromoteListRelationships: {
@@ -90,6 +91,30 @@ class SchedulerRoute {
90
91
  url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
91
92
  method: HTTP_METHODS.GET
92
93
  },
94
+ crossPromoteSearch: {
95
+ url: '/schedulers/cross-promote/search',
96
+ method: HTTP_METHODS.GET
97
+ },
98
+ crossPromoteInvitationSend: {
99
+ url: '/schedulers/cross-promote/invitations',
100
+ method: HTTP_METHODS.POST
101
+ },
102
+ crossPromoteInvitationRespond: {
103
+ url: '/schedulers/cross-promote/invitations/{invitation_id}/respond',
104
+ method: HTTP_METHODS.POST
105
+ },
106
+ crossPromoteRelationshipsList: {
107
+ url: '/schedulers/cross-promote/relationships',
108
+ method: HTTP_METHODS.GET
109
+ },
110
+ crossPromoteRelationshipEnd: {
111
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/end',
112
+ method: HTTP_METHODS.POST
113
+ },
114
+ crossPromoteRelationshipLogs: {
115
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/logs',
116
+ method: HTTP_METHODS.GET
117
+ },
93
118
 
94
119
  getCampaignBusinesses: {
95
120
  url: "/schedulers/{scheduler_id}/businesses",