glitch-javascript-sdk 2.0.7 → 2.1.0

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
@@ -24902,6 +24902,11 @@ var CampaignsRoute = /** @class */ (function () {
24902
24902
  updateSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}', method: HTTP_METHODS.PUT },
24903
24903
  assignKeyToInfluencer: { url: '/campaigns/{campaign_id}/influencers/{user_id}/assign-key', method: HTTP_METHODS.POST },
24904
24904
  enrichSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}/enrich', method: HTTP_METHODS.POST },
24905
+ sourcingFindAndSaveTwitchCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-twitch-creators', method: HTTP_METHODS.POST },
24906
+ sourcingFindAndSaveYouTubeCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-youtube-creators', method: HTTP_METHODS.POST },
24907
+ exportSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators/export', method: HTTP_METHODS.GET },
24908
+ sourcingSearchAnyIgdbGame: { url: '/campaigns/{campaign_id}/sourcing/search-any-game', method: HTTP_METHODS.GET },
24909
+ sourcingGetGamesByIds: { url: '/campaigns/{campaign_id}/sourcing/games-by-ids', method: HTTP_METHODS.POST },
24905
24910
  };
24906
24911
  return CampaignsRoute;
24907
24912
  }());
@@ -25661,6 +25666,61 @@ var Campaigns = /** @class */ (function () {
25661
25666
  Campaigns.enrichSourcedCreator = function (campaign_id, sourced_creator_id) {
25662
25667
  return Requests.processRoute(CampaignsRoute.routes.enrichSourcedCreator, {}, { campaign_id: campaign_id, sourced_creator_id: sourced_creator_id });
25663
25668
  };
25669
+ /**
25670
+ * Find and save Twitch creators for selected games to the database.
25671
+ * @param campaign_id The UUID of the campaign.
25672
+ * @param data The search criteria (source, igdb_ids, etc.).
25673
+ * @returns promise
25674
+ */
25675
+ Campaigns.sourcingFindAndSaveTwitchCreators = function (campaign_id, data) {
25676
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveTwitchCreators, data, { campaign_id: campaign_id });
25677
+ };
25678
+ /**
25679
+ * Find and save YouTube creators for selected games to the database.
25680
+ * @param campaign_id The UUID of the campaign.
25681
+ * @param data The search criteria (igdb_ids, period).
25682
+ * @returns promise
25683
+ */
25684
+ Campaigns.sourcingFindAndSaveYouTubeCreators = function (campaign_id, data) {
25685
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveYouTubeCreators, data, { campaign_id: campaign_id });
25686
+ };
25687
+ /**
25688
+ * Export sourced creators for a campaign to a CSV or XLSX file.
25689
+ * This method applies the same filtering and sorting parameters as getSourcedCreators.
25690
+ * The browser will automatically trigger a download for the returned file.
25691
+ *
25692
+ * @see https://api.glitch.fun/api/documentation#/Campaigns%20Sourcing/exportSourcedCreators
25693
+ *
25694
+ * @param campaign_id The UUID of the campaign.
25695
+ * @param params Query parameters for the export, including the required 'format' and any filters.
25696
+ * @param params.format The desired file format ('csv' or 'xlsx').
25697
+ * @param params.search Optional search term.
25698
+ * @param params.status Optional status filter ('pending', 'approved', 'rejected').
25699
+ * @param params.has_email Optional filter for creators with an email address (true/false).
25700
+ * @returns A promise that resolves with the file blob for download.
25701
+ */
25702
+ Campaigns.exportSourcedCreators = function (campaign_id, params) {
25703
+ return Requests.processRoute(CampaignsRoute.routes.exportSourcedCreators, undefined, { campaign_id: campaign_id }, params);
25704
+ };
25705
+ /**
25706
+ * Search IGDB for any game by a query string.
25707
+ * @param campaign_id The UUID of the campaign (for permission checking).
25708
+ * @param params Query parameters including 'search_query' and optional 'limit'.
25709
+ * @returns promise
25710
+ */
25711
+ Campaigns.sourcingSearchAnyIgdbGame = function (campaign_id, params) {
25712
+ return Requests.processRoute(CampaignsRoute.routes.sourcingSearchAnyIgdbGame, undefined, { campaign_id: campaign_id }, params);
25713
+ };
25714
+ /**
25715
+ * Get full game details from a list of IGDB IDs.
25716
+ * @param campaign_id The UUID of the campaign.
25717
+ * @param data An object containing the array of IGDB IDs.
25718
+ * @param data.igdb_ids An array of IGDB game IDs.
25719
+ * @returns promise
25720
+ */
25721
+ Campaigns.sourcingGetGamesByIds = function (campaign_id, data) {
25722
+ return Requests.processRoute(CampaignsRoute.routes.sourcingGetGamesByIds, data, { campaign_id: campaign_id });
25723
+ };
25664
25724
  return Campaigns;
25665
25725
  }());
25666
25726