glitch-javascript-sdk 2.0.7 → 2.0.9

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
@@ -4451,6 +4451,39 @@ declare class Campaigns {
4451
4451
  * @returns promise containing the fully enriched SourcedCreator object.
4452
4452
  */
4453
4453
  static enrichSourcedCreator<T>(campaign_id: string, sourced_creator_id: string): AxiosPromise<Response<T>>;
4454
+ /**
4455
+ * Find and save Twitch creators for selected games to the database.
4456
+ * @param campaign_id The UUID of the campaign.
4457
+ * @param data The search criteria (source, igdb_ids, etc.).
4458
+ * @returns promise
4459
+ */
4460
+ static sourcingFindAndSaveTwitchCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
4461
+ /**
4462
+ * Find and save YouTube creators for selected games to the database.
4463
+ * @param campaign_id The UUID of the campaign.
4464
+ * @param data The search criteria (igdb_ids, period).
4465
+ * @returns promise
4466
+ */
4467
+ static sourcingFindAndSaveYouTubeCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
4468
+ /**
4469
+ * Export sourced creators for a campaign to a CSV or XLSX file.
4470
+ * This method applies the same filtering and sorting parameters as getSourcedCreators.
4471
+ * The browser will automatically trigger a download for the returned file.
4472
+ *
4473
+ * @see https://api.glitch.fun/api/documentation#/Campaigns%20Sourcing/exportSourcedCreators
4474
+ *
4475
+ * @param campaign_id The UUID of the campaign.
4476
+ * @param params Query parameters for the export, including the required 'format' and any filters.
4477
+ * @param params.format The desired file format ('csv' or 'xlsx').
4478
+ * @param params.search Optional search term.
4479
+ * @param params.status Optional status filter ('pending', 'approved', 'rejected').
4480
+ * @param params.has_email Optional filter for creators with an email address (true/false).
4481
+ * @returns A promise that resolves with the file blob for download.
4482
+ */
4483
+ static exportSourcedCreators<T>(campaign_id: string, params: {
4484
+ format: 'csv' | 'xlsx';
4485
+ [key: string]: any;
4486
+ }): AxiosPromise<Response<T>>;
4454
4487
  }
4455
4488
 
4456
4489
  declare class Subscriptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -147,7 +147,7 @@ class Campaigns {
147
147
  * @returns promise
148
148
  */
149
149
  public static listInfluencerCampaignLinkClicks<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
150
- return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaignLinkClicks, undefined, { campaign_id: campaign_id, user_id : user_id }, params);
150
+ return Requests.processRoute(CampaignsRoute.routes.listInfluencerCampaignLinkClicks, undefined, { campaign_id: campaign_id, user_id: user_id }, params);
151
151
  }
152
152
 
153
153
 
