glitch-javascript-sdk 1.7.3 → 1.7.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/index.d.ts CHANGED
@@ -4436,57 +4436,58 @@ declare class Scheduler {
4436
4436
  */
4437
4437
  static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4438
4438
  /**
4439
- * Search for cross-promote partners.
4440
- * Uses query parameter `my_scheduler_id`
4441
- */
4442
- static crossPromoteSearch<T>(my_scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4439
+ * List cross-promote relationships for a scheduler (with optional pagination).
4440
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships
4441
+ */
4442
+ static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4443
4443
  /**
4444
- * List cross-promote invitations for a scheduler.
4445
- * Expects a query param `scheduler_id`
4444
+ * Find potential cross-promote partners for a scheduler (with optional filters).
4445
+ * GET /schedulers/{scheduler_id}/crosspromote/find
4446
4446
  */
4447
- static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4447
+ static crossPromoteFind<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4448
4448
  /**
4449
- * Send an invite to cross-promote.
4450
- * Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
4449
+ * List cross-promote invites for a scheduler (incoming + outgoing).
4450
+ * GET /schedulers/{scheduler_id}/crosspromote/invites
4451
4451
  */
4452
- static crossPromoteInviteSend<T>(scheduler_id: string, data: {
4453
- partner_scheduler_id: string;
4454
- optional_message?: string;
4455
- }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4452
+ static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4456
4453
  /**
4457
- * Respond to an invitation (accept or deny).
4454
+ * Send an invite to cross-promote (from scheduler_id to partner_scheduler_id).
4455
+ * POST /schedulers/{scheduler_id}/crosspromote/invites
4456
+ *
4457
+ * @param data { partner_scheduler_id, optional_message }
4458
4458
  */
4459
- static crossPromoteInviteRespond<T>(invitation_id: string, data: {
4460
- status: 'accepted' | 'denied';
4461
- platforms?: string[];
4462
- }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4459
+ static crossPromoteInviteSend<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4463
4460
  /**
4464
- * List cross-promote relationships for a scheduler.
4465
- * Expects a query param `scheduler_id`
4461
+ * Accept an invite to cross-promote.
4462
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept
4466
4463
  */
4467
- static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4464
+ static crossPromoteInviteAccept<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4468
4465
  /**
4469
- * End a cross-promote relationship.
4466
+ * Reject an invite to cross-promote.
4467
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/reject
4470
4468
  */
4471
- static crossPromoteEndRelationship<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4469
+ static crossPromoteInviteReject<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4472
4470
  /**
4473
- * List logs for a cross-promote relationship.
4471
+ * End a cross-promote relationship (delete).
4472
+ * DELETE /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}
4474
4473
  */
4475
- static crossPromoteListLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4474
+ static crossPromoteRelationshipDelete<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4476
4475
  /**
4477
4476
  * Get which platforms are cross-promoted in an existing relationship.
4477
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
4478
4478
  */
4479
- static crossPromoteRelationshipGetPlatforms<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4479
+ static crossPromoteRelationshipGetPlatforms<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4480
4480
  /**
4481
4481
  * Set which platforms are cross-promoted in an existing relationship.
4482
+ * PUT /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
4483
+ * data = { platforms: ['twitter','facebook',...]}
4482
4484
  */
4483
- static crossPromoteRelationshipSetPlatforms<T>(relationship_id: string, data: {
4484
- platforms: string[];
4485
- }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4485
+ static crossPromoteRelationshipSetPlatforms<T>(scheduler_id: string, relationship_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4486
4486
  /**
4487
- * Get recently cross-promoted posts under a relationship.
4487
+ * Get recently cross-promoted logs under a relationship.
4488
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
4488
4489
  */
4489
- static crossPromoteRelationshipPosts<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4490
+ static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4490
4491
  }
4491
4492
 
4492
4493
  declare class Funnel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -394,85 +394,137 @@ class Scheduler {
394
394
  }
395
395
 
396
396
  /**
397
- * Search for cross-promote partners.
398
- * Uses query parameter `my_scheduler_id`
399
- */
400
- public static crossPromoteSearch<T>(my_scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
401
- const newParams = { ...params, my_scheduler_id };
402
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteSearch, {}, {}, newParams);
397
+ * List cross-promote relationships for a scheduler (with optional pagination).
398
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships
399
+ */
400
+ public static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
401
+ return Requests.processRoute(
402
+ SchedulerRoute.routes.crossPromoteListRelationships,
403
+ {},
404
+ { scheduler_id },
405
+ params
406
+ );
403
407
  }
404
408
 
405
409
  /**
406
- * List cross-promote invitations for a scheduler.
407
- * Expects a query param `scheduler_id`
410
+ * Find potential cross-promote partners for a scheduler (with optional filters).
411
+ * GET /schedulers/{scheduler_id}/crosspromote/find
408
412
  */
409
- public static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
410
- const newParams = { ...params, scheduler_id };
411
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteInvitesList, {}, {}, newParams);
413
+ public static crossPromoteFind<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
414
+ // e.g. { platform:'twitter', min_followers:500, sort:'desc', page:2, limit:5 }
415
+ return Requests.processRoute(
416
+ SchedulerRoute.routes.crossPromoteFind,
417
+ {},
418
+ { scheduler_id },
419
+ params
420
+ );
412
421
  }
413
422
 
414
423
  /**
415
- * Send an invite to cross-promote.
416
- * Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
424
+ * List cross-promote invites for a scheduler (incoming + outgoing).
425
+ * GET /schedulers/{scheduler_id}/crosspromote/invites
417
426
  */
418
- public static crossPromoteInviteSend<T>(scheduler_id: string, data: { partner_scheduler_id: string, optional_message?: string }, params?: Record<string, any>): AxiosPromise<Response<T>> {
419
- const payload = {
420
- from_scheduler_id: scheduler_id,
421
- to_scheduler_id: data.partner_scheduler_id,
422
- message: data.optional_message || ''
423
- };
424
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteInviteSend, payload, {}, params);
427
+ public static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
428
+ return Requests.processRoute(
429
+ SchedulerRoute.routes.crossPromoteInvitesList,
430
+ {},
431
+ { scheduler_id },
432
+ params
433
+ );
425
434
  }
426
435
 
427
436
  /**
428
- * Respond to an invitation (accept or deny).
437
+ * Send an invite to cross-promote (from scheduler_id to partner_scheduler_id).
438
+ * POST /schedulers/{scheduler_id}/crosspromote/invites
439
+ *
440
+ * @param data { partner_scheduler_id, optional_message }
429
441
  */
430
- public static crossPromoteInviteRespond<T>(invitation_id: string, data: { status: 'accepted' | 'denied', platforms?: string[] }, params?: Record<string, any>): AxiosPromise<Response<T>> {
431
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteInviteRespond, data, { invitation_id }, params);
442
+ public static crossPromoteInviteSend<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
443
+ return Requests.processRoute(
444
+ SchedulerRoute.routes.crossPromoteInviteSend,
445
+ data,
446
+ { scheduler_id },
447
+ params
448
+ );
432
449
  }
