glitch-javascript-sdk 1.7.1 → 1.7.3

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,58 @@ 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
+ * 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>>;
4443
+ /**
4444
+ * List cross-promote invitations for a scheduler.
4445
+ * Expects a query param `scheduler_id`
4446
+ */
4447
+ static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4448
+ /**
4449
+ * Send an invite to cross-promote.
4450
+ * Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
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>>;
4456
+ /**
4457
+ * Respond to an invitation (accept or deny).
4458
+ */
4459
+ static crossPromoteInviteRespond<T>(invitation_id: string, data: {
4460
+ status: 'accepted' | 'denied';
4461
+ platforms?: string[];
4462
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4463
+ /**
4464
+ * List cross-promote relationships for a scheduler.
4465
+ * Expects a query param `scheduler_id`
4466
+ */
4467
+ static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4468
+ /**
4469
+ * End a cross-promote relationship.
4470
+ */
4471
+ static crossPromoteEndRelationship<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4472
+ /**
4473
+ * List logs for a cross-promote relationship.
4474
+ */
4475
+ static crossPromoteListLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4476
+ /**
4477
+ * Get which platforms are cross-promoted in an existing relationship.
4478
+ */
4479
+ static crossPromoteRelationshipGetPlatforms<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4480
+ /**
4481
+ * Set which platforms are cross-promoted in an existing relationship.
4482
+ */
4483
+ static crossPromoteRelationshipSetPlatforms<T>(relationship_id: string, data: {
4484
+ platforms: string[];
4485
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4486
+ /**
4487
+ * Get recently cross-promoted posts under a relationship.
4488
+ */
4489
+ static crossPromoteRelationshipPosts<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4438
4490
  }
4439
4491
 
4440
4492
  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.3",
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,88 @@ class Scheduler {
393
393
  return Requests.processRoute(SchedulerRoute.routes.getSchedulerProgression, {}, { scheduler_id }, params);
394
394
  }
395
395
 
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);
403
+ }
404
+
405
+ /**
406
+ * List cross-promote invitations for a scheduler.
407
+ * Expects a query param `scheduler_id`
408
+ */
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);
412
+ }
413
+
414
+ /**
415
+ * Send an invite to cross-promote.
416
+ * Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
417
+ */
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);
425
+ }
426
+
427
+ /**
428
+ * Respond to an invitation (accept or deny).
429
+ */
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);
432
+ }
433
+
434
+ /**
435
+ * List cross-promote relationships for a scheduler.
436
+ * Expects a query param `scheduler_id`
437
+ */
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);
441
+ }
442
+
443
+ /**
444
+ * End a cross-promote relationship.
445
+ */
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);
448
+ }
449
+
450
+ /**
451
+ * List logs for a cross-promote relationship.
452
+ */
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);
455
+ }
456
+
457
+ /**
458
+ * Get which platforms are cross-promoted in an existing relationship.
459
+ */
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);
462
+ }
463
+
464
+ /**
465
+ * Set which platforms are cross-promoted in an existing relationship.
466
+ */
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);
469
+ }
470
+
471
+ /**
472
+ * Get recently cross-promoted posts under a relationship.
473
+ */
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);
476
+ }
477
+
396
478
  }
397
479
 
398
480
  export default Scheduler;
@@ -46,6 +46,47 @@ 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',
51
+ method: HTTP_METHODS.GET
52
+ },
53
+ crossPromoteInvitesList: {
54
+ url: '/schedulers/cross-promote/invitations',
55
+ method: HTTP_METHODS.GET
56
+ },
57
+ crossPromoteInviteSend: {
58
+ url: '/schedulers/cross-promote/invitations',
59
+ method: HTTP_METHODS.POST
60
+ },
61
+ crossPromoteInviteRespond: {
62
+ url: '/schedulers/cross-promote/invitations/{invitation_id}/respond',
63
+ method: HTTP_METHODS.POST
64
+ },
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',
71
+ method: HTTP_METHODS.POST
72
+ },
73
+ crossPromoteListLogs: {
74
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/logs',
75
+ method: HTTP_METHODS.GET
76
+ },
77
+ crossPromoteRelationshipGetPlatforms: {
78
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
79
+ method: HTTP_METHODS.GET
80
+ },
81
+ crossPromoteRelationshipSetPlatforms: {
82
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/platforms',
83
+ method: HTTP_METHODS.PUT
84
+ },
85
+ crossPromoteRelationshipPosts: {
86
+ url: '/schedulers/cross-promote/relationships/{relationship_id}/posts',
87
+ method: HTTP_METHODS.GET
88
+ },
89
+
49
90
  };
50
91
  }
51
92