glitch-javascript-sdk 1.8.8 → 1.9.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 +189 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +51 -0
- package/dist/esm/index.js +189 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +51 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +138 -0
- package/src/routes/AdsRoute.ts +93 -0
package/dist/index.d.ts
CHANGED
|
@@ -931,6 +931,57 @@ declare class Ads {
|
|
|
931
931
|
static tiktokUploadVideo<T>(data: FormData, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
932
932
|
static tiktokUploadMusic<T>(data: FormData, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
933
933
|
static tiktokGetMediaInfo<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
934
|
+
/**
|
|
935
|
+
* Sync an Ad with the remote platform.
|
|
936
|
+
*
|
|
937
|
+
* @param ad_id UUID of the ad to sync
|
|
938
|
+
* @param params Optional query parameters
|
|
939
|
+
* @returns The synced Ad resource
|
|
940
|
+
*/
|
|
941
|
+
static syncAd<T>(ad_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
942
|
+
/**
|
|
943
|
+
* POST /ads/facebook/targeting/search
|
|
944
|
+
*/
|
|
945
|
+
static facebookTargetingSearch<T>(data: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
946
|
+
/**
|
|
947
|
+
* GET /ads/facebook/targeting/geo_search
|
|
948
|
+
*/
|
|
949
|
+
static facebookGeoSearch<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
950
|
+
/**
|
|
951
|
+
* GET /ads/facebook/targeting/option_status
|
|
952
|
+
*/
|
|
953
|
+
static facebookTargetingOptionStatus<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
954
|
+
/**
|
|
955
|
+
* POST /ads/facebook/targeting/suggestions
|
|
956
|
+
*/
|
|
957
|
+
static facebookTargetingSuggestions<T>(data: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
958
|
+
/**
|
|
959
|
+
* GET /ads/facebook/targeting/browse
|
|
960
|
+
*/
|
|
961
|
+
static facebookTargetingBrowse<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
962
|
+
/**
|
|
963
|
+
* POST /ads/facebook/targeting/validation
|
|
964
|
+
*/
|
|
965
|
+
static facebookTargetingValidation<T>(data: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
966
|
+
/**
|
|
967
|
+
* GET /ads/facebook/targeting/delivery_estimate
|
|
968
|
+
*/
|
|
969
|
+
static facebookDeliveryEstimate<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
970
|
+
static tiktokTargetingSearch<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
971
|
+
static tiktokContextualTags<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
972
|
+
static tiktokRecommendHashtags<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
973
|
+
static tiktokListCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
974
|
+
static tiktokListInterestCategories<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
975
|
+
static tiktokListActionCategories<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
976
|
+
static tiktokListContentExclusions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
977
|
+
static tiktokListRegions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
978
|
+
static listTwitterTargetingCriteria<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
979
|
+
static getTwitterTargetingCriterion<T>(criterion_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
980
|
+
static createTwitterTargetingCriterion<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
981
|
+
static deleteTwitterTargetingCriterion<T>(criterion_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
982
|
+
static twitterBatchTargetingCriteria<T>(data: object[], params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
983
|
+
static lookupTwitterTargeting<T>(resource: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
984
|
+
static twitterTargetingSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
934
985
|
}
|
|
935
986
|
|
|
936
987
|
declare class Communities {
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -787,6 +787,144 @@ class Ads {
|
|
|
787
787
|
);
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Sync an Ad with the remote platform.
|
|
792
|
+
*
|
|
793
|
+
* @param ad_id UUID of the ad to sync
|
|
794
|
+
* @param params Optional query parameters
|
|
795
|
+
* @returns The synced Ad resource
|
|
796
|
+
*/
|
|
797
|
+
public static syncAd<T>(
|
|
798
|
+
ad_id: string,
|
|
799
|
+
params?: Record<string, any>
|
|
800
|
+
): AxiosPromise<Response<T>> {
|
|
801
|
+
return Requests.processRoute(
|
|
802
|
+
AdsRoute.routes.syncAd,
|
|
803
|
+
undefined,
|
|
804
|
+
{ ad_id },
|
|
805
|
+
params
|
|
806
|
+
);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* POST /ads/facebook/targeting/search
|
|
811
|
+
*/
|
|
812
|
+
public static facebookTargetingSearch<T>(
|
|
813
|
+
data: Record<string, any>,
|
|
814
|
+
params?: Record<string, any>
|
|
815
|
+
): AxiosPromise<Response<T>> {
|
|
816
|
+
return Requests.processRoute(AdsRoute.routes.facebookTargetingSearch, data, undefined, params);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* GET /ads/facebook/targeting/geo_search
|
|
821
|
+
*/
|
|
822
|
+
public static facebookGeoSearch<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
823
|
+
return Requests.processRoute(AdsRoute.routes.facebookGeoSearch, undefined, undefined, params);
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* GET /ads/facebook/targeting/option_status
|
|
828
|
+
*/
|
|
829
|
+
public static facebookTargetingOptionStatus<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
830
|
+
return Requests.processRoute(AdsRoute.routes.facebookTargetingOptionStatus, undefined, undefined, params);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* POST /ads/facebook/targeting/suggestions
|
|
835
|
+
*/
|
|
836
|
+
public static facebookTargetingSuggestions<T>(
|
|
837
|
+
data: Record<string, any>,
|
|
838
|
+
params?: Record<string, any>
|
|
839
|
+
): AxiosPromise<Response<T>> {
|
|
840
|
+
return Requests.processRoute(AdsRoute.routes.facebookTargetingSuggestions, data, undefined, params);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* GET /ads/facebook/targeting/browse
|
|
845
|
+
*/
|
|
846
|
+
public static facebookTargetingBrowse<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
847
|
+
return Requests.processRoute(AdsRoute.routes.facebookTargetingBrowse, undefined, undefined, params);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* POST /ads/facebook/targeting/validation
|
|
852
|
+
*/
|
|
853
|
+
public static facebookTargetingValidation<T>(
|
|
854
|
+
data: Record<string, any>,
|
|
855
|
+
params?: Record<string, any>
|
|
856
|
+
): AxiosPromise<Response<T>> {
|
|
857
|
+
return Requests.processRoute(AdsRoute.routes.facebookTargetingValidation, data, undefined, params);
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* GET /ads/facebook/targeting/delivery_estimate
|
|
862
|
+
*/
|
|
863
|
+
public static facebookDeliveryEstimate<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
864
|
+
return Requests.processRoute(AdsRoute.routes.facebookDeliveryEstimate, undefined, undefined, params);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
public static tiktokTargetingSearch<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
868
|
+
return Requests.processRoute(AdsRoute.routes.tiktokTargetingSearch, data, {}, params);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
public static tiktokContextualTags<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
872
|
+
return Requests.processRoute(AdsRoute.routes.tiktokContextualTags, undefined, undefined, params);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
public static tiktokRecommendHashtags<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
876
|
+
return Requests.processRoute(AdsRoute.routes.tiktokRecommendHashtags, undefined, undefined, params);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
public static tiktokListCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
880
|
+
return Requests.processRoute(AdsRoute.routes.tiktokCarriers, undefined, undefined, params);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
public static tiktokListInterestCategories<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
884
|
+
return Requests.processRoute(AdsRoute.routes.tiktokInterestCategories, undefined, undefined, params);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
public static tiktokListActionCategories<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
888
|
+
return Requests.processRoute(AdsRoute.routes.tiktokActionCategories, undefined, undefined, params);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
public static tiktokListContentExclusions<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
892
|
+
return Requests.processRoute(AdsRoute.routes.tiktokContentExclusions, undefined, undefined, params);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
public static tiktokListRegions<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
896
|
+
return Requests.processRoute(AdsRoute.routes.tiktokRegions, undefined, undefined, params);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
public static listTwitterTargetingCriteria<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
900
|
+
return Requests.processRoute(AdsRoute.routes.twitterListTargetingCriteria, undefined, undefined, params);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
public static getTwitterTargetingCriterion<T>(criterion_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
904
|
+
return Requests.processRoute(AdsRoute.routes.twitterGetTargetingCriterion, undefined, { criterion_id }, params);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
public static createTwitterTargetingCriterion<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
908
|
+
return Requests.processRoute(AdsRoute.routes.twitterCreateTargetingCriterion, data, {}, params);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
public static deleteTwitterTargetingCriterion<T>(criterion_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
912
|
+
return Requests.processRoute(AdsRoute.routes.twitterDeleteTargetingCriterion, undefined, { criterion_id }, params);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
public static twitterBatchTargetingCriteria<T>(data: object[], params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
916
|
+
return Requests.processRoute(AdsRoute.routes.twitterBatchTargetingCriteria, data, {}, params);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
public static lookupTwitterTargeting<T>(resource: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
920
|
+
return Requests.processRoute(AdsRoute.routes.twitterTargetingDiscovery, undefined, { resource }, params);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
public static twitterTargetingSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
924
|
+
return Requests.processRoute(AdsRoute.routes.twitterTargetingSuggestions, undefined, undefined, params);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
|
|
790
928
|
|
|
791
929
|
}
|
|
792
930
|
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -249,6 +249,99 @@ class AdsRoute {
|
|
|
249
249
|
url: "/ads/posts/tiktok/media/info",
|
|
250
250
|
method: HTTP_METHODS.GET,
|
|
251
251
|
},
|
|
252
|
+
syncAd: {
|
|
253
|
+
url: "/ads/creatives/{ad_id}/sync",
|
|
254
|
+
method: HTTP_METHODS.POST,
|
|
255
|
+
},
|
|
256
|
+
facebookTargetingSearch: {
|
|
257
|
+
url: "/ads/facebook/targeting/search",
|
|
258
|
+
method: HTTP_METHODS.POST,
|
|
259
|
+
},
|
|
260
|
+
facebookGeoSearch: {
|
|
261
|
+
url: "/ads/facebook/targeting/geo_search",
|
|
262
|
+
method: HTTP_METHODS.GET,
|
|
263
|
+
},
|
|
264
|
+
facebookTargetingOptionStatus: {
|
|
265
|
+
url: "/ads/facebook/targeting/option_status",
|
|
266
|
+
method: HTTP_METHODS.GET,
|
|
267
|
+
},
|
|
268
|
+
facebookTargetingSuggestions: {
|
|
269
|
+
url: "/ads/facebook/targeting/suggestions",
|
|
270
|
+
method: HTTP_METHODS.POST,
|
|
271
|
+
},
|
|
272
|
+
facebookTargetingBrowse: {
|
|
273
|
+
url: "/ads/facebook/targeting/browse",
|
|
274
|
+
method: HTTP_METHODS.GET,
|
|
275
|
+
},
|
|
276
|
+
facebookTargetingValidation: {
|
|
277
|
+
url: "/ads/facebook/targeting/validation",
|
|
278
|
+
method: HTTP_METHODS.POST,
|
|
279
|
+
},
|
|
280
|
+
facebookDeliveryEstimate: {
|
|
281
|
+
url: "/ads/facebook/targeting/delivery_estimate",
|
|
282
|
+
method: HTTP_METHODS.GET,
|
|
283
|
+
},
|
|
284
|
+
tiktokTargetingSearch: {
|
|
285
|
+
url: "/ads/tiktok/targeting/search",
|
|
286
|
+
method: HTTP_METHODS.POST,
|
|
287
|
+
},
|
|
288
|
+
tiktokContextualTags: {
|
|
289
|
+
url: "/ads/tiktok/targeting/contextual_tags",
|
|
290
|
+
method: HTTP_METHODS.GET,
|
|
291
|
+
},
|
|
292
|
+
tiktokRecommendHashtags: {
|
|
293
|
+
url: "/ads/tiktok/targeting/hashtags",
|
|
294
|
+
method: HTTP_METHODS.GET,
|
|
295
|
+
},
|
|
296
|
+
tiktokCarriers: {
|
|
297
|
+
url: "/ads/tiktok/targeting/carriers",
|
|
298
|
+
method: HTTP_METHODS.GET,
|
|
299
|
+
},
|
|
300
|
+
tiktokInterestCategories: {
|
|
301
|
+
url: "/ads/tiktok/targeting/interest_categories",
|
|
302
|
+
method: HTTP_METHODS.GET,
|
|
303
|
+
},
|
|
304
|
+
tiktokActionCategories: {
|
|
305
|
+
url: "/ads/tiktok/targeting/action_categories",
|
|
306
|
+
method: HTTP_METHODS.GET,
|
|
307
|
+
},
|
|
308
|
+
tiktokContentExclusions: {
|
|
309
|
+
url: "/ads/tiktok/targeting/content_exclusions",
|
|
310
|
+
method: HTTP_METHODS.GET,
|
|
311
|
+
},
|
|
312
|
+
tiktokRegions: {
|
|
313
|
+
url: "/ads/tiktok/targeting/regions",
|
|
314
|
+
method: HTTP_METHODS.GET,
|
|
315
|
+
},
|
|
316
|
+
twitterListTargetingCriteria: {
|
|
317
|
+
url: "/ads/twitter/targeting/criteria",
|
|
318
|
+
method: HTTP_METHODS.GET,
|
|
319
|
+
},
|
|
320
|
+
twitterGetTargetingCriterion: {
|
|
321
|
+
url: "/ads/twitter/targeting/criteria/{criterion_id}",
|
|
322
|
+
method: HTTP_METHODS.GET,
|
|
323
|
+
},
|
|
324
|
+
twitterCreateTargetingCriterion: {
|
|
325
|
+
url: "/ads/twitter/targeting/criteria",
|
|
326
|
+
method: HTTP_METHODS.POST,
|
|
327
|
+
},
|
|
328
|
+
twitterDeleteTargetingCriterion: {
|
|
329
|
+
url: "/ads/twitter/targeting/criteria/{criterion_id}",
|
|
330
|
+
method: HTTP_METHODS.DELETE,
|
|
331
|
+
},
|
|
332
|
+
twitterBatchTargetingCriteria: {
|
|
333
|
+
url: "/ads/twitter/targeting/batch_criteria",
|
|
334
|
+
method: HTTP_METHODS.POST,
|
|
335
|
+
},
|
|
336
|
+
twitterTargetingDiscovery: {
|
|
337
|
+
url: "/ads/twitter/targeting/{resource}",
|
|
338
|
+
method: HTTP_METHODS.GET,
|
|
339
|
+
},
|
|
340
|
+
twitterTargetingSuggestions: {
|
|
341
|
+
url: "/ads/twitter/targeting/suggestions",
|
|
342
|
+
method: HTTP_METHODS.GET,
|
|
343
|
+
},
|
|
344
|
+
|
|
252
345
|
};
|
|
253
346
|
}
|
|
254
347
|
|