433
450
 
434
451
  /**
435
- * List cross-promote relationships for a scheduler.
436
- * Expects a query param `scheduler_id`
452
+ * Accept an invite to cross-promote.
453
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept
437
454
  */
438
- public static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
439
- const newParams = { ...params, scheduler_id };
440
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteListRelationships, {}, {}, newParams);
455
+ public static crossPromoteInviteAccept<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
456
+ return Requests.processRoute(
457
+ SchedulerRoute.routes.crossPromoteInviteAccept,
458
+ {},
459
+ { scheduler_id, invite_id },
460
+ params
461
+ );
441
462
  }
442
463
 
443
464
  /**
444
- * End a cross-promote relationship.
465
+ * Reject an invite to cross-promote.
466
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/reject
445
467
  */
446
- public static crossPromoteEndRelationship<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
447
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteEndRelationship, {}, { relationship_id }, params);
468
+ public static crossPromoteInviteReject<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
469
+ return Requests.processRoute(
470
+ SchedulerRoute.routes.crossPromoteInviteReject,
471
+ {},
472
+ { scheduler_id, invite_id },
473
+ params
474
+ );
448
475
  }
449
476
 
450
477
  /**
451
- * List logs for a cross-promote relationship.
478
+ * End a cross-promote relationship (delete).
479
+ * DELETE /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}
452
480
  */
453
- public static crossPromoteListLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
454
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteListLogs, {}, { relationship_id }, params);
481
+ public static crossPromoteRelationshipDelete<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
482
+ return Requests.processRoute(
483
+ SchedulerRoute.routes.crossPromoteRelationshipDelete,
484
+ {},
485
+ { scheduler_id, relationship_id },
486
+ params
487
+ );
455
488
  }
456
489
 
457
490
  /**
458
491
  * Get which platforms are cross-promoted in an existing relationship.
492
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
459
493
  */
