glitch-javascript-sdk 2.0.1 → 2.0.3

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
@@ -2117,6 +2117,31 @@ declare class Users {
2117
2117
  * @returns promise
2118
2118
  */
2119
2119
  static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
2120
+ /**
2121
+ * Resends the verification email to the authenticated user.
2122
+ *
2123
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail
2124
+ *
2125
+ * @returns Promise
2126
+ */
2127
+ static resendVerificationEmail<T>(): AxiosPromise<Response<T>>;
2128
+ /**
2129
+ * Clear Instagram authentication information from the current user.
2130
+ *
2131
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth
2132
+ *
2133
+ * @returns promise
2134
+ */
2135
+ static clearInstagramAuth<T>(): AxiosPromise<Response<T>>;
2136
+ /**
2137
+ * Gets the rules for a specific subreddit.
2138
+ *
2139
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules
2140
+ *
2141
+ * @param subreddit The name of the subreddit to get rules for.
2142
+ * @returns Promise resolving to the list of rules
2143
+ */
2144
+ static getSubredditRules<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
2120
2145
  }
2121
2146
 
2122
2147
  declare class Events {
@@ -5325,6 +5350,81 @@ declare class Scheduler {
5325
5350
  * @returns A response object with data (funding instruments)
5326
5351
  */
5327
5352
  static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5353
+ /**
5354
+ * List all destinations for a title update.
5355
+ *
5356
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
5357
+ *
5358
+ * @param scheduler_id The ID of the promotion schedule.
5359
+ * @param update_id The ID of the title update.
5360
+ * @returns promise
5361
+ */
5362
+ static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5363
+ /**
5364
+ * Create a new destination for a title update.
5365
+ *
5366
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
5367
+ *
5368
+ * @param scheduler_id The ID of the promotion schedule.
5369
+ * @param update_id The ID of the title update.
5370
+ * @param data The data for the new destination.
5371
+ * @returns promise
5372
+ */
5373
+ static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5374
+ /**
5375
+ * Get a specific title update destination.
5376
+ *
5377
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
5378
+ *
5379
+ * @param scheduler_id The ID of the promotion schedule.
5380
+ * @param update_id The ID of the title update.
5381
+ * @param destination_id The ID of the destination.
5382
+ * @returns promise
5383
+ */
5384
+ static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5385
+ /**
5386
+ * Update a title update destination.
5387
+ *
5388
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
5389
+ *
5390
+ * @param scheduler_id The ID of the promotion schedule.
5391
+ * @param update_id The ID of the title update.
5392
+ * @param destination_id The ID of the destination.
5393
+ * @param data The data to update.
5394
+ * @returns promise
5395
+ */
5396
+ static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5397
+ /**
5398
+ * Delete a title update destination.
5399
+ *
5400
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
5401
+ *
5402
+ * @param scheduler_id The ID of the promotion schedule.
5403
+ * @param update_id The ID of the title update.
5404
+ * @param destination_id The ID of the destination.
5405
+ * @returns promise
5406
+ */
5407
+ static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5408
+ /**
5409
+ * Get AI-powered subreddit recommendations for a scheduler.
5410
+ *
5411
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
5412
+ *
5413
+ * @param scheduler_id The ID of the promotion schedule.
5414
+ * @param data The context for the post (title, content, media type).
5415
+ * @returns promise
5416
+ */
5417
+ static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5418
+ /**
5419
+ * Generate tailored content for a specific subreddit.
5420
+ *
5421
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
5422
+ *
5423
+ * @param scheduler_id The ID of the promotion schedule.
5424
+ * @param data The target subreddit and post context.
5425
+ * @returns promise
5426
+ */
5427
+ static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5328
5428
  }
5329
5429
 
5330
5430
  declare class Funnel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -681,6 +681,102 @@ class Scheduler {
681
681
  );
682
682
  }
683
683
 
