glitch-javascript-sdk 1.9.2 → 1.9.4
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 +76 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +16 -0
- package/dist/esm/api/Scheduler.d.ts +27 -0
- package/dist/esm/index.js +76 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +43 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +87 -49
- package/src/api/Scheduler.ts +62 -0
- package/src/routes/AdsRoute.ts +8 -0
- package/src/routes/SchedulerRoute.ts +6 -0
package/dist/esm/api/Ads.d.ts
CHANGED
|
@@ -358,5 +358,21 @@ declare class Ads {
|
|
|
358
358
|
static twitterBatchTargetingCriteria<T>(data: object[], params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
359
359
|
static lookupTwitterTargeting<T>(resource: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
360
360
|
static twitterTargetingSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
361
|
+
/**
|
|
362
|
+
* Deep-sync a campaign tree (campaign → groups → ads) with its remote platform.
|
|
363
|
+
*
|
|
364
|
+
* @param campaign_id UUID of the campaign to sync
|
|
365
|
+
* @param params Optional query params
|
|
366
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
367
|
+
*/
|
|
368
|
+
static syncCampaignTree<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
369
|
+
/**
|
|
370
|
+
* Deep-sync all the campaigns for a scheduler.
|
|
371
|
+
*
|
|
372
|
+
* @param scheduler_id UUID of the campaign to sync
|
|
373
|
+
* @param params Optional query params
|
|
374
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
375
|
+
*/
|
|
376
|
+
static syncSchedulerCampaigns<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
361
377
|
}
|
|
362
378
|
export default Ads;
|
|
@@ -71,6 +71,19 @@ declare class Scheduler {
|
|
|
71
71
|
* @returns promise
|
|
72
72
|
*/
|
|
73
73
|
static getSchedulePosts<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
74
|
+
/**
|
|
75
|
+
* Rewrite / generate content for a promotion schedule.
|
|
76
|
+
*
|
|
77
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateTitleContent
|
|
78
|
+
*
|
|
79
|
+
* @param scheduler_id UUID of the promotion schedule.
|
|
80
|
+
* @param data Body payload. At minimum you must supply
|
|
81
|
+
* `{ platform: 'twitter' }` plus either `content`
|
|
82
|
+
* **or** a `media` array containing at least one
|
|
83
|
+
* `{ id: '<media-uuid>' }`.
|
|
84
|
+
* @returns Axios promise with `{ content, title? }`
|
|
85
|
+
*/
|
|
86
|
+
static generateTitleContent<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
74
87
|
/**
|
|
75
88
|
* List title updates for a promotion schedule.
|
|
76
89
|
*
|
|
@@ -289,6 +302,20 @@ declare class Scheduler {
|
|
|
289
302
|
* @returns promise
|
|
290
303
|
*/
|
|
291
304
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
305
|
+
/**
|
|
306
|
+
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
307
|
+
*
|
|
308
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
309
|
+
* @returns promise
|
|
310
|
+
*/
|
|
311
|
+
static clearGoogleAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
312
|
+
/**
|
|
313
|
+
* Clear Tiktok Ads OAuth credentials from a promotion schedule.
|
|
314
|
+
*
|
|
315
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
316
|
+
* @returns promise
|
|
317
|
+
*/
|
|
318
|
+
static clearTiktokAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
292
319
|
/**
|
|
293
320
|
* Get aggregated reports for a promotion schedule.
|
|
294
321
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -6918,6 +6918,14 @@ var AdsRoute = /** @class */ (function () {
|
|
|
6918
6918
|
url: "/ads/twitter/targeting/suggestions",
|
|
6919
6919
|
method: HTTP_METHODS.GET,
|
|
6920
6920
|
},
|
|
6921
|
+
syncCampaignTree: {
|
|
6922
|
+
url: "/ads/campaigns/{campaign_id}/sync_tree",
|
|
6923
|
+
method: HTTP_METHODS.POST,
|
|
6924
|
+
},
|
|
6925
|
+
syncSchedulerCampaigns: {
|
|
6926
|
+
url: "/ads/campaigns/scheduler/{scheduler_id}/syncAll",
|
|
6927
|
+
method: HTTP_METHODS.POST,
|
|
6928
|
+
},
|
|
6921
6929
|
};
|
|
6922
6930
|
return AdsRoute;
|
|
6923
6931
|
}());
|
|
@@ -7464,6 +7472,26 @@ var Ads = /** @class */ (function () {
|
|
|
7464
7472
|
Ads.twitterTargetingSuggestions = function (params) {
|
|
7465
7473
|
return Requests.processRoute(AdsRoute.routes.twitterTargetingSuggestions, undefined, undefined, params);
|
|
7466
7474
|
};
|
|
7475
|
+
/**
|
|
7476
|
+
* Deep-sync a campaign tree (campaign → groups → ads) with its remote platform.
|
|
7477
|
+
*
|
|
7478
|
+
* @param campaign_id UUID of the campaign to sync
|
|
7479
|
+
* @param params Optional query params
|
|
7480
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
7481
|
+
*/
|
|
7482
|
+
Ads.syncCampaignTree = function (campaign_id, params) {
|
|
7483
|
+
return Requests.processRoute(AdsRoute.routes.syncCampaignTree, undefined, { campaign_id: campaign_id }, params);
|
|
7484
|
+
};
|
|
7485
|
+
/**
|
|
7486
|
+
* Deep-sync all the campaigns for a scheduler.
|
|
7487
|
+
*
|
|
7488
|
+
* @param scheduler_id UUID of the campaign to sync
|
|
7489
|
+
* @param params Optional query params
|
|
7490
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
7491
|
+
*/
|
|
7492
|
+
Ads.syncSchedulerCampaigns = function (scheduler_id, params) {
|
|
7493
|
+
return Requests.processRoute(AdsRoute.routes.syncSchedulerCampaigns, undefined, { scheduler_id: scheduler_id }, params);
|
|
7494
|
+
};
|
|
7467
7495
|
return Ads;
|
|
7468
7496
|
}());
|
|
7469
7497
|
|
|
@@ -12820,6 +12848,8 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
12820
12848
|
clearSteamAuth: { url: '/schedulers/{scheduler_id}/clearSteamAuth', method: HTTP_METHODS.DELETE },
|
|
12821
12849
|
clearDiscordAuth: { url: '/schedulers/{scheduler_id}/clearDiscordAuth', method: HTTP_METHODS.DELETE },
|
|
12822
12850
|
clearBlueskyAuth: { url: '/schedulers/{scheduler_id}/clearBlueskyAuth', method: HTTP_METHODS.DELETE },
|
|
12851
|
+
clearTiktokAdsAuth: { url: '/schedulers/{scheduler_id}/clearTiktokAdsAuth', method: HTTP_METHODS.DELETE },
|
|
12852
|
+
clearGoogleAdsAuth: { url: '/schedulers/{scheduler_id}/clearGoogleAdsAuth', method: HTTP_METHODS.DELETE },
|
|
12823
12853
|
//Social Utility Routes
|
|
12824
12854
|
getFacebookGroups: { url: '/schedulers/{scheduler_id}/facebook/groups', method: HTTP_METHODS.GET },
|
|
12825
12855
|
getInstagramAccounts: { url: '/schedulers/{scheduler_id}/instagram/accounts', method: HTTP_METHODS.GET },
|
|
@@ -12878,6 +12908,10 @@ var SchedulerRoute = /** @class */ (function () {
|
|
|
12878
12908
|
url: "/schedulers/{scheduler_id}/funding_instruments",
|
|
12879
12909
|
method: HTTP_METHODS.GET,
|
|
12880
12910
|
},
|
|
12911
|
+
generateContent: {
|
|
12912
|
+
url: '/schedulers/{scheduler_id}/generateContent',
|
|
12913
|
+
method: HTTP_METHODS.POST
|
|
12914
|
+
},
|
|
12881
12915
|
};
|
|
12882
12916
|
return SchedulerRoute;
|
|
12883
12917
|
}());
|
|
@@ -12969,6 +13003,24 @@ var Scheduler = /** @class */ (function () {
|
|
|
12969
13003
|
Scheduler.getSchedulePosts = function (scheduler_id, params) {
|
|
12970
13004
|
return Requests.processRoute(SchedulerRoute.routes.getSchedulePosts, {}, { scheduler_id: scheduler_id }, params);
|
|
12971
13005
|
};
|
|
13006
|
+
/**
|
|
13007
|
+
* Rewrite / generate content for a promotion schedule.
|
|
13008
|
+
*
|
|
13009
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/generateTitleContent
|
|
13010
|
+
*
|
|
13011
|
+
* @param scheduler_id UUID of the promotion schedule.
|
|
13012
|
+
* @param data Body payload. At minimum you must supply
|
|
13013
|
+
* `{ platform: 'twitter' }` plus either `content`
|
|
13014
|
+
* **or** a `media` array containing at least one
|
|
13015
|
+
* `{ id: '<media-uuid>' }`.
|
|
13016
|
+
* @returns Axios promise with `{ content, title? }`
|
|
13017
|
+
*/
|
|
13018
|
+
Scheduler.generateTitleContent = function (scheduler_id, data, params) {
|
|
13019
|
+
return Requests.processRoute(SchedulerRoute.routes.generateContent, data, // request body
|
|
13020
|
+
{ scheduler_id: scheduler_id }, // path params
|
|
13021
|
+
params // query params
|
|
13022
|
+
);
|
|
13023
|
+
};
|
|
12972
13024
|
/**
|
|
12973
13025
|
* List title updates for a promotion schedule.
|
|
12974
13026
|
*
|
|
@@ -13241,6 +13293,30 @@ var Scheduler = /** @class */ (function () {
|
|
|
13241
13293
|
Scheduler.getDiscordChannels = function (scheduler_id, params) {
|
|
13242
13294
|
return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id: scheduler_id }, params);
|
|
13243
13295
|
};
|
|
13296
|
+
/**
|
|
13297
|
+
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
13298
|
+
*
|
|
13299
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13300
|
+
* @returns promise
|
|
13301
|
+
*/
|
|
13302
|
+
Scheduler.clearGoogleAdsAuth = function (scheduler_id, params) {
|
|
13303
|
+
return Requests.processRoute(SchedulerRoute.routes.clearGoogleAdsAuth, {}, // no body
|
|
13304
|
+
{ scheduler_id: scheduler_id }, // path params
|
|
13305
|
+
params // optional query params
|
|
13306
|
+
);
|
|
13307
|
+
};
|
|
13308
|
+
/**
|
|
13309
|
+
* Clear Tiktok Ads OAuth credentials from a promotion schedule.
|
|
13310
|
+
*
|
|
13311
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
13312
|
+
* @returns promise
|
|
13313
|
+
*/
|
|
13314
|
+
Scheduler.clearTiktokAdsAuth = function (scheduler_id, params) {
|
|
13315
|
+
return Requests.processRoute(SchedulerRoute.routes.clearTiktokAdsAuth, {}, // no body
|
|
13316
|
+
{ scheduler_id: scheduler_id }, // path params
|
|
13317
|
+
params // optional query params
|
|
13318
|
+
);
|
|
13319
|
+
};
|
|
13244
13320
|
/**
|
|
13245
13321
|
* Get aggregated reports for a promotion schedule.
|
|
13246
13322
|
*
|