glitch-javascript-sdk 3.2.5 → 3.2.7

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.
@@ -1,5 +1,16 @@
1
1
  import Response from "../util/Response";
2
2
  import { AxiosPromise, AxiosProgressEvent } from "axios";
3
+ export interface AgentRunRequest {
4
+ run_type?: string;
5
+ trigger_source?: string;
6
+ background?: boolean;
7
+ inline?: boolean;
8
+ live_mode?: boolean;
9
+ initial_message?: string | null;
10
+ attachment_ids?: string[];
11
+ agent_run_id?: string | null;
12
+ [key: string]: any;
13
+ }
3
14
  declare class Agents {
4
15
  /**
5
16
  * List game titles that can be managed in the Agents section.
@@ -36,7 +47,7 @@ declare class Agents {
36
47
  /**
37
48
  * Run an agent planning cycle. Returns 402 when trial/subscription is required.
38
49
  */
39
- static runAgent<T>(title_id: string, agent_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
50
+ static runAgent<T>(title_id: string, agent_id: string, data?: AgentRunRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
40
51
  /**
41
52
  * Upload one file for an agent run. data can include { agent_run_id }.
42
53
  */
@@ -9,6 +9,14 @@ declare class Campaigns {
9
9
  * @returns promise
10
10
  */
11
11
  static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * List public influencer campaigns.
14
+ *
15
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/getPublicCampaigns
16
+ *
17
+ * @returns promise
18
+ */
19
+ static listPublic<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
20
  /**
13
21
  * Create a new campaign.
14
22
  *
@@ -165,6 +173,13 @@ declare class Campaigns {
165
173
  * @returns promise
166
174
  */
167
175
  static updateInfluencerCampaign<T>(campaign_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
176
+ /**
177
+ * Delete an influencer campaign relationship.
178
+ *
179
+ * The backend route currently exists, but the controller destroy implementation is intentionally
180
+ * treated as an agent/admin stop-gate because removal can orphan posts, payouts, or contracts.
181
+ */
182
+ static deleteInfluencerCampaign<T>(campaign_id: string, user_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
168
183
  /**
169
184
  * Retrieve the information for a single campaign.
170
185
  *
@@ -17,6 +17,14 @@ declare class Messages {
17
17
  * @returns A promise
18
18
  */
19
19
  static sendMessage<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Updates a message.
22
+ *
23
+ * @see https://api.glitch.fun/api/documentation#/Messages/updateMessage
24
+ *
25
+ * @returns A promise
26
+ */
27
+ static updateMessage<T>(message_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
28
  /**
21
29
  * Deletes a message.
22
30
  *
@@ -295,6 +295,14 @@ declare class Scheduler {
295
295
  * @returns promise
296
296
  */
297
297
  static getRedditSubredditFlairs<T>(scheduler_id: string, subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
298
+ /**
299
+ * Get posting rules for a specific Reddit subreddit.
300
+ *
301
+ * @param scheduler_id The ID of the promotion schedule.
302
+ * @param subreddit The name of the subreddit.
303
+ * @returns promise
304
+ */
305
+ static getRedditSubredditRules<T>(scheduler_id: string, subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
298
306
  /**
299
307
  * Get Discord channels associated with the scheduler's Discord account.
300
308
  *
@@ -385,6 +393,36 @@ declare class Scheduler {
385
393
  * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
386
394
  */
387
395
  static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
396
+ /**
397
+ * Search cross-promote opportunities using the normalized route family.
398
+ * GET /schedulers/cross-promote/search
399
+ */
400
+ static crossPromoteSearch<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
401
+ /**
402
+ * Send a normalized cross-promote invitation.
403
+ * POST /schedulers/cross-promote/invitations
404
+ */
405
+ static crossPromoteInvitationSend<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
406
+ /**
407
+ * Respond to a normalized cross-promote invitation.
408
+ * POST /schedulers/cross-promote/invitations/{invitation_id}/respond
409
+ */
410
+ static crossPromoteInvitationRespond<T>(invitation_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
411
+ /**
412
+ * List normalized cross-promote relationships.
413
+ * GET /schedulers/cross-promote/relationships
414
+ */
415
+ static crossPromoteRelationshipsList<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
416
+ /**
417
+ * End a normalized cross-promote relationship.
418
+ * POST /schedulers/cross-promote/relationships/{relationship_id}/end
419
+ */
420
+ static crossPromoteRelationshipEnd<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
421
+ /**
422
+ * List normalized cross-promote relationship logs.
423
+ * GET /schedulers/cross-promote/relationships/{relationship_id}/logs
424
+ */
425
+ static crossPromoteRelationshipLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
388
426
  /**
389
427
  * List platform-level businesses for the given campaign ID,
390
428
  * as defined by /schedulers/{scheduler_id}/businesses on the backend.
@@ -116,7 +116,7 @@ declare class SocialPosts {
116
116
  *
117
117
  * @returns promise
118
118
  */
119
- static reports<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
119
+ static reports<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
120
120
  /**
121
121
  * Update the information about a post impressions, for posts who API do not give view counts.
122
122
  *
package/dist/esm/index.js CHANGED
@@ -10571,7 +10571,7 @@ var PostsRoute = /** @class */ (function () {
10571
10571
  join: { url: '/posts/{post_id}/join', method: HTTP_METHODS.POST },
10572
10572
  follow: { url: '/posts/{post_id}/follow', method: HTTP_METHODS.POST },
10573
10573
  leave: { url: '/posts/{post_id}/leave', method: HTTP_METHODS.DELETE },
10574
- resolve: { url: '/posts/{post_id}/resolve', method: HTTP_METHODS.POST },
10574
+ resolve: { url: '/posts/{post_id}/resolve', method: HTTP_METHODS.PATCH },
10575
10575
  updatePreferences: { url: '/posts/{post_id}/participants/me', method: HTTP_METHODS.PUT },
10576
10576
  };
10577
10577
  return PostsRoute;
@@ -11479,8 +11479,8 @@ var SocialPosts = /** @class */ (function () {
11479
11479
  *
11480
11480
  * @returns promise
11481
11481
  */
11482
- SocialPosts.reports = function (params) {
11483
- return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, undefined, params);
11482
+ SocialPosts.reports = function (post_id, params) {
11483
+ return Requests.processRoute(SocialPostsRoute.routes.reports, undefined, { post_id: post_id }, params);
11484
11484
  };
11485
11485
  /**
11486
11486
  * Update the information about a post impressions, for posts who API do not give view counts.
@@ -13074,6 +13074,7 @@ var CampaignsRoute = /** @class */ (function () {
13074
13074
  }
13075
13075
  CampaignsRoute.routes = {
13076
13076
  listCampaigns: { url: '/campaigns', method: HTTP_METHODS.GET },
13077
+ listPublicCampaigns: { url: '/campaigns/public', method: HTTP_METHODS.GET },
13077
13078
  createCampaign: { url: '/campaigns', method: HTTP_METHODS.POST },
13078
13079
  viewCampaign: { url: '/campaigns/{campaign_id}', method: HTTP_METHODS.GET },
13079
13080
  updateCampaign: { url: '/campaigns/{campaign_id}', method: HTTP_METHODS.PUT },
@@ -13090,6 +13091,7 @@ var CampaignsRoute = /** @class */ (function () {
13090
13091
  listInfluencerCampaigns: { url: '/campaigns/influencers', method: HTTP_METHODS.GET },
13091
13092
  viewInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.GET },
13092
13093
  updateInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.PUT },
13094
+ deleteInfluencerCampaign: { url: '/campaigns/{campaign_id}/influencers/{user_id}', method: HTTP_METHODS.DELETE },
13093
13095
  markInfluencerCampaignComplete: { url: '/campaigns/{campaign_id}/influencers/{user_id}/setComplete', method: HTTP_METHODS.POST },
13094
13096
  markInfluencerCampaignIncomplete: { url: '/campaigns/{campaign_id}/influencers/{user_id}/setIncomplete', method: HTTP_METHODS.POST },
13095
13097
  listInfluencerCampaignLinks: { url: '/campaigns/{campaign_id}/influencers/{user_id}/links', method: HTTP_METHODS.GET },
@@ -13190,6 +13192,16 @@ var Campaigns = /** @class */ (function () {
13190
13192
  Campaigns.list = function (params) {
13191
13193
  return Requests.processRoute(CampaignsRoute.routes.listCampaigns, undefined, undefined, params);
13192
13194
  };
13195
+ /**
13196
+ * List public influencer campaigns.
13197
+ *
13198
+ * @see https://api.glitch.fun/api/documentation#/Campaigns/getPublicCampaigns
13199
+ *
13200
+ * @returns promise
13201
+ */
13202
+ Campaigns.listPublic = function (params) {
13203
+ return Requests.processRoute(CampaignsRoute.routes.listPublicCampaigns, undefined, undefined, params);
13204
+ };
13193
13205
  /**
13194
13206
  * Create a new campaign.
13195
13207
  *
@@ -13380,6 +13392,15 @@ var Campaigns = /** @class */ (function () {
13380
13392
  Campaigns.updateInfluencerCampaign = function (campaign_id, user_id, data, params) {
13381
13393
  return Requests.processRoute(CampaignsRoute.routes.updateInfluencerCampaign, data, { campaign_id: campaign_id, user_id: user_id }, params);
13382
13394
  };
13395
+ /**
13396
+ * Delete an influencer campaign relationship.
13397
+ *
13398
+ * The backend route currently exists, but the controller destroy implementation is intentionally
13399
+ * treated as an agent/admin stop-gate because removal can orphan posts, payouts, or contracts.
13400
+ */
13401
+ Campaigns.deleteInfluencerCampaign = function (campaign_id, user_id, params) {
13402
+ return Requests.processRoute(CampaignsRoute.routes.deleteInfluencerCampaign, undefined, { campaign_id: campaign_id, user_id: user_id }, params);
13403
+ };
13383
13404
  /**
13384
13405
  * Retrieve the information for a single campaign.
13385
13406
  *
@@ -13805,7 +13826,7 @@ var Campaigns = /** @class */ (function () {
13805
13826
  * @returns promise
13806
13827
  */
13807
13828
  Campaigns.listPayouts = function (campaign_id, params) {
13808
- return Requests.processRoute(CampaignsRoute.routes.getLedger, undefined, { campaign_id: campaign_id }, params);
13829
+ return Requests.processRoute(CampaignsRoute.routes.listPayouts, undefined, { campaign_id: campaign_id }, params);
13809
13830
  };
13810
13831
  /**
13811
13832
  * Generate a contract for the influencer based on the values in the campaign.
@@ -14293,6 +14314,7 @@ var MessagesRoute = /** @class */ (function () {
14293
14314
  MessagesRoute.routes = {
14294
14315
  listMessageThreads: { url: '/messages', method: HTTP_METHODS.GET },
14295
14316
  sendMessage: { url: '/messages', method: HTTP_METHODS.POST },
14317
+ updateMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.PUT },
14296
14318
  deleteMessage: { url: '/messages/{message_id}', method: HTTP_METHODS.DELETE },
14297
14319
  createOrGetThread: { url: '/messages/makeThread', method: HTTP_METHODS.POST },
14298
14320
  getThread: { url: '/messages/thread/{thread_id}', method: HTTP_METHODS.GET },
@@ -14323,6 +14345,16 @@ var Messages = /** @class */ (function () {
14323
14345
  Messages.sendMessage = function (data, params) {
14324
14346
  return Requests.processRoute(MessagesRoute.routes.sendMessage, data, {}, params);
14325
14347
  };
14348
+ /**
14349
+ * Updates a message.
14350
+ *
14351
+ * @see https://api.glitch.fun/api/documentation#/Messages/updateMessage
14352
+ *
14353
+ * @returns A promise
14354
+ */
14355
+ Messages.updateMessage = function (message_id, data, params) {
14356
+ return Requests.processRoute(MessagesRoute.routes.updateMessage, data, { message_id: message_id }, params);
14357
+ };
14326
14358
  /**
14327
14359
  * Deletes a message.
14328
14360
  *
@@ -15554,6 +15586,7 @@ var SchedulerRoute = /** @class */ (function () {
15554
15586
  getInstagramAccounts: { url: '/schedulers/{scheduler_id}/instagram/accounts', method: HTTP_METHODS.GET },
15555
15587
  getRedditSubreddits: { url: '/schedulers/{scheduler_id}/reddit/subreddits', method: HTTP_METHODS.GET },
15556
15588
  getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
15589
+ getRedditSubredditRules: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/rules', method: HTTP_METHODS.GET },
15557
15590
  getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
15558
15591
  crossPromoteListRelationships: {
15559
15592
  url: '/schedulers/{scheduler_id}/crosspromote/relationships',
@@ -15595,6 +15628,30 @@ var SchedulerRoute = /** @class */ (function () {
15595
15628
  url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
15596
15629
  method: HTTP_METHODS.GET
15597
15630
  },
15631
+ crossPromoteSearch: {
15632
+ url: '/schedulers/cross-promote/search',
15633
+ method: HTTP_METHODS.GET
15634
+ },
15635
+ crossPromoteInvitationSend: {
15636
+ url: '/schedulers/cross-promote/invitations',
15637
+ method: HTTP_METHODS.POST
15638
+ },
15639
+ crossPromoteInvitationRespond: {
15640
+ url: '/schedulers/cross-promote/invitations/{invitation_id}/respond',
15641
+ method: HTTP_METHODS.POST
15642
+ },
15643
+ crossPromoteRelationshipsList: {
15644
+ url: '/schedulers/cross-promote/relationships',
15645
+ method: HTTP_METHODS.GET
15646
+ },
15647
+ crossPromoteRelationshipEnd: {
15648
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/end',
15649
+ method: HTTP_METHODS.POST
15650
+ },
15651
+ crossPromoteRelationshipLogs: {
15652
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/logs',
15653
+ method: HTTP_METHODS.GET
15654
+ },
15598
15655
  getCampaignBusinesses: {
15599
15656
  url: "/schedulers/{scheduler_id}/businesses",
15600
15657
  method: HTTP_METHODS.GET,
@@ -16007,6 +16064,16 @@ var Scheduler = /** @class */ (function () {
16007
16064
  Scheduler.getRedditSubredditFlairs = function (scheduler_id, subreddit, params) {
16008
16065
  return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditFlairs, {}, { scheduler_id: scheduler_id, subreddit: subreddit }, params);
16009
16066
  };
16067
+ /**
16068
+ * Get posting rules for a specific Reddit subreddit.
16069
+ *
16070
+ * @param scheduler_id The ID of the promotion schedule.
16071
+ * @param subreddit The name of the subreddit.
16072
+ * @returns promise
16073
+ */
16074
+ Scheduler.getRedditSubredditRules = function (scheduler_id, subreddit, params) {
16075
+ return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditRules, {}, { scheduler_id: scheduler_id, subreddit: subreddit }, params);
16076
+ };
16010
16077
  /**
16011
16078
  * Get Discord channels associated with the scheduler's Discord account.
16012
16079
  *
@@ -16134,6 +16201,48 @@ var Scheduler = /** @class */ (function () {
16134
16201
  Scheduler.crossPromoteRelationshipPosts = function (scheduler_id, relationship_id, params) {
16135
16202
  return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { scheduler_id: scheduler_id, relationship_id: relationship_id }, params);
16136
16203
  };
16204
+ /**
16205
+ * Search cross-promote opportunities using the normalized route family.
16206
+ * GET /schedulers/cross-promote/search
16207
+ */
16208
+ Scheduler.crossPromoteSearch = function (params) {
16209
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteSearch, {}, {}, params);
16210
+ };
16211
+ /**
16212
+ * Send a normalized cross-promote invitation.
16213
+ * POST /schedulers/cross-promote/invitations
16214
+ */
16215
+ Scheduler.crossPromoteInvitationSend = function (data, params) {
16216
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteInvitationSend, data, {}, params);
16217
+ };
16218
+ /**
16219
+ * Respond to a normalized cross-promote invitation.
16220
+ * POST /schedulers/cross-promote/invitations/{invitation_id}/respond
16221
+ */
16222
+ Scheduler.crossPromoteInvitationRespond = function (invitation_id, data, params) {
16223
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteInvitationRespond, data, { invitation_id: invitation_id }, params);
16224
+ };
16225
+ /**
16226
+ * List normalized cross-promote relationships.
16227
+ * GET /schedulers/cross-promote/relationships
16228
+ */
16229
+ Scheduler.crossPromoteRelationshipsList = function (params) {
16230
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipsList, {}, {}, params);
16231
+ };
16232
+ /**
16233
+ * End a normalized cross-promote relationship.
16234
+ * POST /schedulers/cross-promote/relationships/{relationship_id}/end
16235
+ */
16236
+ Scheduler.crossPromoteRelationshipEnd = function (relationship_id, params) {
16237
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipEnd, {}, { relationship_id: relationship_id }, params);
16238
+ };
16239
+ /**
16240
+ * List normalized cross-promote relationship logs.
16241
+ * GET /schedulers/cross-promote/relationships/{relationship_id}/logs
16242
+ */
16243
+ Scheduler.crossPromoteRelationshipLogs = function (relationship_id, params) {
16244
+ return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipLogs, {}, { relationship_id: relationship_id }, params);
16245
+ };
16137
16246
  /**
16138
16247
  * List platform-level businesses for the given campaign ID,
16139
16248
  * as defined by /schedulers/{scheduler_id}/businesses on the backend.