glitch-javascript-sdk 1.6.4 → 1.6.6

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.
@@ -581,5 +581,18 @@ declare class Communities {
581
581
  * @param params Optional date-range filter (start_date, end_date, etc.)
582
582
  */
583
583
  static newsletterSubscriberTrend<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
584
+ /**
585
+ * Export subscribers for a specific newsletter.
586
+ * The file is generated asynchronously on the server and
587
+ * the user is emailed a link to download the file.
588
+ *
589
+ * @param community_id The ID of the community.
590
+ * @param newsletter_id The ID of the newsletter.
591
+ * @param data Export options (format: 'csv' or 'xlsx').
592
+ * @returns Promise
593
+ */
594
+ static exportNewsletterSubscribers<T>(community_id: string, newsletter_id: string, data: {
595
+ format: 'csv' | 'xlsx';
596
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
584
597
  }
585
598
  export default Communities;
@@ -0,0 +1,19 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Hashtags {
4
+ /**
5
+ * List all the hashtags
6
+ *
7
+ *
8
+ * @returns A promise
9
+ */
10
+ static list<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
11
+ /**
12
+ * Get the top hashtags for a title, campaign, or schedule.
13
+ *
14
+ * @param params - e.g. { title_id: '...', limit: 10, sort: 'sum_views', start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
15
+ * @returns AxiosPromise of an array of aggregated hashtags
16
+ */
17
+ static top<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
18
+ }
19
+ export default Hashtags;
@@ -188,5 +188,16 @@ declare class Titles {
188
188
  * Revoke a specific token by ID.
189
189
  */
190
190
  static revokeTitleToken<T>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
191
+ /**
192
+ * Search for Titles using Meilisearch or fallback based on the query and filters.
193
+ *
194
+ * @see https://api.glitch.fun/api/documentation#/Titles/searchTitles
195
+ *
196
+ * @param params Object of query params:
197
+ * - q?: string, filters?: string,
198
+ * - sort_by?: string, sort_order?: 'asc'|'desc',
199
+ * - page?: number, per_page?: number
200
+ */
201
+ static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
191
202
  }
192
203
  export default Titles;
@@ -29,6 +29,7 @@ import Media from "./Media";
29
29
  import Scheduler from "./Scheduler";
30
30
  import Funnel from "./Funnel";
31
31
  import SocialStats from "./SocialStats";
32
+ import Hashtags from "./Hashtags";
32
33
  export { Auth };
33
34
  export { Competitions };
34
35
  export { Communities };
@@ -60,3 +61,4 @@ export { Media };
60
61
  export { Scheduler };
61
62
  export { Funnel };
62
63
  export { SocialStats };
64
+ export { Hashtags };
@@ -29,6 +29,7 @@ import { Media } from "./api";
29
29
  import { Scheduler } from "./api";
30
30
  import { Funnel } from "./api";
31
31
  import { SocialStats } from "./api";
32
+ import { Hashtags } from "./api";
32
33
  import Requests from "./util/Requests";
33
34
  import Parser from "./util/Parser";
34
35
  import Session from "./util/Session";
@@ -56,6 +57,7 @@ declare class Glitch {
56
57
  Events: typeof Events;
57
58
  Games: typeof Games;
58
59
  GameShows: typeof GameShows;
60
+ Hashtags: typeof Hashtags;
59
61
  Feedback: typeof Feedback;
60
62
  Influencers: typeof Influencers;
61
63
  Teams: typeof Teams;
package/dist/esm/index.js CHANGED
@@ -6634,6 +6634,10 @@ var CommunitiesRoute = /** @class */ (function () {
6634
6634
  url: '/communities/{community_id}/newsletters/{newsletter_id}/reports/subscriber_trend',
6635
6635
  method: HTTP_METHODS.GET
6636
6636
  },
6637
+ exportNewsletterSubscribers: {
6638
+ url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/export',
6639
+ method: HTTP_METHODS.POST
6640
+ },
6637
6641
  // Campaigns
6638
6642
  listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
6639
6643
  createCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.POST },
@@ -7379,6 +7383,19 @@ var Communities = /** @class */ (function () {
7379
7383
  return Requests.processRoute(CommunitiesRoute.routes.newsletterSubscriberTrend, undefined, // no body data
7380
7384
  { community_id: community_id, newsletter_id: newsletter_id }, params);
7381
7385
  };
7386
+ /**
7387
+ * Export subscribers for a specific newsletter.
7388
+ * The file is generated asynchronously on the server and
7389
+ * the user is emailed a link to download the file.
7390
+ *
7391
+ * @param community_id The ID of the community.
7392
+ * @param newsletter_id The ID of the newsletter.
7393
+ * @param data Export options (format: 'csv' or 'xlsx').
7394
+ * @returns Promise
7395
+ */
7396
+ Communities.exportNewsletterSubscribers = function (community_id, newsletter_id, data, params) {
7397
+ return Requests.processRoute(CommunitiesRoute.routes.exportNewsletterSubscribers, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
7398
+ };
7382
7399
  return Communities;
7383
7400
  }());
7384
7401
 
@@ -9605,6 +9622,7 @@ var TitlesRoute = /** @class */ (function () {
9605
9622
  createToken: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.POST },
9606
9623
  listTokens: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.GET },
9607
9624
  revokeToken: { url: '/titles/{title_id}/tokens/{token_id}', method: HTTP_METHODS.DELETE },
9625
+ search: { url: '/titles/search', method: HTTP_METHODS.GET },
9608
9626
  };
9609
9627
  return TitlesRoute;
9610
9628
  }());
