@relayapi/sdk 0.2.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.
Files changed (242) hide show
  1. package/dist/api-promise.d.ts +2 -0
  2. package/dist/api-promise.js +18 -0
  3. package/dist/client.d.ts +225 -0
  4. package/dist/client.js +552 -0
  5. package/dist/core/api-promise.d.ts +45 -0
  6. package/dist/core/api-promise.js +83 -0
  7. package/dist/core/error.d.ts +45 -0
  8. package/dist/core/error.js +112 -0
  9. package/dist/core/resource.d.ts +5 -0
  10. package/dist/core/resource.js +10 -0
  11. package/dist/core/uploads.d.ts +2 -0
  12. package/dist/core/uploads.js +5 -0
  13. package/dist/error.d.ts +2 -0
  14. package/dist/error.js +18 -0
  15. package/dist/index.d.ts +5 -0
  16. package/dist/index.js +26 -0
  17. package/dist/internal/builtin-types.d.ts +72 -0
  18. package/dist/internal/builtin-types.js +3 -0
  19. package/dist/internal/detect-platform.d.ts +14 -0
  20. package/dist/internal/detect-platform.js +161 -0
  21. package/dist/internal/errors.d.ts +2 -0
  22. package/dist/internal/errors.js +40 -0
  23. package/dist/internal/headers.d.ts +19 -0
  24. package/dist/internal/headers.js +78 -0
  25. package/dist/internal/parse.d.ts +11 -0
  26. package/dist/internal/parse.js +39 -0
  27. package/dist/internal/request-options.d.ts +74 -0
  28. package/dist/internal/request-options.js +13 -0
  29. package/dist/internal/shim-types.d.ts +16 -0
  30. package/dist/internal/shim-types.js +3 -0
  31. package/dist/internal/shims.d.ts +23 -0
  32. package/dist/internal/shims.js +90 -0
  33. package/dist/internal/to-file.d.ts +44 -0
  34. package/dist/internal/to-file.js +90 -0
  35. package/dist/internal/types.d.ts +68 -0
  36. package/dist/internal/types.js +3 -0
  37. package/dist/internal/uploads.d.ts +41 -0
  38. package/dist/internal/uploads.js +140 -0
  39. package/dist/internal/utils/base64.d.ts +2 -0
  40. package/dist/internal/utils/base64.js +37 -0
  41. package/dist/internal/utils/bytes.d.ts +3 -0
  42. package/dist/internal/utils/bytes.js +30 -0
  43. package/dist/internal/utils/env.d.ts +8 -0
  44. package/dist/internal/utils/env.js +21 -0
  45. package/dist/internal/utils/log.d.ts +36 -0
  46. package/dist/internal/utils/log.js +84 -0
  47. package/dist/internal/utils/path.d.ts +14 -0
  48. package/dist/internal/utils/path.js +78 -0
  49. package/dist/internal/utils/query.d.ts +4 -0
  50. package/dist/internal/utils/query.js +22 -0
  51. package/dist/internal/utils/sleep.d.ts +1 -0
  52. package/dist/internal/utils/sleep.js +6 -0
  53. package/dist/internal/utils/uuid.d.ts +4 -0
  54. package/dist/internal/utils/uuid.js +18 -0
  55. package/dist/internal/utils/values.d.ts +17 -0
  56. package/dist/internal/utils/values.js +111 -0
  57. package/dist/internal/utils.d.ts +7 -0
  58. package/dist/internal/utils.js +24 -0
  59. package/dist/resource.d.ts +2 -0
  60. package/dist/resource.js +18 -0
  61. package/dist/resources/account-groups.d.ts +52 -0
  62. package/dist/resources/account-groups.js +37 -0
  63. package/dist/resources/accounts/accounts.d.ts +148 -0
  64. package/dist/resources/accounts/accounts.js +101 -0
  65. package/dist/resources/accounts/facebook-pages.d.ts +48 -0
  66. package/dist/resources/accounts/facebook-pages.js +21 -0
  67. package/dist/resources/accounts/gmb-locations.d.ts +48 -0
  68. package/dist/resources/accounts/gmb-locations.js +21 -0
  69. package/dist/resources/accounts/health.d.ts +49 -0
  70. package/dist/resources/accounts/health.js +21 -0
  71. package/dist/resources/accounts/index.d.ts +8 -0
  72. package/dist/resources/accounts/index.js +20 -0
  73. package/dist/resources/accounts/linkedin-organizations.d.ts +52 -0
  74. package/dist/resources/accounts/linkedin-organizations.js +21 -0
  75. package/dist/resources/accounts/pinterest-boards.d.ts +48 -0
  76. package/dist/resources/accounts/pinterest-boards.js +21 -0
  77. package/dist/resources/accounts/reddit-flairs.d.ts +27 -0
  78. package/dist/resources/accounts/reddit-flairs.js +15 -0
  79. package/dist/resources/accounts/reddit-subreddits.d.ts +48 -0
  80. package/dist/resources/accounts/reddit-subreddits.js +21 -0
  81. package/dist/resources/accounts.d.ts +1 -0
  82. package/dist/resources/accounts.js +18 -0
  83. package/dist/resources/analytics/analytics.d.ts +369 -0
  84. package/dist/resources/analytics/analytics.js +84 -0
  85. package/dist/resources/analytics/index.d.ts +2 -0
  86. package/dist/resources/analytics/index.js +8 -0
  87. package/dist/resources/analytics/youtube.d.ts +49 -0
  88. package/dist/resources/analytics/youtube.js +14 -0
  89. package/dist/resources/analytics.d.ts +1 -0
  90. package/dist/resources/analytics.js +18 -0
  91. package/dist/resources/api-keys.d.ts +110 -0
  92. package/dist/resources/api-keys.js +32 -0
  93. package/dist/resources/connect/connect.d.ts +188 -0
  94. package/dist/resources/connect/connect.js +97 -0
  95. package/dist/resources/connect/facebook/facebook.d.ts +9 -0
  96. package/dist/resources/connect/facebook/facebook.js +48 -0
  97. package/dist/resources/connect/facebook/index.d.ts +2 -0
  98. package/dist/resources/connect/facebook/index.js +8 -0
  99. package/dist/resources/connect/facebook/pages.d.ts +70 -0
  100. package/dist/resources/connect/facebook/pages.js +20 -0
  101. package/dist/resources/connect/facebook.d.ts +1 -0
  102. package/dist/resources/connect/facebook.js +18 -0
  103. package/dist/resources/connect/googlebusiness/googlebusiness.d.ts +9 -0
  104. package/dist/resources/connect/googlebusiness/googlebusiness.js +48 -0
  105. package/dist/resources/connect/googlebusiness/index.d.ts +2 -0
  106. package/dist/resources/connect/googlebusiness/index.js +8 -0
  107. package/dist/resources/connect/googlebusiness/locations.d.ts +70 -0
  108. package/dist/resources/connect/googlebusiness/locations.js +20 -0
  109. package/dist/resources/connect/googlebusiness.d.ts +1 -0
  110. package/dist/resources/connect/googlebusiness.js +18 -0
  111. package/dist/resources/connect/index.d.ts +8 -0
  112. package/dist/resources/connect/index.js +20 -0
  113. package/dist/resources/connect/linkedin/index.d.ts +2 -0
  114. package/dist/resources/connect/linkedin/index.js +8 -0
  115. package/dist/resources/connect/linkedin/linkedin.d.ts +9 -0
  116. package/dist/resources/connect/linkedin/linkedin.js +48 -0
  117. package/dist/resources/connect/linkedin/organizations.d.ts +85 -0
  118. package/dist/resources/connect/linkedin/organizations.js +20 -0
  119. package/dist/resources/connect/linkedin.d.ts +1 -0
  120. package/dist/resources/connect/linkedin.js +18 -0
  121. package/dist/resources/connect/pinterest/boards.d.ts +70 -0
  122. package/dist/resources/connect/pinterest/boards.js +20 -0
  123. package/dist/resources/connect/pinterest/index.d.ts +2 -0
  124. package/dist/resources/connect/pinterest/index.js +8 -0
  125. package/dist/resources/connect/pinterest/pinterest.d.ts +9 -0
  126. package/dist/resources/connect/pinterest/pinterest.js +48 -0
  127. package/dist/resources/connect/pinterest.d.ts +1 -0
  128. package/dist/resources/connect/pinterest.js +18 -0
  129. package/dist/resources/connect/snapchat/index.d.ts +2 -0
  130. package/dist/resources/connect/snapchat/index.js +8 -0
  131. package/dist/resources/connect/snapchat/profiles.d.ts +74 -0
  132. package/dist/resources/connect/snapchat/profiles.js +20 -0
  133. package/dist/resources/connect/snapchat/snapchat.d.ts +9 -0
  134. package/dist/resources/connect/snapchat/snapchat.js +48 -0
  135. package/dist/resources/connect/snapchat.d.ts +1 -0
  136. package/dist/resources/connect/snapchat.js +18 -0
  137. package/dist/resources/connect/telegram.d.ts +122 -0
  138. package/dist/resources/connect/telegram.js +26 -0
  139. package/dist/resources/connect/whatsapp.d.ts +92 -0
  140. package/dist/resources/connect/whatsapp.js +26 -0
  141. package/dist/resources/connect.d.ts +1 -0
  142. package/dist/resources/connect.js +18 -0
  143. package/dist/resources/connections.d.ts +55 -0
  144. package/dist/resources/connections.js +14 -0
  145. package/dist/resources/inbox/comments/comments.d.ts +220 -0
  146. package/dist/resources/inbox/comments/comments.js +83 -0
  147. package/dist/resources/inbox/comments/hide.d.ts +36 -0
  148. package/dist/resources/inbox/comments/hide.js +21 -0
  149. package/dist/resources/inbox/comments/index.d.ts +3 -0
  150. package/dist/resources/inbox/comments/index.js +10 -0
  151. package/dist/resources/inbox/comments/like.d.ts +36 -0
  152. package/dist/resources/inbox/comments/like.js +21 -0
  153. package/dist/resources/inbox/comments.d.ts +1 -0
  154. package/dist/resources/inbox/comments.js +18 -0
  155. package/dist/resources/inbox/inbox.d.ts +17 -0
  156. package/dist/resources/inbox/inbox.js +56 -0
  157. package/dist/resources/inbox/index.d.ts +4 -0
  158. package/dist/resources/inbox/index.js +12 -0
  159. package/dist/resources/inbox/messages.d.ts +205 -0
  160. package/dist/resources/inbox/messages.js +40 -0
  161. package/dist/resources/inbox/reviews/index.d.ts +2 -0
  162. package/dist/resources/inbox/reviews/index.js +8 -0
  163. package/dist/resources/inbox/reviews/reply.d.ts +38 -0
  164. package/dist/resources/inbox/reviews/reply.js +21 -0
  165. package/dist/resources/inbox/reviews/reviews.d.ts +76 -0
  166. package/dist/resources/inbox/reviews/reviews.js +54 -0
  167. package/dist/resources/inbox/reviews.d.ts +1 -0
  168. package/dist/resources/inbox/reviews.js +18 -0
  169. package/dist/resources/inbox.d.ts +1 -0
  170. package/dist/resources/inbox.js +18 -0
  171. package/dist/resources/index.d.ts +16 -0
  172. package/dist/resources/index.js +36 -0
  173. package/dist/resources/media.d.ts +177 -0
  174. package/dist/resources/media.js +51 -0
  175. package/dist/resources/posts/index.d.ts +2 -0
  176. package/dist/resources/posts/index.js +8 -0
  177. package/dist/resources/posts/logs.d.ts +134 -0
  178. package/dist/resources/posts/logs.js +31 -0
  179. package/dist/resources/posts/posts.d.ts +607 -0
  180. package/dist/resources/posts/posts.js +149 -0
  181. package/dist/resources/posts.d.ts +1 -0
  182. package/dist/resources/posts.js +18 -0
  183. package/dist/resources/queue/index.d.ts +2 -0
  184. package/dist/resources/queue/index.js +8 -0
  185. package/dist/resources/queue/queue.d.ts +42 -0
  186. package/dist/resources/queue/queue.js +60 -0
  187. package/dist/resources/queue/slots.d.ts +215 -0
  188. package/dist/resources/queue/slots.js +36 -0
  189. package/dist/resources/queue.d.ts +1 -0
  190. package/dist/resources/queue.js +18 -0
  191. package/dist/resources/reddit.d.ts +186 -0
  192. package/dist/resources/reddit.js +20 -0
  193. package/dist/resources/tools/index.d.ts +3 -0
  194. package/dist/resources/tools/index.js +10 -0
  195. package/dist/resources/tools/instagram.d.ts +41 -0
  196. package/dist/resources/tools/instagram.js +22 -0
  197. package/dist/resources/tools/tools.d.ts +13 -0
  198. package/dist/resources/tools/tools.js +52 -0
  199. package/dist/resources/tools/validate.d.ts +689 -0
  200. package/dist/resources/tools/validate.js +63 -0
  201. package/dist/resources/tools.d.ts +1 -0
  202. package/dist/resources/tools.js +18 -0
  203. package/dist/resources/twitter/bookmark.d.ts +48 -0
  204. package/dist/resources/twitter/bookmark.js +20 -0
  205. package/dist/resources/twitter/follow.d.ts +48 -0
  206. package/dist/resources/twitter/follow.js +20 -0
  207. package/dist/resources/twitter/index.d.ts +4 -0
  208. package/dist/resources/twitter/index.js +12 -0
  209. package/dist/resources/twitter/retweet.d.ts +48 -0
  210. package/dist/resources/twitter/retweet.js +20 -0
  211. package/dist/resources/twitter/twitter.d.ts +17 -0
  212. package/dist/resources/twitter/twitter.js +56 -0
  213. package/dist/resources/twitter.d.ts +1 -0
  214. package/dist/resources/twitter.js +18 -0
  215. package/dist/resources/usage.d.ts +97 -0
  216. package/dist/resources/usage.js +14 -0
  217. package/dist/resources/webhooks.d.ts +205 -0
  218. package/dist/resources/webhooks.js +50 -0
  219. package/dist/resources/whatsapp/broadcasts.d.ts +291 -0
  220. package/dist/resources/whatsapp/broadcasts.js +49 -0
  221. package/dist/resources/whatsapp/business-profile.d.ts +85 -0
  222. package/dist/resources/whatsapp/business-profile.js +20 -0
  223. package/dist/resources/whatsapp/contacts.d.ts +250 -0
  224. package/dist/resources/whatsapp/contacts.js +49 -0
  225. package/dist/resources/whatsapp/groups.d.ts +87 -0
  226. package/dist/resources/whatsapp/groups.js +31 -0
  227. package/dist/resources/whatsapp/index.d.ts +6 -0
  228. package/dist/resources/whatsapp/index.js +16 -0
  229. package/dist/resources/whatsapp/templates.d.ts +250 -0
  230. package/dist/resources/whatsapp/templates.js +39 -0
  231. package/dist/resources/whatsapp/whatsapp.d.ts +148 -0
  232. package/dist/resources/whatsapp/whatsapp.js +76 -0
  233. package/dist/resources/whatsapp.d.ts +1 -0
  234. package/dist/resources/whatsapp.js +18 -0
  235. package/dist/resources.d.ts +1 -0
  236. package/dist/resources.js +17 -0
  237. package/dist/uploads.d.ts +2 -0
  238. package/dist/uploads.js +18 -0
  239. package/dist/version.d.ts +1 -0
  240. package/dist/version.js +5 -0
  241. package/package.json +28 -0
  242. package/src/index.ts +22 -0
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PinterestBoards = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const path_1 = require("../../internal/utils/path");
7
+ class PinterestBoards extends resource_1.APIResource {
8
+ /**
9
+ * Fetch Pinterest boards for an account
10
+ */
11
+ retrieve(id, options) {
12
+ return this._client.get((0, path_1.path) `/v1/accounts/${id}/pinterest-boards`, options);
13
+ }
14
+ /**
15
+ * Set default Pinterest board
16
+ */
17
+ setDefault(id, body, options) {
18
+ return this._client.put((0, path_1.path) `/v1/accounts/${id}/pinterest-boards`, { body, ...options });
19
+ }
20
+ }
21
+ exports.PinterestBoards = PinterestBoards;
@@ -0,0 +1,27 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class RedditFlairs extends APIResource {
5
+ /**
6
+ * Fetch Reddit flairs for a subreddit
7
+ */
8
+ retrieve(id: string, query: RedditFlairRetrieveParams, options?: RequestOptions): APIPromise<RedditFlairRetrieveResponse>;
9
+ }
10
+ export interface RedditFlairRetrieveResponse {
11
+ data: Array<RedditFlairRetrieveResponse.Data>;
12
+ }
13
+ export declare namespace RedditFlairRetrieveResponse {
14
+ interface Data {
15
+ id: string;
16
+ text: string;
17
+ }
18
+ }
19
+ export interface RedditFlairRetrieveParams {
20
+ /**
21
+ * Subreddit name
22
+ */
23
+ subreddit: string;
24
+ }
25
+ export declare namespace RedditFlairs {
26
+ export { type RedditFlairRetrieveResponse as RedditFlairRetrieveResponse, type RedditFlairRetrieveParams as RedditFlairRetrieveParams, };
27
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RedditFlairs = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const path_1 = require("../../internal/utils/path");
7
+ class RedditFlairs extends resource_1.APIResource {
8
+ /**
9
+ * Fetch Reddit flairs for a subreddit
10
+ */
11
+ retrieve(id, query, options) {
12
+ return this._client.get((0, path_1.path) `/v1/accounts/${id}/reddit-flairs`, { query, ...options });
13
+ }
14
+ }
15
+ exports.RedditFlairs = RedditFlairs;
@@ -0,0 +1,48 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class RedditSubreddits extends APIResource {
5
+ /**
6
+ * Fetch Reddit subreddits for an account
7
+ */
8
+ retrieve(id: string, options?: RequestOptions): APIPromise<RedditSubredditRetrieveResponse>;
9
+ /**
10
+ * Set default Reddit subreddit
11
+ */
12
+ setDefault(id: string, body: RedditSubredditSetDefaultParams, options?: RequestOptions): APIPromise<RedditSubredditSetDefaultResponse>;
13
+ }
14
+ export interface RedditSubredditRetrieveResponse {
15
+ data: Array<RedditSubredditRetrieveResponse.Data>;
16
+ }
17
+ export declare namespace RedditSubredditRetrieveResponse {
18
+ interface Data {
19
+ display_name: string;
20
+ name: string;
21
+ subscribers: number | null;
22
+ }
23
+ }
24
+ export interface RedditSubredditSetDefaultResponse {
25
+ /**
26
+ * Account ID
27
+ */
28
+ id: string;
29
+ avatar_url: string | null;
30
+ connected_at: string;
31
+ display_name: string | null;
32
+ metadata: {
33
+ [key: string]: unknown;
34
+ } | null;
35
+ platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
36
+ platform_account_id: string;
37
+ updated_at: string;
38
+ username: string | null;
39
+ }
40
+ export interface RedditSubredditSetDefaultParams {
41
+ /**
42
+ * Subreddit name to set as default
43
+ */
44
+ subreddit: string;
45
+ }
46
+ export declare namespace RedditSubreddits {
47
+ export { type RedditSubredditRetrieveResponse as RedditSubredditRetrieveResponse, type RedditSubredditSetDefaultResponse as RedditSubredditSetDefaultResponse, type RedditSubredditSetDefaultParams as RedditSubredditSetDefaultParams, };
48
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RedditSubreddits = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const path_1 = require("../../internal/utils/path");
7
+ class RedditSubreddits extends resource_1.APIResource {
8
+ /**
9
+ * Fetch Reddit subreddits for an account
10
+ */
11
+ retrieve(id, options) {
12
+ return this._client.get((0, path_1.path) `/v1/accounts/${id}/reddit-subreddits`, options);
13
+ }
14
+ /**
15
+ * Set default Reddit subreddit
16
+ */
17
+ setDefault(id, body, options) {
18
+ return this._client.put((0, path_1.path) `/v1/accounts/${id}/reddit-subreddits`, { body, ...options });
19
+ }
20
+ }
21
+ exports.RedditSubreddits = RedditSubreddits;
@@ -0,0 +1 @@
1
+ export * from './accounts/index';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./accounts/index"), exports);
@@ -0,0 +1,369 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import * as YoutubeAPI from './youtube';
3
+ import { Youtube, YoutubeGetDailyViewsParams, YoutubeGetDailyViewsResponse } from './youtube';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ export declare class Analytics extends APIResource {
7
+ youtube: YoutubeAPI.Youtube;
8
+ /**
9
+ * Get post analytics
10
+ */
11
+ retrieve(query?: AnalyticsRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<AnalyticsRetrieveResponse>;
12
+ /**
13
+ * Get best posting times based on engagement
14
+ */
15
+ getBestTime(query?: AnalyticsGetBestTimeParams | null | undefined, options?: RequestOptions): APIPromise<AnalyticsGetBestTimeResponse>;
16
+ /**
17
+ * Get engagement decay curve for a post
18
+ */
19
+ getContentDecay(query: AnalyticsGetContentDecayParams, options?: RequestOptions): APIPromise<AnalyticsGetContentDecayResponse>;
20
+ /**
21
+ * Get per-post daily timeline of metrics
22
+ */
23
+ getPostTimeline(query: AnalyticsGetPostTimelineParams, options?: RequestOptions): APIPromise<AnalyticsGetPostTimelineResponse>;
24
+ /**
25
+ * Get posting frequency vs engagement analysis
26
+ */
27
+ getPostingFrequency(query?: AnalyticsGetPostingFrequencyParams | null | undefined, options?: RequestOptions): APIPromise<AnalyticsGetPostingFrequencyResponse>;
28
+ /**
29
+ * Get daily aggregated metrics
30
+ */
31
+ listDailyMetrics(query?: AnalyticsListDailyMetricsParams | null | undefined, options?: RequestOptions): APIPromise<AnalyticsListDailyMetricsResponse>;
32
+ }
33
+ export interface AnalyticsRetrieveResponse {
34
+ data: Array<AnalyticsRetrieveResponse.Data>;
35
+ overview?: AnalyticsRetrieveResponse.Overview;
36
+ }
37
+ export declare namespace AnalyticsRetrieveResponse {
38
+ interface Data {
39
+ platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
40
+ /**
41
+ * Post ID
42
+ */
43
+ post_id: string;
44
+ /**
45
+ * Published timestamp
46
+ */
47
+ published_at: string;
48
+ /**
49
+ * Total clicks
50
+ */
51
+ clicks?: number | null;
52
+ /**
53
+ * Total comments
54
+ */
55
+ comments?: number | null;
56
+ /**
57
+ * Total impressions
58
+ */
59
+ impressions?: number | null;
60
+ /**
61
+ * Total likes
62
+ */
63
+ likes?: number | null;
64
+ /**
65
+ * Total reach
66
+ */
67
+ reach?: number | null;
68
+ /**
69
+ * Total saves
70
+ */
71
+ saves?: number | null;
72
+ /**
73
+ * Total shares
74
+ */
75
+ shares?: number | null;
76
+ /**
77
+ * Total views
78
+ */
79
+ views?: number | null;
80
+ }
81
+ interface Overview {
82
+ /**
83
+ * Total clicks across posts
84
+ */
85
+ total_clicks: number;
86
+ /**
87
+ * Total comments across posts
88
+ */
89
+ total_comments: number;
90
+ /**
91
+ * Total impressions across posts
92
+ */
93
+ total_impressions: number;
94
+ /**
95
+ * Total likes across posts
96
+ */
97
+ total_likes: number;
98
+ /**
99
+ * Total number of posts
100
+ */
101
+ total_posts: number;
102
+ /**
103
+ * Total shares across posts
104
+ */
105
+ total_shares: number;
106
+ /**
107
+ * Total views across posts
108
+ */
109
+ total_views: number;
110
+ }
111
+ }
112
+ export interface AnalyticsGetBestTimeResponse {
113
+ data: Array<AnalyticsGetBestTimeResponse.Data>;
114
+ }
115
+ export declare namespace AnalyticsGetBestTimeResponse {
116
+ interface Data {
117
+ /**
118
+ * Average engagement score
119
+ */
120
+ avg_engagement: number;
121
+ /**
122
+ * Day of week (0=Sunday)
123
+ */
124
+ day_of_week: number;
125
+ /**
126
+ * Hour in UTC
127
+ */
128
+ hour_utc: number;
129
+ /**
130
+ * Number of posts analyzed
131
+ */
132
+ post_count: number;
133
+ }
134
+ }
135
+ export interface AnalyticsGetContentDecayResponse {
136
+ data: Array<AnalyticsGetContentDecayResponse.Data>;
137
+ /**
138
+ * Days until engagement halved
139
+ */
140
+ half_life_days: number | null;
141
+ platform: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
142
+ post_id: string;
143
+ }
144
+ export declare namespace AnalyticsGetContentDecayResponse {
145
+ interface Data {
146
+ /**
147
+ * Cumulative engagement
148
+ */
149
+ cumulative_engagement: number;
150
+ /**
151
+ * Cumulative impressions
152
+ */
153
+ cumulative_impressions: number;
154
+ /**
155
+ * Days since publication
156
+ */
157
+ day: number;
158
+ /**
159
+ * Engagement on this day
160
+ */
161
+ engagement: number;
162
+ /**
163
+ * Impressions on this day
164
+ */
165
+ impressions: number;
166
+ }
167
+ }
168
+ export interface AnalyticsGetPostTimelineResponse {
169
+ data: Array<AnalyticsGetPostTimelineResponse.Data>;
170
+ post_id: string;
171
+ }
172
+ export declare namespace AnalyticsGetPostTimelineResponse {
173
+ interface Data {
174
+ clicks: number;
175
+ comments: number;
176
+ /**
177
+ * Date (YYYY-MM-DD)
178
+ */
179
+ date: string;
180
+ impressions: number;
181
+ likes: number;
182
+ shares: number;
183
+ views: number;
184
+ }
185
+ }
186
+ export interface AnalyticsGetPostingFrequencyResponse {
187
+ data: Array<AnalyticsGetPostingFrequencyResponse.Data>;
188
+ /**
189
+ * Recommended posts per week
190
+ */
191
+ optimal_frequency: number | null;
192
+ }
193
+ export declare namespace AnalyticsGetPostingFrequencyResponse {
194
+ interface Data {
195
+ /**
196
+ * Average engagement
197
+ */
198
+ avg_engagement: number;
199
+ /**
200
+ * Average impressions
201
+ */
202
+ avg_impressions: number;
203
+ /**
204
+ * Average posts per week in bucket
205
+ */
206
+ posts_per_week: number;
207
+ /**
208
+ * Number of weeks in sample
209
+ */
210
+ sample_weeks: number;
211
+ }
212
+ }
213
+ export interface AnalyticsListDailyMetricsResponse {
214
+ data: Array<AnalyticsListDailyMetricsResponse.Data>;
215
+ }
216
+ export declare namespace AnalyticsListDailyMetricsResponse {
217
+ interface Data {
218
+ /**
219
+ * Total clicks
220
+ */
221
+ clicks: number;
222
+ /**
223
+ * Total comments
224
+ */
225
+ comments: number;
226
+ /**
227
+ * Date (YYYY-MM-DD)
228
+ */
229
+ date: string;
230
+ /**
231
+ * Total impressions
232
+ */
233
+ impressions: number;
234
+ /**
235
+ * Total likes
236
+ */
237
+ likes: number;
238
+ /**
239
+ * Post count per platform
240
+ */
241
+ platforms: {
242
+ [key: string]: number;
243
+ };
244
+ /**
245
+ * Posts published on this date
246
+ */
247
+ post_count: number;
248
+ /**
249
+ * Total shares
250
+ */
251
+ shares: number;
252
+ /**
253
+ * Total views
254
+ */
255
+ views: number;
256
+ }
257
+ }
258
+ export interface AnalyticsRetrieveParams {
259
+ /**
260
+ * Filter by account ID
261
+ */
262
+ account_id?: string;
263
+ /**
264
+ * Start date (ISO 8601 date string)
265
+ */
266
+ from_date?: string;
267
+ /**
268
+ * Number of items
269
+ */
270
+ limit?: number;
271
+ /**
272
+ * Offset
273
+ */
274
+ offset?: number | null;
275
+ /**
276
+ * Filter by platform
277
+ */
278
+ platform?: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
279
+ /**
280
+ * Filter by post ID
281
+ */
282
+ post_id?: string;
283
+ /**
284
+ * End date (ISO 8601 date string)
285
+ */
286
+ to_date?: string;
287
+ }
288
+ export interface AnalyticsGetBestTimeParams {
289
+ /**
290
+ * Filter by account ID
291
+ */
292
+ account_id?: string;
293
+ /**
294
+ * Start date (ISO 8601)
295
+ */
296
+ from_date?: string;
297
+ /**
298
+ * Filter by platform
299
+ */
300
+ platform?: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
301
+ /**
302
+ * End date (ISO 8601)
303
+ */
304
+ to_date?: string;
305
+ }
306
+ export interface AnalyticsGetContentDecayParams {
307
+ /**
308
+ * Post ID to analyze decay for
309
+ */
310
+ post_id: string;
311
+ /**
312
+ * Number of days to analyze
313
+ */
314
+ days?: number;
315
+ }
316
+ export interface AnalyticsGetPostTimelineParams {
317
+ /**
318
+ * Post ID
319
+ */
320
+ post_id: string;
321
+ /**
322
+ * Start date (ISO 8601)
323
+ */
324
+ from_date?: string;
325
+ /**
326
+ * End date (ISO 8601)
327
+ */
328
+ to_date?: string;
329
+ }
330
+ export interface AnalyticsGetPostingFrequencyParams {
331
+ /**
332
+ * Filter by account ID
333
+ */
334
+ account_id?: string;
335
+ /**
336
+ * Start date (ISO 8601)
337
+ */
338
+ from_date?: string;
339
+ /**
340
+ * Filter by platform
341
+ */
342
+ platform?: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
343
+ /**
344
+ * End date (ISO 8601)
345
+ */
346
+ to_date?: string;
347
+ }
348
+ export interface AnalyticsListDailyMetricsParams {
349
+ /**
350
+ * Filter by account ID
351
+ */
352
+ account_id?: string;
353
+ /**
354
+ * Start date (ISO 8601)
355
+ */
356
+ from_date?: string;
357
+ /**
358
+ * Filter by platform
359
+ */
360
+ platform?: 'twitter' | 'instagram' | 'facebook' | 'linkedin' | 'tiktok' | 'youtube' | 'pinterest' | 'reddit' | 'bluesky' | 'threads' | 'telegram' | 'snapchat' | 'googlebusiness' | 'whatsapp' | 'mastodon' | 'discord' | 'sms';
361
+ /**
362
+ * End date (ISO 8601)
363
+ */
364
+ to_date?: string;
365
+ }
366
+ export declare namespace Analytics {
367
+ export { type AnalyticsRetrieveResponse as AnalyticsRetrieveResponse, type AnalyticsGetBestTimeResponse as AnalyticsGetBestTimeResponse, type AnalyticsGetContentDecayResponse as AnalyticsGetContentDecayResponse, type AnalyticsGetPostTimelineResponse as AnalyticsGetPostTimelineResponse, type AnalyticsGetPostingFrequencyResponse as AnalyticsGetPostingFrequencyResponse, type AnalyticsListDailyMetricsResponse as AnalyticsListDailyMetricsResponse, type AnalyticsRetrieveParams as AnalyticsRetrieveParams, type AnalyticsGetBestTimeParams as AnalyticsGetBestTimeParams, type AnalyticsGetContentDecayParams as AnalyticsGetContentDecayParams, type AnalyticsGetPostTimelineParams as AnalyticsGetPostTimelineParams, type AnalyticsGetPostingFrequencyParams as AnalyticsGetPostingFrequencyParams, type AnalyticsListDailyMetricsParams as AnalyticsListDailyMetricsParams, };
368
+ export { Youtube as Youtube, type YoutubeGetDailyViewsResponse as YoutubeGetDailyViewsResponse, type YoutubeGetDailyViewsParams as YoutubeGetDailyViewsParams, };
369
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.Analytics = void 0;
38
+ const resource_1 = require("../../core/resource");
39
+ const YoutubeAPI = __importStar(require("./youtube"));
40
+ const youtube_1 = require("./youtube");
41
+ class Analytics extends resource_1.APIResource {
42
+ constructor() {
43
+ super(...arguments);
44
+ this.youtube = new YoutubeAPI.Youtube(this._client);
45
+ }
46
+ /**
47
+ * Get post analytics
48
+ */
49
+ retrieve(query = {}, options) {
50
+ return this._client.get('/v1/analytics', { query, ...options });
51
+ }
52
+ /**
53
+ * Get best posting times based on engagement
54
+ */
55
+ getBestTime(query = {}, options) {
56
+ return this._client.get('/v1/analytics/best-time', { query, ...options });
57
+ }
58
+ /**
59
+ * Get engagement decay curve for a post
60
+ */
61
+ getContentDecay(query, options) {
62
+ return this._client.get('/v1/analytics/content-decay', { query, ...options });
63
+ }
64
+ /**
65
+ * Get per-post daily timeline of metrics
66
+ */
67
+ getPostTimeline(query, options) {
68
+ return this._client.get('/v1/analytics/post-timeline', { query, ...options });
69
+ }
70
+ /**
71
+ * Get posting frequency vs engagement analysis
72
+ */
73
+ getPostingFrequency(query = {}, options) {
74
+ return this._client.get('/v1/analytics/posting-frequency', { query, ...options });
75
+ }
76
+ /**
77
+ * Get daily aggregated metrics
78
+ */
79
+ listDailyMetrics(query = {}, options) {
80
+ return this._client.get('/v1/analytics/daily-metrics', { query, ...options });
81
+ }
82
+ }
83
+ exports.Analytics = Analytics;
84
+ Analytics.Youtube = youtube_1.Youtube;
@@ -0,0 +1,2 @@
1
+ export { Analytics, type AnalyticsRetrieveResponse, type AnalyticsGetBestTimeResponse, type AnalyticsGetContentDecayResponse, type AnalyticsGetPostTimelineResponse, type AnalyticsGetPostingFrequencyResponse, type AnalyticsListDailyMetricsResponse, type AnalyticsRetrieveParams, type AnalyticsGetBestTimeParams, type AnalyticsGetContentDecayParams, type AnalyticsGetPostTimelineParams, type AnalyticsGetPostingFrequencyParams, type AnalyticsListDailyMetricsParams, } from './analytics';
2
+ export { Youtube, type YoutubeGetDailyViewsResponse, type YoutubeGetDailyViewsParams } from './youtube';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Youtube = exports.Analytics = void 0;
5
+ var analytics_1 = require("./analytics");
6
+ Object.defineProperty(exports, "Analytics", { enumerable: true, get: function () { return analytics_1.Analytics; } });
7
+ var youtube_1 = require("./youtube");
8
+ Object.defineProperty(exports, "Youtube", { enumerable: true, get: function () { return youtube_1.Youtube; } });
@@ -0,0 +1,49 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { RequestOptions } from '../../internal/request-options';
4
+ export declare class Youtube extends APIResource {
5
+ /**
6
+ * Get YouTube daily views and watch time
7
+ */
8
+ getDailyViews(query: YoutubeGetDailyViewsParams, options?: RequestOptions): APIPromise<YoutubeGetDailyViewsResponse>;
9
+ }
10
+ export interface YoutubeGetDailyViewsResponse {
11
+ data: Array<YoutubeGetDailyViewsResponse.Data>;
12
+ }
13
+ export declare namespace YoutubeGetDailyViewsResponse {
14
+ interface Data {
15
+ /**
16
+ * Date (YYYY-MM-DD)
17
+ */
18
+ date: string;
19
+ /**
20
+ * Net subscribers gained
21
+ */
22
+ subscribers_gained: number;
23
+ /**
24
+ * Total views
25
+ */
26
+ views: number;
27
+ /**
28
+ * Watch time in minutes
29
+ */
30
+ watch_time_minutes: number;
31
+ }
32
+ }
33
+ export interface YoutubeGetDailyViewsParams {
34
+ /**
35
+ * YouTube account ID
36
+ */
37
+ account_id: string;
38
+ /**
39
+ * Start date (ISO 8601)
40
+ */
41
+ from_date?: string;
42
+ /**
43
+ * End date (ISO 8601)
44
+ */
45
+ to_date?: string;
46
+ }
47
+ export declare namespace Youtube {
48
+ export { type YoutubeGetDailyViewsResponse as YoutubeGetDailyViewsResponse, type YoutubeGetDailyViewsParams as YoutubeGetDailyViewsParams, };
49
+ }