460
- public static crossPromoteRelationshipGetPlatforms<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
461
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipGetPlatforms, {}, { relationship_id }, params);
494
+ public static crossPromoteRelationshipGetPlatforms<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
495
+ return Requests.processRoute(
496
+ SchedulerRoute.routes.crossPromoteRelationshipGetPlatforms,
497
+ {},
498
+ { scheduler_id, relationship_id },
499
+ params
500
+ );
462
501
  }
463
502
 
464
503
  /**
465
504
  * Set which platforms are cross-promoted in an existing relationship.
505
+ * PUT /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
506
+ * data = { platforms: ['twitter','facebook',...]}
466
507
  */
467
- public static crossPromoteRelationshipSetPlatforms<T>(relationship_id: string, data: { platforms: string[] }, params?: Record<string, any>): AxiosPromise<Response<T>> {
468
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipSetPlatforms, data, { relationship_id }, params);
508
+ public static crossPromoteRelationshipSetPlatforms<T>(scheduler_id: string, relationship_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
509
+ return Requests.processRoute(
510
+ SchedulerRoute.routes.crossPromoteRelationshipSetPlatforms,
511
+ data,
512
+ { scheduler_id, relationship_id },
513
+ params
514
+ );
469
515
  }
470
516
 
471
517
  /**
472
- * Get recently cross-promoted posts under a relationship.
518
+ * Get recently cross-promoted logs under a relationship.
519
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
473
520
  */
474
- public static crossPromoteRelationshipPosts<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
475
- return Requests.processRoute(SchedulerRoute.routes.crossPromoteRelationshipPosts, {}, { relationship_id }, params);
521
+ public static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
522
+ return Requests.processRoute(
523
+ SchedulerRoute.routes.crossPromoteRelationshipPosts,
524
+ {},
525
+ { scheduler_id, relationship_id },
526
+ params
527
+ );
476
528
  }
477
529
 
478
530
  }
@@ -46,47 +46,48 @@ class SchedulerRoute {
46
46
  getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
47
47
  getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
48
48
 
49
- crossPromoteSearch: {
50
- url: '/schedulers/cross-promote/search',
49
+ crossPromoteListRelationships: {
50
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships',
51
+ method: HTTP_METHODS.GET
52
+ },
53
+ crossPromoteFind: {
54
+ url: '/schedulers/{scheduler_id}/crosspromote/find',
51
55
  method: HTTP_METHODS.GET
52
56
  },
53
57
  crossPromoteInvitesList: {
54
- url: '/schedulers/cross-promote/invitations',
58
+ url: '/schedulers/{scheduler_id}/crosspromote/invites',
55
59
  method: HTTP_METHODS.GET
56
60
  },
57
61
  crossPromoteInviteSend: {
58
- url: '/schedulers/cross-promote/invitations',
62
+ url: '/schedulers/{scheduler_id}/crosspromote/invites',
59
63
  method: HTTP_METHODS.POST
60
64
  },
61
- crossPromoteInviteRespond: {
62
- url: '/schedulers/cross-promote/invitations/{invitation_id}/respond',
65
+ crossPromoteInviteAccept: {
66
+ url: '/schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept',
63
67
  method: HTTP_METHODS.POST
64
68
  },
65
- crossPromoteListRelationships: {
66
- url: '/schedulers/cross-promote/relationships',
67
- method: HTTP_METHODS.GET
68
- },
69
- crossPromoteEndRelationship: {
70
- url: '/schedulers/cross-promote/relationships/{relationship_id}/end',
69
+ crossPromoteInviteReject: {
70
+ url: '/schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/reject',
71
71
  method: HTTP_METHODS.POST
72
72
  },
73
- crossPromoteListLogs: {
74
- url: '/schedulers/cross-promote/relationships/{relationship_id}/logs',
75
- method: HTTP_METHODS.GET
73
+ crossPromoteRelationshipDelete: {
74
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}',
75
+ method: HTTP_METHODS.DELETE
76
76
  },
77
77
  crossPromoteRelationshipGetPlatforms: {
78
- url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
78
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms',
79
79
  method: HTTP_METHODS.GET
80
80
  },
81
81
  crossPromoteRelationshipSetPlatforms: {
82
- url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
82
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms',
83
83
  method: HTTP_METHODS.PUT
84
84
  },
85
85
  crossPromoteRelationshipPosts: {
86
- url: '/schedulers/cross-promote/relationships/{relationship_id}/posts',
86
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
87
87
  method: HTTP_METHODS.GET
88
88
  },
89
89
 
90
+
90
91
  };
91
92
  }
92
93