@@ -9842,6 +9860,19 @@ var Titles = /** @class */ (function () {
9842
9860
  Titles.revokeTitleToken = function (title_id, token_id) {
9843
9861
  return Requests.processRoute(TitlesRoute.routes.revokeToken, {}, { title_id: title_id, token_id: token_id });
9844
9862
  };
9863
+ /**
9864
+ * Search for Titles using Meilisearch or fallback based on the query and filters.
9865
+ *
9866
+ * @see https://api.glitch.fun/api/documentation#/Titles/searchTitles
9867
+ *
9868
+ * @param params Object of query params:
9869
+ * - q?: string, filters?: string,
9870
+ * - sort_by?: string, sort_order?: 'asc'|'desc',
9871
+ * - page?: number, per_page?: number
9872
+ */
9873
+ Titles.search = function (params) {
9874
+ return Requests.processRoute(TitlesRoute.routes.search, {}, undefined, params);
9875
+ };
9845
9876
  return Titles;
9846
9877
  }());
9847
9878
 
@@ -12085,6 +12116,40 @@ var SocialStats = /** @class */ (function () {
12085
12116
  return SocialStats;
12086
12117
  }());
12087
12118
 
12119
+ var HashtagRoute = /** @class */ (function () {
12120
+ function HashtagRoute() {
12121
+ }
12122
+ HashtagRoute.routes = {
12123
+ list: { url: '/hashtags', method: HTTP_METHODS.GET },
12124
+ top: { url: '/hashtags/top', method: HTTP_METHODS.GET },
12125
+ };
12126
+ return HashtagRoute;
12127
+ }());
12128
+
12129
+ var Hashtags = /** @class */ (function () {
12130
+ function Hashtags() {
12131
+ }
12132
+ /**
12133
+ * List all the hashtags
12134
+ *
12135
+ *
12136
+ * @returns A promise
12137
+ */
12138
+ Hashtags.list = function (data, params) {
12139
+ return Requests.processRoute(HashtagRoute.routes.list, data, {}, params);
12140
+ };
12141
+ /**
12142
+ * Get the top hashtags for a title, campaign, or schedule.
12143
+ *
12144
+ * @param params - e.g. { title_id: '...', limit: 10, sort: 'sum_views', start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
12145
+ * @returns AxiosPromise of an array of aggregated hashtags
12146
+ */
12147
+ Hashtags.top = function (data, params) {
12148
+ return Requests.processRoute(HashtagRoute.routes.list, data, {}, params);
12149
+ };
12150
+ return Hashtags;
12151
+ }());
12152
+
12088
12153
  var Parser = /** @class */ (function () {
12089
12154
  function Parser() {
12090
12155
  }
@@ -12490,6 +12555,7 @@ var Glitch = /** @class */ (function () {
12490
12555
  Events: Events,
12491
12556
  Games: Games,
12492
12557
  GameShows: GameShows,
12558
+ Hashtags: Hashtags,
12493
12559
  Feedback: Feedback,
12494
12560
  Influencers: Influencers,
12495
12561
  Teams: Teams,