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.
@@ -621,5 +621,58 @@ declare class Campaigns {
621
621
  * @returns promise containing the fully enriched SourcedCreator object.
622
622
  */
623
623
  static enrichSourcedCreator<T>(campaign_id: string, sourced_creator_id: string): AxiosPromise<Response<T>>;
624
+ /**
625
+ * Find and save Twitch creators for selected games to the database.
626
+ * @param campaign_id The UUID of the campaign.
627
+ * @param data The search criteria (source, igdb_ids, etc.).
628
+ * @returns promise
629
+ */
630
+ static sourcingFindAndSaveTwitchCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
631
+ /**
632
+ * Find and save YouTube creators for selected games to the database.
633
+ * @param campaign_id The UUID of the campaign.
634
+ * @param data The search criteria (igdb_ids, period).
635
+ * @returns promise
636
+ */
637
+ static sourcingFindAndSaveYouTubeCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
638
+ /**
639
+ * Export sourced creators for a campaign to a CSV or XLSX file.
640
+ * This method applies the same filtering and sorting parameters as getSourcedCreators.
641
+ * The browser will automatically trigger a download for the returned file.
642
+ *
643
+ * @see https://api.glitch.fun/api/documentation#/Campaigns%20Sourcing/exportSourcedCreators
644
+ *
645
+ * @param campaign_id The UUID of the campaign.
646
+ * @param params Query parameters for the export, including the required 'format' and any filters.
647
+ * @param params.format The desired file format ('csv' or 'xlsx').
648
+ * @param params.search Optional search term.
649
+ * @param params.status Optional status filter ('pending', 'approved', 'rejected').
650
+ * @param params.has_email Optional filter for creators with an email address (true/false).
651
+ * @returns A promise that resolves with the file blob for download.
652
+ */
653
+ static exportSourcedCreators<T>(campaign_id: string, params: {
654
+ format: 'csv' | 'xlsx';
655
+ [key: string]: any;
656
+ }): AxiosPromise<Response<T>>;
657
+ /**
658
+ * Search IGDB for any game by a query string.
659
+ * @param campaign_id The UUID of the campaign (for permission checking).
660
+ * @param params Query parameters including 'search_query' and optional 'limit'.
661
+ * @returns promise
662
+ */
663
+ static sourcingSearchAnyIgdbGame<T>(campaign_id: string, params: {
664
+ search_query: string;
665
+ limit?: number;
666
+ }): AxiosPromise<Response<T>>;
667
+ /**
668
+ * Get full game details from a list of IGDB IDs.
669
+ * @param campaign_id The UUID of the campaign.
670
+ * @param data An object containing the array of IGDB IDs.
671
+ * @param data.igdb_ids An array of IGDB game IDs.
672
+ * @returns promise
673
+ */
674
+ static sourcingGetGamesByIds<T>(campaign_id: string, data: {
675
+ igdb_ids: number[];
676
+ }): AxiosPromise<Response<T>>;
624
677
  }
625
678
  export default Campaigns;
package/dist/esm/index.js CHANGED
@@ -11718,6 +11718,11 @@ var CampaignsRoute = /** @class */ (function () {
11718
11718
  updateSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}', method: HTTP_METHODS.PUT },
11719
11719
  assignKeyToInfluencer: { url: '/campaigns/{campaign_id}/influencers/{user_id}/assign-key', method: HTTP_METHODS.POST },
11720
11720
  enrichSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}/enrich', method: HTTP_METHODS.POST },
11721
+ sourcingFindAndSaveTwitchCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-twitch-creators', method: HTTP_METHODS.POST },
11722
+ sourcingFindAndSaveYouTubeCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-youtube-creators', method: HTTP_METHODS.POST },
11723
+ exportSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators/export', method: HTTP_METHODS.GET },
11724
+ sourcingSearchAnyIgdbGame: { url: '/campaigns/{campaign_id}/sourcing/search-any-game', method: HTTP_METHODS.GET },
11725
+ sourcingGetGamesByIds: { url: '/campaigns/{campaign_id}/sourcing/games-by-ids', method: HTTP_METHODS.POST },
11721
11726
  };
