glitch-javascript-sdk 1.7.3 → 1.7.5

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
@@ -1236,6 +1236,17 @@ declare class Communities {
1236
1236
  static exportNewsletterSubscribers<T>(community_id: string, newsletter_id: string, data: {
1237
1237
  format: 'csv' | 'xlsx';
1238
1238
  }, params?: Record<string, any>): AxiosPromise<Response<T>>;
1239
+ /**
1240
+ * Import game installs from a game title installations to a newsletter
1241
+ *
1242
+ * @param community_id The ID of the community.
1243
+ * @param newsletter_id The ID of the newsletter.
1244
+ * @param data Export options (format: 'csv' or 'xlsx').
1245
+ * @returns Promise
1246
+ */
1247
+ static importGameInstalls<T>(community_id: string, newsletter_id: string, data: {
1248
+ format: 'csv' | 'xlsx';
1249
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
1239
1250
  }
1240
1251
 
1241
1252
  declare class Users {
@@ -4436,57 +4447,58 @@ declare class Scheduler {
4436
4447
  */
4437
4448
  static getSchedulerProgression<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4438
4449
  /**
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>>;
4450
+ * List cross-promote relationships for a scheduler (with optional pagination).
4451
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships
4452
+ */
4453
+ static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4443
4454
  /**
4444
- * List cross-promote invitations for a scheduler.
4445
- * Expects a query param `scheduler_id`
4455
+ * Find potential cross-promote partners for a scheduler (with optional filters).
4456
+ * GET /schedulers/{scheduler_id}/crosspromote/find
4446
4457
  */
4447
- static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4458
+ static crossPromoteFind<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4448
4459
  /**
4449
- * Send an invite to cross-promote.
4450
- * Converts `partner_scheduler_id` and `optional_message` into the PHP expected fields.
4460
+ * List cross-promote invites for a scheduler (incoming + outgoing).
4461
+ * GET /schedulers/{scheduler_id}/crosspromote/invites
4451
4462
  */
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>>;
4463
+ static crossPromoteInvitesList<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4456
4464
  /**
4457
- * Respond to an invitation (accept or deny).
4465
+ * Send an invite to cross-promote (from scheduler_id to partner_scheduler_id).
4466
+ * POST /schedulers/{scheduler_id}/crosspromote/invites
4467
+ *
4468
+ * @param data { partner_scheduler_id, optional_message }
4458
4469
  */
4459
- static crossPromoteInviteRespond<T>(invitation_id: string, data: {
4460
- status: 'accepted' | 'denied';
4461
- platforms?: string[];
4462
- }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4470
+ static crossPromoteInviteSend<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4463
4471
  /**
4464
- * List cross-promote relationships for a scheduler.
4465
- * Expects a query param `scheduler_id`
4472
+ * Accept an invite to cross-promote.
4473
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/accept
4466
4474
  */
4467
- static crossPromoteListRelationships<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4475
+ static crossPromoteInviteAccept<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4468
4476
  /**
4469
- * End a cross-promote relationship.
4477
+ * Reject an invite to cross-promote.
4478
+ * POST /schedulers/{scheduler_id}/crosspromote/invites/{invite_id}/reject
4470
4479
  */
4471
- static crossPromoteEndRelationship<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4480
+ static crossPromoteInviteReject<T>(scheduler_id: string, invite_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4472
4481
  /**
4473
- * List logs for a cross-promote relationship.
4482
+ * End a cross-promote relationship (delete).
4483
+ * DELETE /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}
4474
4484
  */
4475
- static crossPromoteListLogs<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4485
+ static crossPromoteRelationshipDelete<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4476
4486
  /**
4477
4487
  * Get which platforms are cross-promoted in an existing relationship.
4488
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
4478
4489
  */
4479
- static crossPromoteRelationshipGetPlatforms<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4490
+ static crossPromoteRelationshipGetPlatforms<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4480
4491
  /**
4481
4492
  * Set which platforms are cross-promoted in an existing relationship.
4493
+ * PUT /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/platforms
4494
+ * data = { platforms: ['twitter','facebook',...]}
4482
4495
  */
4483
- static crossPromoteRelationshipSetPlatforms<T>(relationship_id: string, data: {
4484
- platforms: string[];
4485
- }, params?: Record<string, any>): AxiosPromise<Response<T>>;
4496
+ static crossPromoteRelationshipSetPlatforms<T>(scheduler_id: string, relationship_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4486
4497
  /**
4487
- * Get recently cross-promoted posts under a relationship.
4498
+ * Get recently cross-promoted logs under a relationship.
4499
+ * GET /schedulers/{scheduler_id}/crosspromote/relationships/{relationship_id}/posts
4488
4500
  */
4489
- static crossPromoteRelationshipPosts<T>(relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4501
+ static crossPromoteRelationshipPosts<T>(scheduler_id: string, relationship_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4490
4502
  }
4491
4503
 
4492
4504
  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.5",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -860,19 +860,41 @@ class Communities {
860
860
  * @param data Export options (format: 'csv' or 'xlsx').
861
861
  * @returns Promise
862
862
  */
863
- public static exportNewsletterSubscribers<T>(
864
- community_id: string,
865
- newsletter_id: string,
866
- data: { format: 'csv' | 'xlsx' },
867
- params?: Record<string, any>
868
- ): AxiosPromise<Response<T>> {
869
- return Requests.processRoute(
870
- CommunitiesRoute.routes.exportNewsletterSubscribers,
871
- data,
872
- { community_id, newsletter_id },
873
- params
874
- );
875
- }
863
+ public static exportNewsletterSubscribers<T>(
864
+ community_id: string,
865
+ newsletter_id: string,
866
+ data: { format: 'csv' | 'xlsx' },
867
+ params?: Record<string, any>
868
+ ): AxiosPromise<Response<T>> {
869
+ return Requests.processRoute(
870
+ CommunitiesRoute.routes.exportNewsletterSubscribers,
871
+ data,
872
+ { community_id, newsletter_id },
873
+ params
874
+ );
875
+ }
876
+
877
+ /**
878
+ * Import game installs from a game title installations to a newsletter
879
+ *
880
+ * @param community_id The ID of the community.
881
+ * @param newsletter_id The ID of the newsletter.
882
+ * @param data Export options (format: 'csv' or 'xlsx').
883
+ * @returns Promise
884
+ */
885
+ public static importGameInstalls<T>(
886
+ community_id: string,
887
+ newsletter_id: string,
888
+ data: { format: 'csv' | 'xlsx' },
889
+ params?: Record<string, any>
890
+ ): AxiosPromise<Response<T>> {
891
+ return Requests.processRoute(
892
+ CommunitiesRoute.routes.importGameInstalls,
893
+ data,
894
+ { community_id, newsletter_id },
895
+ params
896
+ );
897
+ }
876
898
 
877
899
 
878
900
  }
@@ -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
  }
@@ -63,6 +63,10 @@ class CommunitiesRoute {
63
63
  url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/export',
64
64
  method: HTTP_METHODS.POST
65
65
  },
66
+ importGameInstalls: {
67
+ url: '/communities/{community_id}/newsletters/{newsletter_id}/import_game_installs',
68
+ method: HTTP_METHODS.POST
69
+ },
66
70
 
67
71
  // Campaigns
68
72
  listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
@@ -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