glitch-javascript-sdk 1.7.1 → 1.7.2

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
@@ -4435,6 +4435,77 @@ declare class Scheduler {
4435
4435
  * @returns promise
4436
4436
  */
4437
4437
  static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4438
+ /**
4439
+ * List active cross-promote relationships for a scheduler.
4440
+ *
4441
+ * @param scheduler_id The ID of the promotion schedule
4442
+ * @param params Optional query params
4443
+ */
4444
+ static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4445
+ /**
4446
+ * Find potential cross-promote partners for a scheduler.
4447
+ *
4448
+ * @param scheduler_id The ID of the promotion schedule
4449
+ * @param params Optional query params
4450
+ */
4451
+ static crossPromoteFind<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4452
+ /**
4453
+ * List cross-promote invites for a scheduler.
4454
+ *
4455
+ * @param scheduler_id The ID of the promotion schedule
4456
+ * @param params Optional query params
4457
+ */
4458
+ static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4459
+ /**
4460
+ * Send an invite to cross-promote.
4461
+ *
4462
+ * @param scheduler_id The ID of the promotion schedule
4463
+ * @param data { partner_scheduler_id, optional_message }
4464
+ */
4465
+ static crossPromoteInviteSend<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4466
+ /**
4467
+ * Accept an invite to cross-promote.
4468
+ *
4469
+ * @param scheduler_id The ID of the promotion schedule
4470
+ * @param invite_id The ID of the invite
4471
+ */
4472
+ static crossPromoteInviteAccept<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4473
+ /**
4474
+ * Reject an invite to cross-promote.
4475
+ *
4476
+ * @param scheduler_id The ID of the promotion schedule
4477
+ * @param invite_id The ID of the invite
4478
+ */
4479
+ static crossPromoteInviteReject<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4480
+ /**
4481
+ * End a cross-promote relationship.
4482
+ *
4483
+ * @param scheduler_id The ID of the promotion schedule
4484
+ * @param relationship_id The ID of the relationship
4485
+ */
4486
+ static crossPromoteRelationshipDelete<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4487
+ /**
4488
+ * Get which platforms are cross-promoted in an existing relationship.
4489
+ *
4490
+ * @param scheduler_id The ID of the promotion schedule
4491
+ * @param relationship_id The ID of the relationship
4492
+ */
4493
+ static crossPromoteRelationshipGetPlatforms<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4494
+ /**
4495
+ * Set which platforms are cross-promoted in an existing relationship.
4496
+ *
4497
+ * @param scheduler_id The ID of the promotion schedule
4498
+ * @param relationship_id The ID of the relationship
4499
+ * @param data An object like { platforms: ['twitter', 'facebook', ...] }
4500
+ */
4501
+ static crossPromoteRelationshipSetPlatforms<T>(scheduler_id: string, relationship_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4502
+ /**
4503
+ * Get recently cross-promoted posts under a relationship.
4504
+ *
4505
+ * @param scheduler_id The ID of the promotion schedule
4506
+ * @param relationship_id The ID of the relationship
4507
+ */
4508
+ static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4438
4509
  }
4439
4510
 
4440
4511
  declare class Funnel {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -320,13 +320,13 @@ class Scheduler {
320
320
  return Requests.processRoute(SchedulerRoute.routes.clearBlueskyAuth, {}, { scheduler_id }, params);
321
321
  }
322
322
 
323
- /**
324
- * Get Facebook groups associated with the scheduler's Facebook account.
325
- *
326
- * @param scheduler_id The ID of the promotion schedule.
327
- * @returns promise
328
- */
329
- public static getFacebookGroups<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
323
+ /**
324
+ * Get Facebook groups associated with the scheduler's Facebook account.
325
+ *
326
+ * @param scheduler_id The ID of the promotion schedule.
327
+ * @returns promise
328
+ */
329
+ public static getFacebookGroups<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
330
330
  return Requests.processRoute(SchedulerRoute.routes.getFacebookGroups, {}, { scheduler_id }, params);
331
331
  }
332
332
 
@@ -361,13 +361,13 @@ class Scheduler {
361
361
  return Requests.processRoute(SchedulerRoute.routes.getRedditSubredditFlairs, {}, { scheduler_id, subreddit }, params);
362
362
  }
363
363
 
364
- /**
365
- * Get Discord channels associated with the scheduler's Discord account.
366
- *
367
- * @param scheduler_id The ID of the promotion schedule.
368
- * @returns promise
369
- */
370
- public static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
364
+ /**
365
+ * Get Discord channels associated with the scheduler's Discord account.
366
+ *
367
+ * @param scheduler_id The ID of the promotion schedule.
368
+ * @returns promise
369
+ */
370
+ public static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
371
371
  return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id }, params);