11722
11727
  return CampaignsRoute;
11723
11728
  }());
@@ -12477,6 +12482,61 @@ var Campaigns = /** @class */ (function () {
12477
12482
  Campaigns.enrichSourcedCreator = function (campaign_id, sourced_creator_id) {
12478
12483
  return Requests.processRoute(CampaignsRoute.routes.enrichSourcedCreator, {}, { campaign_id: campaign_id, sourced_creator_id: sourced_creator_id });
12479
12484
  };
12485
+ /**
12486
+ * Find and save Twitch creators for selected games to the database.
12487
+ * @param campaign_id The UUID of the campaign.
12488
+ * @param data The search criteria (source, igdb_ids, etc.).
12489
+ * @returns promise
12490
+ */
12491
+ Campaigns.sourcingFindAndSaveTwitchCreators = function (campaign_id, data) {
12492
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveTwitchCreators, data, { campaign_id: campaign_id });
12493
+ };
12494
+ /**
12495
+ * Find and save YouTube creators for selected games to the database.
12496
+ * @param campaign_id The UUID of the campaign.
12497
+ * @param data The search criteria (igdb_ids, period).
12498
+ * @returns promise
12499
+ */
12500
+ Campaigns.sourcingFindAndSaveYouTubeCreators = function (campaign_id, data) {
12501
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveYouTubeCreators, data, { campaign_id: campaign_id });
12502
+ };
12503
+ /**
12504
+ * Export sourced creators for a campaign to a CSV or XLSX file.
12505
+ * This method applies the same filtering and sorting parameters as getSourcedCreators.
12506
+ * The browser will automatically trigger a download for the returned file.
12507
+ *
12508
+ * @see https://api.glitch.fun/api/documentation#/Campaigns%20Sourcing/exportSourcedCreators
12509
+ *
12510
+ * @param campaign_id The UUID of the campaign.
12511
+ * @param params Query parameters for the export, including the required 'format' and any filters.
12512
+ * @param params.format The desired file format ('csv' or 'xlsx').
12513
+ * @param params.search Optional search term.
12514
+ * @param params.status Optional status filter ('pending', 'approved', 'rejected').
12515
+ * @param params.has_email Optional filter for creators with an email address (true/false).
12516
+ * @returns A promise that resolves with the file blob for download.
12517
+ */
12518
+ Campaigns.exportSourcedCreators = function (campaign_id, params) {
12519
+ return Requests.processRoute(CampaignsRoute.routes.exportSourcedCreators, undefined, { campaign_id: campaign_id }, params);
12520
+ };
12521
+ /**
12522
+ * Search IGDB for any game by a query string.
12523
+ * @param campaign_id The UUID of the campaign (for permission checking).
12524
+ * @param params Query parameters including 'search_query' and optional 'limit'.
12525
+ * @returns promise
12526
+ */
12527
+ Campaigns.sourcingSearchAnyIgdbGame = function (campaign_id, params) {
12528
+ return Requests.processRoute(CampaignsRoute.routes.sourcingSearchAnyIgdbGame, undefined, { campaign_id: campaign_id }, params);
12529
+ };
12530
+ /**
12531
+ * Get full game details from a list of IGDB IDs.
12532
+ * @param campaign_id The UUID of the campaign.
12533
+ * @param data An object containing the array of IGDB IDs.
12534
+ * @param data.igdb_ids An array of IGDB game IDs.
12535
+ * @returns promise
12536
+ */
12537
+ Campaigns.sourcingGetGamesByIds = function (campaign_id, data) {
12538
+ return Requests.processRoute(CampaignsRoute.routes.sourcingGetGamesByIds, data, { campaign_id: campaign_id });
12539
+ };
12480
12540
  return Campaigns;
12481
12541
  }());
12482
12542