@@ -526,7 +526,7 @@ class Campaigns {
526
526
  *
527
527
  * @returns promise
528
528
  */
529
- public static updateInfluencerInvite<T>(campaign_id: string,influencer_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
529
+ public static updateInfluencerInvite<T>(campaign_id: string, influencer_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
530
530
 
531
531
 
532
532
  return Requests.processRoute(CampaignsRoute.routes.updateInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
@@ -541,7 +541,7 @@ class Campaigns {
541
541
  *
542
542
  * @returns promise
543
543
  */
544
- public static updateInfluencerCompensationInvite<T>(campaign_id: string,influencer_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
544
+ public static updateInfluencerCompensationInvite<T>(campaign_id: string, influencer_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
545
545
 
546
546
 
547
547
  return Requests.processRoute(CampaignsRoute.routes.updateInfluencerCompensationInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
@@ -598,21 +598,21 @@ class Campaigns {
598
598
  *
599
599
  * @returns promise
600
600
  */
601
- public static finishInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
601
+ public static finishInfluencerInvite<T>(campaign_id: string, influencer_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
602
602
 
603
603
  return Requests.processRoute(CampaignsRoute.routes.finishInfluencerInvite, data, { campaign_id: campaign_id, influencer_id: influencer_id }, params);
604
604
  }
605
605
 
606
- /**
607
- * The route to accept an influnecers request to join the campaign.
608
- *
609
- * @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
610
- *
611
- * @param campaign_id The id fo the campaign to retrieve.
612
- *
613
- * @returns promise
614
- */
615
- public static acceptInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
606
+ /**
607
+ * The route to accept an influnecers request to join the campaign.
608
+ *
609
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/acceptInfluencer
610
+ *
611
+ * @param campaign_id The id fo the campaign to retrieve.
612
+ *
613
+ * @returns promise
614
+ */
615
+ public static acceptInfluencerRequest<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
616
616
 
617
617
  return Requests.processRoute(CampaignsRoute.routes.acceptInfluencerRequest, data, { campaign_id: campaign_id, user_id: user_id }, params);
618
618
  }
@@ -709,7 +709,7 @@ class Campaigns {
709
709
  */
710
710
  public static resendAcceptanceEmail<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
711
711
 
712
- return Requests.processRoute(CampaignsRoute.routes.resendAcceptanceEmail, data, { campaign_id: campaign_id, user_id : user_id }, params);
712
+ return Requests.processRoute(CampaignsRoute.routes.resendAcceptanceEmail, data, { campaign_id: campaign_id, user_id: user_id }, params);
713
713
  }
714
714
 
715
715
  /**
@@ -723,7 +723,7 @@ class Campaigns {
723
723
  */
724
724
  public static payInfluencer<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
725
725
 
726
- return Requests.processRoute(CampaignsRoute.routes.payInfluencer, data, { campaign_id: campaign_id, user_id : user_id }, params);
726
+ return Requests.processRoute(CampaignsRoute.routes.payInfluencer, data, { campaign_id: campaign_id, user_id: user_id }, params);
727
727
  }
728
728
 
729
729
  /**
@@ -737,15 +737,15 @@ class Campaigns {
737
737
  return Requests.processRoute(CampaignsRoute.routes.getLedger, undefined, { campaign_id: campaign_id }, params);
738
738
  }
739
739
 
740
- /**
741
- * Generate a contract for the influencer based on the values in the campaign.
742
- *
743
- * @see https://api.glitch.fun/api/documentation#/Campaigns/generateCampaignContract
744
- *
745
- * @param campaign_id The id fo the campaign to retrieve.
746
- *
747
- * @returns promise
748
- */
740
+ /**
741
+ * Generate a contract for the influencer based on the values in the campaign.
742
+ *
743
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/generateCampaignContract
744
+ *
745
+ * @param campaign_id The id fo the campaign to retrieve.
746
+ *
747
+ * @returns promise
748
+ */
749
749
  public static generateCampaignContract<T>(campaign_id: string, user_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
750
750
 
751
751
  return Requests.processRoute(CampaignsRoute.routes.generateCampaignContract, data, { campaign_id: campaign_id, user_id: user_id }, params);
@@ -877,6 +877,45 @@ class Campaigns {
877
877
  return Requests.processRoute(CampaignsRoute.routes.enrichSourcedCreator, {}, { campaign_id, sourced_creator_id });
878
878
  }
879
879
 
880
+ /**
881
+ * Find and save Twitch creators for selected games to the database.
882
+ * @param campaign_id The UUID of the campaign.
883
+ * @param data The search criteria (source, igdb_ids, etc.).
884
+ * @returns promise
885
+ */
886
+ public static sourcingFindAndSaveTwitchCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>> {
887
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveTwitchCreators, data, { campaign_id });
888
+ }
889
+
890
+ /**
891
+ * Find and save YouTube creators for selected games to the database.
892
+ * @param campaign_id The UUID of the campaign.
893
+ * @param data The search criteria (igdb_ids, period).
894
+ * @returns promise
895
+ */
896
+ public static sourcingFindAndSaveYouTubeCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>> {
897
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveYouTubeCreators, data, { campaign_id });
898
+ }
899
+
900
+ /**
901
+ * Export sourced creators for a campaign to a CSV or XLSX file.
902
+ * This method applies the same filtering and sorting parameters as getSourcedCreators.
903
+ * The browser will automatically trigger a download for the returned file.
904
+ *
905
+ * @see https://api.glitch.fun/api/documentation#/Campaigns%20Sourcing/exportSourcedCreators
906
+ *
907
+ * @param campaign_id The UUID of the campaign.
908
+ * @param params Query parameters for the export, including the required 'format' and any filters.
909
+ * @param params.format The desired file format ('csv' or 'xlsx').
910
+ * @param params.search Optional search term.
911
+ * @param params.status Optional status filter ('pending', 'approved', 'rejected').
912
+ * @param params.has_email Optional filter for creators with an email address (true/false).
913
+ * @returns A promise that resolves with the file blob for download.
914
+ */
915
+ public static exportSourcedCreators<T>(campaign_id: string, params: { format: 'csv' | 'xlsx', [key: string]: any }): AxiosPromise<Response<T>> {
916
+ return Requests.processRoute(CampaignsRoute.routes.exportSourcedCreators, undefined, { campaign_id }, params);
917
+ }
918
+
880
919
  }
881
920
 
882
921
  export default Campaigns;
@@ -71,6 +71,9 @@ class CampaignsRoute {
71
71
  updateSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}', method: HTTP_METHODS.PUT },
72
72
  assignKeyToInfluencer: { url: '/campaigns/{campaign_id}/influencers/{user_id}/assign-key', method: HTTP_METHODS.POST },
73
73
  enrichSourcedCreator: { url: '/campaigns/{campaign_id}/sourcing/creators/{sourced_creator_id}/enrich', method: HTTP_METHODS.POST },
74
+ sourcingFindAndSaveTwitchCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-twitch-creators', method: HTTP_METHODS.POST },
75
+ sourcingFindAndSaveYouTubeCreators: { url: '/campaigns/{campaign_id}/sourcing/find-save-youtube-creators', method: HTTP_METHODS.POST },
76
+ exportSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators/export', method: HTTP_METHODS.GET },
74
77
 
75
78
 
76
79
  };