372
372
  }
373
373
 
@@ -393,6 +393,157 @@ class Scheduler {
393
393
  return Requests.processRoute(SchedulerRoute.routes.getSchedulerProgression, {}, { scheduler_id }, params);
394
394
  }
395
395
 
396
+ /**
397
+ * List active cross-promote relationships for a scheduler.
398
+ *
399
+ * @param scheduler_id The ID of the promotion schedule
400
+ * @param params Optional query params
401
+ */
402
+ public static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
403
+ return Requests.processRoute(
404
+ SchedulerRoute.routes.crossPromoteListRelationships,
405
+ {},
406
+ { scheduler_id },
407
+ params
408
+ );
409
+ }
410
+
411
+ /**
412
+ * Find potential cross-promote partners for a scheduler.
413
+ *
414
+ * @param scheduler_id The ID of the promotion schedule
415
+ * @param params Optional query params
416
+ */
417
+ public static crossPromoteFind<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
418
+ return Requests.processRoute(
419
+ SchedulerRoute.routes.crossPromoteFind,
420
+ {},
421
+ { scheduler_id },
422
+ params
423
+ );
424
+ }
425
+
426
+ /**
427
+ * List cross-promote invites for a scheduler.
428
+ *
429
+ * @param scheduler_id The ID of the promotion schedule
430
+ * @param params Optional query params
431
+ */
432
+ public static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
433
+ return Requests.processRoute(
434
+ SchedulerRoute.routes.crossPromoteInvitesList,
435
+ {},
436
+ { scheduler_id },
437
+ params
438
+ );
439
+ }
440
+
441
+ /**
442
+ * Send an invite to cross-promote.
443
+ *
444
+ * @param scheduler_id The ID of the promotion schedule
445
+ * @param data { partner_scheduler_id, optional_message }
446
+ */
447
+ public static crossPromoteInviteSend<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
448
+ return Requests.processRoute(
449
+ SchedulerRoute.routes.crossPromoteInviteSend,
450
+ data,
451
+ { scheduler_id },
452
+ params
453
+ );
454
+ }
455
+
456
+ /**
457
+ * Accept an invite to cross-promote.
458
+ *
459
+ * @param scheduler_id The ID of the promotion schedule
460
+ * @param invite_id The ID of the invite
461
+ */
462
+ public static crossPromoteInviteAccept<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
463
+ return Requests.processRoute(
464
+ SchedulerRoute.routes.crossPromoteInviteAccept,
465
+ {},
466
+ { scheduler_id, invite_id },
467
+ params
468
+ );
469
+ }
470
+
471
+ /**
472
+ * Reject an invite to cross-promote.
473
+ *
474
+ * @param scheduler_id The ID of the promotion schedule
475
+ * @param invite_id The ID of the invite
476
+ */
477
+ public static crossPromoteInviteReject<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
478
+ return Requests.processRoute(
479
+ SchedulerRoute.routes.crossPromoteInviteReject,
480
+ {},
481
+ { scheduler_id, invite_id },
482
+ params
483
+ );
484
+ }
485
+
486
+ /**
487
+ * End a cross-promote relationship.
488
+ *
489
+ * @param scheduler_id The ID of the promotion schedule
490
+ * @param relationship_id The ID of the relationship
491
+ */
492
+ public static crossPromoteRelationshipDelete<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
493
+ return Requests.processRoute(
494
+ SchedulerRoute.routes.crossPromoteRelationshipDelete,
495
+ {},
496
+ { scheduler_id, relationship_id },
497
+ params
498
+ );
499
+ }
500
+
501
+ /**
502
+ * Get which platforms are cross-promoted in an existing relationship.
503
+ *
504
+ * @param scheduler_id The ID of the promotion schedule
505
+ * @param relationship_id The ID of the relationship
506
+ */
507
+ public static crossPromoteRelationshipGetPlatforms<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
508
+ return Requests.processRoute(
509
+ SchedulerRoute.routes.crossPromoteRelationshipGetPlatforms,
510
+ {},
511
+ { scheduler_id, relationship_id },
512
+ params
513
+ );
514
+ }
515
+
516
+ /**
517
+ * Set which platforms are cross-promoted in an existing relationship.
518
+ *
519
+ * @param scheduler_id The ID of the promotion schedule
520
+ * @param relationship_id The ID of the relationship
521
+ * @param data An object like { platforms: ['twitter', 'facebook', ...] }
522
+ */
523
+ public static crossPromoteRelationshipSetPlatforms<T>(scheduler_id: string, relationship_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
524
+ return Requests.processRoute(
525
+ SchedulerRoute.routes.crossPromoteRelationshipSetPlatforms,
526
+ data,
527
+ { scheduler_id, relationship_id },
528
+ params
529
+ );
530
+ }
531
+
532
+ /**
533
+ * Get recently cross-promoted posts under a relationship.
534
+ *
535
+ * @param scheduler_id The ID of the promotion schedule
536
+ * @param relationship_id The ID of the relationship
537
+ */
538
+ public static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
539
+ return Requests.processRoute(
540
+ SchedulerRoute.routes.crossPromoteRelationshipPosts,
541
+ {},
542
+ { scheduler_id, relationship_id },
543
+ params
544
+ );
545
+ }
546
+
396
547
  }
