glitch-javascript-sdk 2.0.1 → 2.0.2
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 +96 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Scheduler.d.ts +75 -0
- package/dist/esm/index.js +96 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +75 -0
- package/package.json +1 -1
- package/src/api/Scheduler.ts +96 -0
- package/src/routes/SchedulerRoute.ts +7 -0
package/dist/index.d.ts
CHANGED
|
@@ -5325,6 +5325,81 @@ declare class Scheduler {
|
|
|
5325
5325
|
* @returns A response object with data (funding instruments)
|
|
5326
5326
|
*/
|
|
5327
5327
|
static listCampaignFundingInstruments<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5328
|
+
/**
|
|
5329
|
+
* List all destinations for a title update.
|
|
5330
|
+
*
|
|
5331
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
|
|
5332
|
+
*
|
|
5333
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5334
|
+
* @param update_id The ID of the title update.
|
|
5335
|
+
* @returns promise
|
|
5336
|
+
*/
|
|
5337
|
+
static listDestinations<T>(scheduler_id: string, update_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5338
|
+
/**
|
|
5339
|
+
* Create a new destination for a title update.
|
|
5340
|
+
*
|
|
5341
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
|
|
5342
|
+
*
|
|
5343
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5344
|
+
* @param update_id The ID of the title update.
|
|
5345
|
+
* @param data The data for the new destination.
|
|
5346
|
+
* @returns promise
|
|
5347
|
+
*/
|
|
5348
|
+
static createDestination<T>(scheduler_id: string, update_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5349
|
+
/**
|
|
5350
|
+
* Get a specific title update destination.
|
|
5351
|
+
*
|
|
5352
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
|
|
5353
|
+
*
|
|
5354
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5355
|
+
* @param update_id The ID of the title update.
|
|
5356
|
+
* @param destination_id The ID of the destination.
|
|
5357
|
+
* @returns promise
|
|
5358
|
+
*/
|
|
5359
|
+
static getDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5360
|
+
/**
|
|
5361
|
+
* Update a title update destination.
|
|
5362
|
+
*
|
|
5363
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
|
|
5364
|
+
*
|
|
5365
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5366
|
+
* @param update_id The ID of the title update.
|
|
5367
|
+
* @param destination_id The ID of the destination.
|
|
5368
|
+
* @param data The data to update.
|
|
5369
|
+
* @returns promise
|
|
5370
|
+
*/
|
|
5371
|
+
static updateDestination<T>(scheduler_id: string, update_id: string, destination_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5372
|
+
/**
|
|
5373
|
+
* Delete a title update destination.
|
|
5374
|
+
*
|
|
5375
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
|
|
5376
|
+
*
|
|
5377
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5378
|
+
* @param update_id The ID of the title update.
|
|
5379
|
+
* @param destination_id The ID of the destination.
|
|
5380
|
+
* @returns promise
|
|
5381
|
+
*/
|
|
5382
|
+
static deleteDestination<T>(scheduler_id: string, update_id: string, destination_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5383
|
+
/**
|
|
5384
|
+
* Get AI-powered subreddit recommendations for a scheduler.
|
|
5385
|
+
*
|
|
5386
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
|
|
5387
|
+
*
|
|
5388
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5389
|
+
* @param data The context for the post (title, content, media type).
|
|
5390
|
+
* @returns promise
|
|
5391
|
+
*/
|
|
5392
|
+
static getRedditRecommendations<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5393
|
+
/**
|
|
5394
|
+
* Generate tailored content for a specific subreddit.
|
|
5395
|
+
*
|
|
5396
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
|
|
5397
|
+
*
|
|
5398
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5399
|
+
* @param data The target subreddit and post context.
|
|
5400
|
+
* @returns promise
|
|
5401
|
+
*/
|
|
5402
|
+
static generateRedditContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5328
5403
|
}
|
|
5329
5404
|
|
|
5330
5405
|
declare class Funnel {
|
package/package.json
CHANGED
package/src/api/Scheduler.ts
CHANGED
|
@@ -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;
|
|
@@ -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
|
}
|