glitch-javascript-sdk 2.0.0 → 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 CHANGED
@@ -26443,6 +26443,13 @@ var SchedulerRoute = /** @class */ (function () {
26443
26443
  url: '/schedulers/{scheduler_id}/generateContent',
26444
26444
  method: HTTP_METHODS.POST
26445
26445
  },
26446
+ getRedditRecommendations: { url: '/schedulers/{scheduler_id}/reddit/recommendations', method: HTTP_METHODS.POST },
26447
+ generateRedditContent: { url: '/schedulers/{scheduler_id}/reddit/generateContent', method: HTTP_METHODS.POST },
26448
+ listDestinations: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.GET },
26449
+ createDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations', method: HTTP_METHODS.POST },
26450
+ getDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.GET },
26451
+ updateDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.PUT },
26452
+ deleteDestination: { url: '/schedulers/{scheduler_id}/updates/{update_id}/destinations/{destination_id}', method: HTTP_METHODS.DELETE },
26446
26453
  };
26447
26454
  return SchedulerRoute;
26448
26455
  }());
@@ -26987,6 +26994,95 @@ var Scheduler = /** @class */ (function () {
26987
26994
  Scheduler.listCampaignFundingInstruments = function (scheduler_id, params) {
26988
26995
  return Requests.processRoute(SchedulerRoute.routes.getCampaignFundingInstruments, undefined, { scheduler_id: scheduler_id }, params);
26989
26996
  };
26997
+ /**
26998
+ * List all destinations for a title update.
26999
+ *
27000
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/listTitleUpdateDestinations
27001
+ *
27002
+ * @param scheduler_id The ID of the promotion schedule.
27003
+ * @param update_id The ID of the title update.
27004
+ * @returns promise
27005
+ */
27006
+ Scheduler.listDestinations = function (scheduler_id, update_id, params) {
27007
+ return Requests.processRoute(SchedulerRoute.routes.listDestinations, {}, { scheduler_id: scheduler_id, update_id: update_id }, params);
27008
+ };
27009
+ /**
27010
+ * Create a new destination for a title update.
27011
+ *
27012
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/createTitleUpdateDestination
27013
+ *
27014
+ * @param scheduler_id The ID of the promotion schedule.
27015
+ * @param update_id The ID of the title update.
27016
+ * @param data The data for the new destination.
27017
+ * @returns promise
27018
+ */
27019
+ Scheduler.createDestination = function (scheduler_id, update_id, data, params) {
27020
+ return Requests.processRoute(SchedulerRoute.routes.createDestination, data, { scheduler_id: scheduler_id, update_id: update_id }, params);
27021
+ };
27022
+ /**
27023
+ * Get a specific title update destination.
27024
+ *
27025
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getTitleUpdateDestination
27026
+ *
27027
+ * @param scheduler_id The ID of the promotion schedule.
27028
+ * @param update_id The ID of the title update.
27029
+ * @param destination_id The ID of the destination.
27030
+ * @returns promise
27031
+ */
27032
+ Scheduler.getDestination = function (scheduler_id, update_id, destination_id, params) {
27033
+ return Requests.processRoute(SchedulerRoute.routes.getDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
27034
+ };
27035
+ /**
27036
+ * Update a title update destination.
27037
+ *
27038
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/updateTitleUpdateDestination
27039
+ *
27040
+ * @param scheduler_id The ID of the promotion schedule.
27041
+ * @param update_id The ID of the title update.
27042
+ * @param destination_id The ID of the destination.
27043
+ * @param data The data to update.
27044
+ * @returns promise
27045
+ */
27046
+ Scheduler.updateDestination = function (scheduler_id, update_id, destination_id, data, params) {
27047
+ return Requests.processRoute(SchedulerRoute.routes.updateDestination, data, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
27048
+ };
27049
+ /**
27050
+ * Delete a title update destination.
27051
+ *
27052
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/deleteTitleUpdateDestination
27053
+ *
27054
+ * @param scheduler_id The ID of the promotion schedule.
27055
+ * @param update_id The ID of the title update.
27056
+ * @param destination_id The ID of the destination.
27057
+ * @returns promise
27058
+ */
27059
+ Scheduler.deleteDestination = function (scheduler_id, update_id, destination_id, params) {
27060
+ return Requests.processRoute(SchedulerRoute.routes.deleteDestination, {}, { scheduler_id: scheduler_id, update_id: update_id, destination_id: destination_id }, params);
27061
+ };
27062
+ /**
27063
+ * Get AI-powered subreddit recommendations for a scheduler.
27064
+ *
27065
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/getSchedulerRedditRecommendations
27066
+ *
27067
+ * @param scheduler_id The ID of the promotion schedule.
27068
+ * @param data The context for the post (title, content, media type).
27069
+ * @returns promise
27070
+ */
27071
+ Scheduler.getRedditRecommendations = function (scheduler_id, data, params) {
27072
+ return Requests.processRoute(SchedulerRoute.routes.getRedditRecommendations, data, { scheduler_id: scheduler_id }, params);
27073
+ };
27074
+ /**
27075
+ * Generate tailored content for a specific subreddit.
27076
+ *
27077
+ * @see https://api.glitch.fun/api/documentation#/Scheduler/generateRedditContentForSubreddit
27078
+ *
27079
+ * @param scheduler_id The ID of the promotion schedule.
27080
+ * @param data The target subreddit and post context.
27081
+ * @returns promise
27082
+ */
27083
+ Scheduler.generateRedditContent = function (scheduler_id, data, params) {
27084
+ return Requests.processRoute(SchedulerRoute.routes.generateRedditContent, data, { scheduler_id: scheduler_id }, params);
27085
+ };
26990
27086
  return Scheduler;
26991
27087
  }());
26992
27088
 
@@ -27588,6 +27684,226 @@ var AIUsage = /** @class */ (function () {
27588
27684
  return AIUsage;
27589
27685
  }());
27590
27686
 
27687
+ var MarketingAgenciesRoute = /** @class */ (function () {
27688
+ function MarketingAgenciesRoute() {
27689
+ }
27690
+ MarketingAgenciesRoute.routes = {
27691
+ // CRUD for agencies
27692
+ list: { url: '/marketing-agencies', method: HTTP_METHODS.GET },
27693
+ create: { url: '/marketing-agencies', method: HTTP_METHODS.POST },
27694
+ view: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.GET },
27695
+ update: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.PUT },
27696
+ delete: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.DELETE },
27697
+ // Administrator management
27698
+ addAdministrator: { url: '/marketing-agencies/{id}/administrators', method: HTTP_METHODS.POST },
27699
+ removeAdministrator: { url: '/marketing-agencies/{id}/administrators/{user_id}', method: HTTP_METHODS.DELETE },
27700
+ // Logo management
27701
+ setLogo: { url: '/marketing-agencies/{id}/logo', method: HTTP_METHODS.POST },
27702
+ // Case Study management
27703
+ addCaseStudy: { url: '/marketing-agencies/{id}/case-studies', method: HTTP_METHODS.POST },
27704
+ removeCaseStudy: { url: '/marketing-agencies/{id}/case-studies/{media_id}', method: HTTP_METHODS.DELETE },
27705
+ updateCaseStudyOrder: { url: '/marketing-agencies/{id}/case-studies/order', method: HTTP_METHODS.POST },
27706
+ // Invitation management
27707
+ invite: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.POST },
27708
+ listInvites: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.GET },
27709
+ revokeInvite: { url: '/marketing-agencies/{id}/invites/{invite_id}', method: HTTP_METHODS.DELETE },
27710
+ getInviteDetails: { url: '/marketing-agencies/invites/details', method: HTTP_METHODS.GET },
27711
+ acceptInvite: { url: '/marketing-agencies/invites/accept', method: HTTP_METHODS.POST },
27712
+ };
27713
+ return MarketingAgenciesRoute;
27714
+ }());
27715
+
27716
+ var MarketingAgencies = /** @class */ (function () {
27717
+ function MarketingAgencies() {
27718
+ }
27719
+ /**
27720
+ * List all marketing agencies.
27721
+ *
27722
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
27723
+ *
27724
+ * @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
27725
+ * @returns promise
27726
+ */
27727
+ MarketingAgencies.list = function (params) {
27728
+ return Requests.processRoute(MarketingAgenciesRoute.routes.list, undefined, undefined, params);
27729
+ };
27730
+ /**
27731
+ * Create a new marketing agency.
27732
+ *
27733
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
27734
+ *
27735
+ * @param data The data for the new agency.
27736
+ * @returns Promise
27737
+ */
27738
+ MarketingAgencies.create = function (data) {
27739
+ return Requests.processRoute(MarketingAgenciesRoute.routes.create, data);
27740
+ };
27741
+ /**
27742
+ * Retrieve a single marketing agency by its ID.
27743
+ *
27744
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
27745
+ *
27746
+ * @param id The UUID of the agency to retrieve.
27747
+ * @returns promise
27748
+ */
27749
+ MarketingAgencies.view = function (id) {
27750
+ return Requests.processRoute(MarketingAgenciesRoute.routes.view, {}, { id: id });
27751
+ };
27752
+ /**
27753
+ * Update a marketing agency.
27754
+ *
27755
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
27756
+ *
27757
+ * @param id The UUID of the agency to update.
27758
+ * @param data The data to update.
27759
+ * @returns promise
27760
+ */
27761
+ MarketingAgencies.update = function (id, data) {
27762
+ return Requests.processRoute(MarketingAgenciesRoute.routes.update, data, { id: id });
27763
+ };
27764
+ /**
27765
+ * Deletes a marketing agency.
27766
+ *
27767
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
27768
+ *
27769
+ * @param id The UUID of the agency to delete.
27770
+ * @returns promise
27771
+ */
27772
+ MarketingAgencies.delete = function (id) {
27773
+ return Requests.processRoute(MarketingAgenciesRoute.routes.delete, {}, { id: id });
27774
+ };
27775
+ /**
27776
+ * Add a user as an administrator to an agency.
27777
+ *
27778
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
27779
+ *
27780
+ * @param id The UUID of the agency.
27781
+ * @param data The data containing the user_id to add.
27782
+ * @returns Promise
27783
+ */
27784
+ MarketingAgencies.addAdministrator = function (id, data) {
27785
+ return Requests.processRoute(MarketingAgenciesRoute.routes.addAdministrator, data, { id: id });
27786
+ };
27787
+ /**
27788
+ * Remove a user as an administrator from an agency.
27789
+ *
27790
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
27791
+ *
27792
+ * @param id The UUID of the agency.
27793
+ * @param user_id The UUID of the user to remove.
27794
+ * @returns Promise
27795
+ */
27796
+ MarketingAgencies.removeAdministrator = function (id, user_id) {
27797
+ return Requests.processRoute(MarketingAgenciesRoute.routes.removeAdministrator, {}, { id: id, user_id: user_id });
27798
+ };
27799
+ /**
27800
+ * Set the logo for an agency.
27801
+ *
27802
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
27803
+ *
27804
+ * @param id The UUID of the agency.
27805
+ * @param data The data containing the media_id for the logo.
27806
+ * @returns Promise
27807
+ */
27808
+ MarketingAgencies.setLogo = function (id, data) {
27809
+ return Requests.processRoute(MarketingAgenciesRoute.routes.setLogo, data, { id: id });
27810
+ };
27811
+ /**
27812
+ * Add a case study to an agency.
27813
+ *
27814
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
27815
+ *
27816
+ * @param id The UUID of the agency.
27817
+ * @param data The data containing the media_id and optional order.
27818
+ * @returns Promise
27819
+ */
27820
+ MarketingAgencies.addCaseStudy = function (id, data) {
27821
+ return Requests.processRoute(MarketingAgenciesRoute.routes.addCaseStudy, data, { id: id });
27822
+ };
27823
+ /**
27824
+ * Remove a case study from an agency.
27825
+ *
27826
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
27827
+ *
27828
+ * @param id The UUID of the agency.
27829
+ * @param media_id The UUID of the media to remove.
27830
+ * @returns Promise
27831
+ */
27832
+ MarketingAgencies.removeCaseStudy = function (id, media_id) {
27833
+ return Requests.processRoute(MarketingAgenciesRoute.routes.removeCaseStudy, {}, { id: id, media_id: media_id });
27834
+ };
27835
+ /**
27836
+ * Update the order of case studies for an agency.
27837
+ *
27838
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
27839
+ *
27840
+ * @param id The UUID of the agency.
27841
+ * @param order_data An array of objects with media_id and new order.
27842
+ * @returns Promise
27843
+ */
27844
+ MarketingAgencies.updateCaseStudyOrder = function (id, order_data) {
27845
+ return Requests.processRoute(MarketingAgenciesRoute.routes.updateCaseStudyOrder, { order_data: order_data }, { id: id });
27846
+ };
27847
+ /**
27848
+ * Invite a user to become an administrator of an agency.
27849
+ *
27850
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
27851
+ *
27852
+ * @param id The UUID of the agency.
27853
+ * @param data The data containing the email of the user to invite.
27854
+ * @returns Promise
27855
+ */
27856
+ MarketingAgencies.invite = function (id, data) {
27857
+ return Requests.processRoute(MarketingAgenciesRoute.routes.invite, data, { id: id });
27858
+ };
27859
+ /**
27860
+ * List all pending invitations for an agency.
27861
+ *
27862
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
27863
+ *
27864
+ * @param id The UUID of the agency.
27865
+ * @returns Promise
27866
+ */
27867
+ MarketingAgencies.listInvites = function (id) {
27868
+ return Requests.processRoute(MarketingAgenciesRoute.routes.listInvites, {}, { id: id });
27869
+ };
27870
+ /**
27871
+ * Revoke a pending invitation.
27872
+ *
27873
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
27874
+ *
27875
+ * @param id The UUID of the agency.
27876
+ * @param invite_id The UUID of the invitation to revoke.
27877
+ * @returns Promise
27878
+ */
27879
+ MarketingAgencies.revokeInvite = function (id, invite_id) {
27880
+ return Requests.processRoute(MarketingAgenciesRoute.routes.revokeInvite, {}, { id: id, invite_id: invite_id });
27881
+ };
27882
+ /**
27883
+ * Get the details of a pending invitation using its token.
27884
+ *
27885
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
27886
+ *
27887
+ * @param params An object containing the token.
27888
+ * @returns Promise
27889
+ */
27890
+ MarketingAgencies.getInviteDetails = function (params) {
27891
+ return Requests.processRoute(MarketingAgenciesRoute.routes.getInviteDetails, undefined, undefined, params);
27892
+ };
27893
+ /**
27894
+ * Accept an invitation to become an administrator.
27895
+ *
27896
+ * @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
27897
+ *
27898
+ * @param data The data containing the invitation token.
27899
+ * @returns Promise
27900
+ */
27901
+ MarketingAgencies.acceptInvite = function (data) {
27902
+ return Requests.processRoute(MarketingAgenciesRoute.routes.acceptInvite, data);
27903
+ };
27904
+ return MarketingAgencies;
27905
+ }());
27906
+
27591
27907
  var Parser = /** @class */ (function () {
27592
27908
  function Parser() {
27593
27909
  }
@@ -28112,7 +28428,8 @@ var Glitch = /** @class */ (function () {
28112
28428
  WebsiteAnalytics: WebsiteAnalytics,
28113
28429
  Fingerprinting: Fingerprinting,
28114
28430
  ShortLinks: ShortLinks,
28115
- AIUsage: AIUsage
28431
+ AIUsage: AIUsage,
28432
+ MarketingAgencies: MarketingAgencies
28116
28433
  };
28117
28434
  Glitch.util = {
28118
28435
  Requests: Requests,