glitch-javascript-sdk 1.6.5 → 1.6.7

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.
@@ -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;
@@ -127,5 +127,13 @@ declare class SocialPosts {
127
127
  * @returns promise
128
128
  */
129
129
  static updatePostImpressions<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
130
+ /**
131
+ * Get reports on all the the short links
132
+ *
133
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
134
+ *
135
+ * @returns promise
136
+ */
137
+ static shortLinkReports<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
130
138
  }
131
139
  export default SocialPosts;
@@ -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
@@ -9437,6 +9437,7 @@ var SocialPostsRoute = /** @class */ (function () {
9437
9437
  reschedule: { url: '/socialposts/{post_id}/reschedule', method: HTTP_METHODS.POST },
9438
9438
  reports: { url: '/socialposts/{post_id}/reports', method: HTTP_METHODS.GET },
9439
9439
  updatePostImpressions: { url: '/socialposts/{post_id}/impressions', method: HTTP_METHODS.PUT },
9440
+ shortLinkReports: { url: '/socialposts/shortlinks/reports', method: HTTP_METHODS.GET },
9440
9441
  };
9441
9442
  return SocialPostsRoute;
9442
9443
  }());
@@ -9596,6 +9597,16 @@ var SocialPosts = /** @class */ (function () {
9596
9597
  SocialPosts.updatePostImpressions = function (post_id, data, params) {
9597
9598
  return Requests.processRoute(SocialPostsRoute.routes.updatePostImpressions, data, { post_id: post_id }, params);
9598
9599
  };
9600
+ /**
9601
+ * Get reports on all the the short links
9602
+ *
9603
+ * @see https://api.glitch.fun/api/documentation#/Post%20Route/resourcePostList
9604
+ *
9605
+ * @returns promise
9606
+ */
9607
+ SocialPosts.shortLinkReports = function (params) {
9608
+ return Requests.processRoute(SocialPostsRoute.routes.shortLinkReports, undefined, undefined, params);
9609
+ };
9599
9610
  return SocialPosts;
9600
9611
  }());
9601
9612
 
@@ -9622,6 +9633,7 @@ var TitlesRoute = /** @class */ (function () {
9622
9633
  createToken: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.POST },
9623
9634
  listTokens: { url: '/titles/{title_id}/tokens', method: HTTP_METHODS.GET },
9624
9635
  revokeToken: { url: '/titles/{title_id}/tokens/{token_id}', method: HTTP_METHODS.DELETE },
9636
+ search: { url: '/titles/search', method: HTTP_METHODS.GET },
9625
9637
  };
9626
9638
  return TitlesRoute;
9627
9639
  }());
@@ -9859,6 +9871,19 @@ var Titles = /** @class */ (function () {
9859
9871
  Titles.revokeTitleToken = function (title_id, token_id) {
9860
9872
  return Requests.processRoute(TitlesRoute.routes.revokeToken, {}, { title_id: title_id, token_id: token_id });
9861
9873
  };
9874
+ /**
9875
+ * Search for Titles using Meilisearch or fallback based on the query and filters.
9876
+ *
9877
+ * @see https://api.glitch.fun/api/documentation#/Titles/searchTitles
9878
+ *
9879
+ * @param params Object of query params:
9880
+ * - q?: string, filters?: string,
9881
+ * - sort_by?: string, sort_order?: 'asc'|'desc',
9882
+ * - page?: number, per_page?: number
9883
+ */
9884
+ Titles.search = function (params) {
9885
+ return Requests.processRoute(TitlesRoute.routes.search, {}, undefined, params);
9886
+ };
9862
9887
  return Titles;
9863
9888
  }());
9864
9889
 
@@ -12102,6 +12127,40 @@ var SocialStats = /** @class */ (function () {
12102
12127
  return SocialStats;
12103
12128
  }());
12104
12129
 
12130
+ var HashtagRoute = /** @class */ (function () {
12131
+ function HashtagRoute() {
12132
+ }
12133
+ HashtagRoute.routes = {
12134
+ list: { url: '/hashtags', method: HTTP_METHODS.GET },
12135
+ top: { url: '/hashtags/top', method: HTTP_METHODS.GET },
12136
+ };
12137
+ return HashtagRoute;
12138
+ }());
12139
+
12140
+ var Hashtags = /** @class */ (function () {
12141
+ function Hashtags() {
12142
+ }
12143
+ /**
12144
+ * List all the hashtags
12145
+ *
12146
+ *
12147
+ * @returns A promise
12148
+ */
12149
+ Hashtags.list = function (data, params) {
12150
+ return Requests.processRoute(HashtagRoute.routes.list, data, {}, params);
12151
+ };
12152
+ /**
12153
+ * Get the top hashtags for a title, campaign, or schedule.
12154
+ *
12155
+ * @param params - e.g. { title_id: '...', limit: 10, sort: 'sum_views', start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
12156
+ * @returns AxiosPromise of an array of aggregated hashtags
12157
+ */
12158
+ Hashtags.top = function (data, params) {
12159
+ return Requests.processRoute(HashtagRoute.routes.top, data, {}, params);
12160
+ };
12161
+ return Hashtags;
12162
+ }());
12163
+
12105
12164
  var Parser = /** @class */ (function () {
12106
12165
  function Parser() {
12107
12166
  }
@@ -12507,6 +12566,7 @@ var Glitch = /** @class */ (function () {
12507
12566
  Events: Events,
12508
12567
  Games: Games,
12509
12568
  GameShows: GameShows,
12569
+ Hashtags: Hashtags,
12510
12570
  Feedback: Feedback,
12511
12571
  Influencers: Influencers,
12512
12572
  Teams: Teams,