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 +60 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Campaigns.d.ts +53 -0
- package/dist/esm/index.js +60 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +53 -0
- package/package.json +1 -1
- package/src/api/Campaigns.ts +86 -25
- package/src/routes/CampaignsRoute.ts +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -4451,6 +4451,59 @@ 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>>;
|
|
4487
|
+
/**
|
|
4488
|
+
* Search IGDB for any game by a query string.
|
|
4489
|
+
* @param campaign_id The UUID of the campaign (for permission checking).
|
|
4490
|
+
* @param params Query parameters including 'search_query' and optional 'limit'.
|
|
4491
|
+
* @returns promise
|
|
4492
|
+
*/
|
|
4493
|
+
static sourcingSearchAnyIgdbGame<T>(campaign_id: string, params: {
|
|
4494
|
+
search_query: string;
|
|
4495
|
+
limit?: number;
|
|
4496
|
+
}): AxiosPromise<Response<T>>;
|
|
4497
|
+
/**
|
|
4498
|
+
* Get full game details from a list of IGDB IDs.
|
|
4499
|
+
* @param campaign_id The UUID of the campaign.
|
|
4500
|
+
* @param data An object containing the array of IGDB IDs.
|
|
4501
|
+
* @param data.igdb_ids An array of IGDB game IDs.
|
|
4502
|
+
* @returns promise
|
|
4503
|
+
*/
|
|
4504
|
+
static sourcingGetGamesByIds<T>(campaign_id: string, data: {
|
|
4505
|
+
igdb_ids: number[];
|
|
4506
|
+
}): AxiosPromise<Response<T>>;
|
|
4454
4507
|
}
|
|
4455
4508
|
|
|
4456
4509
|
declare class Subscriptions {
|
package/package.json
CHANGED
package/src/api/Campaigns.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
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,67 @@ 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
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Search IGDB for any game by a query string.
|
|
921
|
+
* @param campaign_id The UUID of the campaign (for permission checking).
|
|
922
|
+
* @param params Query parameters including 'search_query' and optional 'limit'.
|
|
923
|
+
* @returns promise
|
|
924
|
+
*/
|
|
925
|
+
public static sourcingSearchAnyIgdbGame<T>(campaign_id: string, params: { search_query: string, limit?: number }): AxiosPromise<Response<T>> {
|
|
926
|
+
return Requests.processRoute(CampaignsRoute.routes.sourcingSearchAnyIgdbGame, undefined, { campaign_id }, params);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Get full game details from a list of IGDB IDs.
|
|
931
|
+
* @param campaign_id The UUID of the campaign.
|
|
932
|
+
* @param data An object containing the array of IGDB IDs.
|
|
933
|
+
* @param data.igdb_ids An array of IGDB game IDs.
|
|
934
|
+
* @returns promise
|
|
935
|
+
*/
|
|
936
|
+
public static sourcingGetGamesByIds<T>(campaign_id: string, data: { igdb_ids: number[] }): AxiosPromise<Response<T>> {
|
|
937
|
+
return Requests.processRoute(CampaignsRoute.routes.sourcingGetGamesByIds, data, { campaign_id });
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
|
|
880
941
|
}
|
|
881
942
|
|
|
882
943
|
export default Campaigns;
|
|
@@ -71,7 +71,11 @@ 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
|
-
|
|
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 },
|
|
77
|
+
sourcingSearchAnyIgdbGame: { url: '/campaigns/{campaign_id}/sourcing/search-any-game', method: HTTP_METHODS.GET },
|
|
78
|
+
sourcingGetGamesByIds: { url: '/campaigns/{campaign_id}/sourcing/games-by-ids', method: HTTP_METHODS.POST },
|
|
75
79
|
|
|
76
80
|
};
|
|
77
81
|
|