397
548
 
398
549
  export default Scheduler;
@@ -46,6 +46,63 @@ 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
+ crossPromoteListRelationships: {
50
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships',
51
+ method: HTTP_METHODS.GET
52
+ },
53
+
54
+ // 2) Find potential cross-promote partners
55
+ crossPromoteFind: {
56
+ url: '/schedulers/{scheduler_id}/crosspromote/find',
57
+ method: HTTP_METHODS.GET
58
+ },
59
+
60
+ // 3) List invites
61
+ crossPromoteInvitesList: {
62
+ url: '/schedulers/{scheduler_id}/crosspromote/invites',
63
+ method: HTTP_METHODS.GET
64
+ },
65
+
66
+ // 4) Send an invite to cross-promote
67
+ crossPromoteInviteSend: {
68
+ url: '/schedulers/{scheduler_id}/crosspromote/invites',
69
+ method: HTTP_METHODS.POST
70
+ },
71
+
72
+ // 5) Accept an invite
73
+ crossPromoteInviteAccept: {
74
+ url: '/schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept',
75
+ method: HTTP_METHODS.POST
76
+ },
77
+
78
+ // 6) Reject an invite
79
+ crossPromoteInviteReject: {
80
+ url: '/schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/reject',
81
+ method: HTTP_METHODS.POST
82
+ },
83
+
84
+ // 7) End a cross-promote relationship
85
+ crossPromoteRelationshipDelete: {
86
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}',
87
+ method: HTTP_METHODS.DELETE
88
+ },
89
+
90
+ // 8) Get/Set which platforms are cross-promoted in an existing relationship
91
+ crossPromoteRelationshipGetPlatforms: {
92
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms',
93
+ method: HTTP_METHODS.GET
94
+ },
95
+ crossPromoteRelationshipSetPlatforms: {
96
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms',
97
+ method: HTTP_METHODS.PUT
98
+ },
99
+
100
+ // 9) Get recently cross-promoted posts under a relationship
101
+ crossPromoteRelationshipPosts: {
102
+ url: '/schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts',
103
+ method: HTTP_METHODS.GET
104
+ },
105
+
49
106
  };
50
107
  }
51
108