684
+ /**
685
+ * List all destinations for a title update.
686
+ *
687
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
688
+ *
689
+ * @param scheduler_id The ID of the promotion schedule.
690
+ * @param update_id The ID of the title update.
691
+ * @returns promise
692
+ */
693
+ public static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
694
+ return Requests.processRoute(SchedulerRoute.routes.listDestinations, {}, { scheduler_id, update_id }, params);
695
+ }
696
+
697
+ /**
698
+ * Create a new destination for a title update.
699
+ *
700
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
701
+ *
702
+ * @param scheduler_id The ID of the promotion schedule.
703
+ * @param update_id The ID of the title update.
704
+ * @param data The data for the new destination.
705
+ * @returns promise
706
+ */
707
+ public static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
708
+ return Requests.processRoute(SchedulerRoute.routes.createDestination, data, { scheduler_id, update_id }, params);
709
+ }
710
+
711
+ /**
712
+ * Get a specific title update destination.
713
+ *
714
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
715
+ *
716
+ * @param scheduler_id The ID of the promotion schedule.
717
+ * @param update_id The ID of the title update.
718
+ * @param destination_id The ID of the destination.
719
+ * @returns promise
720
+ */
721
+ public static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
722
+ return Requests.processRoute(SchedulerRoute.routes.getDestination, {}, { scheduler_id, update_id, destination_id }, params);
723
+ }
724
+
725
+ /**
726
+ * Update a title update destination.
727
+ *
728
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
729
+ *
730
+ * @param scheduler_id The ID of the promotion schedule.
731
+ * @param update_id The ID of the title update.
732
+ * @param destination_id The ID of the destination.
733
+ * @param data The data to update.
734
+ * @returns promise
735
+ */
736
+ public static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
737
+ return Requests.processRoute(SchedulerRoute.routes.updateDestination, data, { scheduler_id, update_id, destination_id }, params);
738
+ }
739
+
740
+ /**
741
+ * Delete a title update destination.
742
+ *
743
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
744
+ *
745
+ * @param scheduler_id The ID of the promotion schedule.
746
+ * @param update_id The ID of the title update.
747
+ * @param destination_id The ID of the destination.
748
+ * @returns promise
749
+ */
750
+ public static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
751
+ return Requests.processRoute(SchedulerRoute.routes.deleteDestination, {}, { scheduler_id, update_id, destination_id }, params);
752
+ }
753
+
754
+ /**
755
+ * Get AI-powered subreddit recommendations for a scheduler.
756
+ *
757
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
758
+ *
759
+ * @param scheduler_id The ID of the promotion schedule.
760
+ * @param data The context for the post (title, content, media type).
761
+ * @returns promise
762
+ */
763
+ public static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
764
+ return Requests.processRoute(SchedulerRoute.routes.getRedditRecommendations, data, { scheduler_id }, params);
765
+ }
766
+
767
+ /**
768
+ * Generate tailored content for a specific subreddit.
769
+ *
770
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
771
+ *
772
+ * @param scheduler_id The ID of the promotion schedule.
773
+ * @param data The target subreddit and post context.
774
+ * @returns promise
775
+ */
776
+ public static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
777
+ return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id }, params);
778
+ }
779
+
684
780
  }
685
781
 
686
782
  export default Scheduler;
package/src/api/Users.ts CHANGED
@@ -529,6 +529,40 @@ class Users {
529
529
  }
530
530
 
531
531
 
532
+ /**
533
+ * Resends the verification email to the authenticated user.
534
+ *
535
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail
536
+ *
537
+ * @returns Promise
538
+ */
539
+ public static resendVerificationEmail<T>(): AxiosPromise<Response<T>> {
540
+ return Requests.processRoute(UserRoutes.routes.resendVerificationEmail, {});
541
+ }
542
+
543
+ /**
544
+ * Clear Instagram authentication information from the current user.
545
+ *
546
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth
547
+ *
548
+ * @returns promise
549
+ */
550
+ public static clearInstagramAuth<T>(): AxiosPromise<Response<T>> {
551
+ return Requests.processRoute(UserRoutes.routes.clearInstagramAuth, {});
552
+ }
553
+
554
+ /**
555
+ * Gets the rules for a specific subreddit.
556
+ *
557
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules
558
+ *
559
+ * @param subreddit The name of the subreddit to get rules for.
560
+ * @returns Promise resolving to the list of rules
561
+ */
562
+ public static getSubredditRules<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
563
+ return Requests.processRoute(UserRoutes.routes.getSubredditRules, undefined, { subreddit: subreddit }, params);
564
+ }
565
+
532
566
 
533
567
 
534
568
 
@@ -110,7 +110,14 @@ class SchedulerRoute {
110
110
  method: HTTP_METHODS.POST
111
111
  },
112
112
 
113
+ getRedditRecommendations: { url: '/schedulers/{scheduler_id}/reddit/recommendations', method: HTTP_METHODS.POST },
114
+ generateRedditContent: { url: '/schedulers/{scheduler_id}/reddit/generateContent', method: HTTP_METHODS.POST },
113
115
 
116
+ listDestinations: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.GET },
117
+ createDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.POST },
118
+ getDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.GET },
119
+ updateDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.PUT },
120
+ deleteDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.DELETE },
114
121
 
115
122
  };
116
123
  }
@@ -36,7 +36,7 @@ class UserRoutes {
36
36
  addType: { url: '/users/addType', method: HTTP_METHODS.POST },
37
37
  removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
38
38
  getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
39
- getPayouts: { url: '/users/payouts', method: HTTP_METHODS.GET },
39
+ getPayouts: { url: '/users/getCampaignPayouts', method: HTTP_METHODS.GET },
40
40
  verifyAccount: { url: '/users/verify', method: HTTP_METHODS.POST },
41
41
  getInstagramAccounts: { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
42
42
 
@@ -46,6 +46,11 @@ class UserRoutes {
46
46
 
47
47
  search: { url: '/users/search', method: HTTP_METHODS.GET },
48
48
 
49
+ resendVerificationEmail: { url: '/users/resendVerificationEmail', method: HTTP_METHODS.POST },
50
+ clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
51
+ getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
52
+
53
+
49
54
  };
50
55
 
51
56
  }