@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,2 @@
1
+ /** @deprecated Import from ./core/api-promise instead */
2
+ export * from './core/api-promise';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /** @deprecated Import from ./core/api-promise instead */
18
+ __exportStar(require("./core/api-promise"), exports);
@@ -0,0 +1,225 @@
1
+ import type { RequestInit, RequestInfo } from './internal/builtin-types';
2
+ import type { PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from './internal/types';
3
+ export type { Logger, LogLevel } from './internal/utils/log';
4
+ import * as Opts from './internal/request-options';
5
+ import * as Errors from './core/error';
6
+ import * as Uploads from './core/uploads';
7
+ import * as API from './resources/index';
8
+ import { APIPromise } from './core/api-promise';
9
+ import { AccountGroupCreateParams, AccountGroupCreateResponse, AccountGroupListResponse, AccountGroupUpdateParams, AccountGroupUpdateResponse, AccountGroups } from './resources/account-groups';
10
+ import { APIKeyCreateParams, APIKeyCreateResponse, APIKeyListParams, APIKeyListResponse, APIKeys } from './resources/api-keys';
11
+ import { ConnectionListLogsParams, ConnectionListLogsResponse, Connections } from './resources/connections';
12
+ import { Media, MediaGetPresignURLParams, MediaGetPresignURLResponse, MediaListParams, MediaListResponse, MediaRetrieveResponse, MediaUploadParams, MediaUploadResponse } from './resources/media';
13
+ import { Reddit, RedditGetFeedParams, RedditGetFeedResponse, RedditSearchParams, RedditSearchResponse } from './resources/reddit';
14
+ import { Usage, UsageRetrieveResponse } from './resources/usage';
15
+ import { WebhookCreateParams, WebhookCreateResponse, WebhookListLogsParams, WebhookListLogsResponse, WebhookListParams, WebhookListResponse, WebhookSendTestParams, WebhookSendTestResponse, WebhookUpdateParams, WebhookUpdateResponse, Webhooks } from './resources/webhooks';
16
+ import { AccountListParams, AccountListResponse, AccountRetrieveResponse, AccountUpdateParams, AccountUpdateResponse, Accounts } from './resources/accounts/accounts';
17
+ import { Analytics, AnalyticsGetBestTimeParams, AnalyticsGetBestTimeResponse, AnalyticsGetContentDecayParams, AnalyticsGetContentDecayResponse, AnalyticsGetPostTimelineParams, AnalyticsGetPostTimelineResponse, AnalyticsGetPostingFrequencyParams, AnalyticsGetPostingFrequencyResponse, AnalyticsListDailyMetricsParams, AnalyticsListDailyMetricsResponse, AnalyticsRetrieveParams, AnalyticsRetrieveResponse } from './resources/analytics/analytics';
18
+ import { Connect, ConnectCompleteOAuthCallbackParams, ConnectCompleteOAuthCallbackResponse, ConnectCreateBlueskyConnectionParams, ConnectCreateBlueskyConnectionResponse, ConnectFetchPendingDataParams, ConnectFetchPendingDataResponse, ConnectStartOAuthFlowParams, ConnectStartOAuthFlowResponse } from './resources/connect/connect';
19
+ import { Inbox } from './resources/inbox/inbox';
20
+ import { PostBulkCreateParams, PostBulkCreateResponse, PostCreateParams, PostCreateResponse, PostListParams, PostListResponse, PostRetrieveResponse, PostRetryResponse, PostUnpublishResponse, PostUpdateParams, PostUpdateResponse, Posts } from './resources/posts/posts';
21
+ import { Queue, QueueGetNextSlotResponse, QueuePreviewParams, QueuePreviewResponse } from './resources/queue/queue';
22
+ import { Tools } from './resources/tools/tools';
23
+ import { Twitter } from './resources/twitter/twitter';
24
+ import { Whatsapp, WhatsappBulkSendParams, WhatsappBulkSendResponse, WhatsappListPhoneNumbersParams, WhatsappListPhoneNumbersResponse } from './resources/whatsapp/whatsapp';
25
+ import { type Fetch } from './internal/builtin-types';
26
+ import { HeadersLike, NullableHeaders } from './internal/headers';
27
+ import { FinalRequestOptions, RequestOptions } from './internal/request-options';
28
+ import { type LogLevel, type Logger } from './internal/utils/log';
29
+ export interface ClientOptions {
30
+ /**
31
+ * API key (rlay_live_* or rlay_test_*)
32
+ */
33
+ apiKey?: string | undefined;
34
+ /**
35
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
36
+ *
37
+ * Defaults to process.env['RELAY_BASE_URL'].
38
+ */
39
+ baseURL?: string | null | undefined;
40
+ /**
41
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
42
+ * from the server before timing out a single request.
43
+ *
44
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
45
+ * much longer than this timeout before the promise succeeds or fails.
46
+ *
47
+ * @unit milliseconds
48
+ */
49
+ timeout?: number | undefined;
50
+ /**
51
+ * Additional `RequestInit` options to be passed to `fetch` calls.
52
+ * Properties will be overridden by per-request `fetchOptions`.
53
+ */
54
+ fetchOptions?: MergedRequestInit | undefined;
55
+ /**
56
+ * Specify a custom `fetch` function implementation.
57
+ *
58
+ * If not provided, we expect that `fetch` is defined globally.
59
+ */
60
+ fetch?: Fetch | undefined;
61
+ /**
62
+ * The maximum number of times that the client will retry a request in case of a
63
+ * temporary failure, like a network error or a 5XX error from the server.
64
+ *
65
+ * @default 2
66
+ */
67
+ maxRetries?: number | undefined;
68
+ /**
69
+ * Default headers to include with every request to the API.
70
+ *
71
+ * These can be removed in individual requests by explicitly setting the
72
+ * header to `null` in request options.
73
+ */
74
+ defaultHeaders?: HeadersLike | undefined;
75
+ /**
76
+ * Default query parameters to include with every request to the API.
77
+ *
78
+ * These can be removed in individual requests by explicitly setting the
79
+ * param to `undefined` in request options.
80
+ */
81
+ defaultQuery?: Record<string, string | undefined> | undefined;
82
+ /**
83
+ * Set the log level.
84
+ *
85
+ * Defaults to process.env['RELAY_LOG'] or 'warn' if it isn't set.
86
+ */
87
+ logLevel?: LogLevel | undefined;
88
+ /**
89
+ * Set the logger.
90
+ *
91
+ * Defaults to globalThis.console.
92
+ */
93
+ logger?: Logger | undefined;
94
+ }
95
+ /**
96
+ * API Client for interfacing with the Relay API.
97
+ */
98
+ export declare class Relay {
99
+ #private;
100
+ apiKey: string;
101
+ baseURL: string;
102
+ maxRetries: number;
103
+ timeout: number;
104
+ logger: Logger;
105
+ logLevel: LogLevel | undefined;
106
+ fetchOptions: MergedRequestInit | undefined;
107
+ private fetch;
108
+ protected idempotencyHeader?: string;
109
+ private _options;
110
+ /**
111
+ * API Client for interfacing with the Relay API.
112
+ *
113
+ * @param {string | undefined} [opts.apiKey=process.env['RELAY_API_KEY'] ?? undefined]
114
+ * @param {string} [opts.baseURL=process.env['RELAY_BASE_URL'] ?? https://api.relayapi.dev] - Override the default base URL for the API.
115
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
116
+ * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
117
+ * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
118
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
119
+ * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
120
+ * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
121
+ */
122
+ constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
123
+ /**
124
+ * Create a new client instance re-using the same options given to the current client with optional overriding.
125
+ */
126
+ withOptions(options: Partial<ClientOptions>): this;
127
+ protected defaultQuery(): Record<string, string | undefined> | undefined;
128
+ protected validateHeaders({ values, nulls }: NullableHeaders): void;
129
+ protected authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined>;
130
+ /**
131
+ * Basic re-implementation of `qs.stringify` for primitive types.
132
+ */
133
+ protected stringifyQuery(query: object | Record<string, unknown>): string;
134
+ private getUserAgent;
135
+ protected defaultIdempotencyKey(): string;
136
+ protected makeStatusError(status: number, error: Object, message: string | undefined, headers: Headers): Errors.APIError;
137
+ buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
138
+ /**
139
+ * Used as a callback for mutating the given `FinalRequestOptions` object.
140
+ */
141
+ protected prepareOptions(options: FinalRequestOptions): Promise<void>;
142
+ /**
143
+ * Used as a callback for mutating the given `RequestInit` object.
144
+ *
145
+ * This is useful for cases where you want to add certain headers based off of
146
+ * the request properties, e.g. `method` or `url`.
147
+ */
148
+ protected prepareRequest(request: RequestInit, { url, options }: {
149
+ url: string;
150
+ options: FinalRequestOptions;
151
+ }): Promise<void>;
152
+ get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
153
+ post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
154
+ patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
155
+ put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
156
+ delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>;
157
+ private methodRequest;
158
+ request<Rsp>(options: PromiseOrValue<FinalRequestOptions>, remainingRetries?: number | null): APIPromise<Rsp>;
159
+ private makeRequest;
160
+ fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise<Response>;
161
+ private shouldRetry;
162
+ private retryRequest;
163
+ private calculateDefaultRetryTimeoutMillis;
164
+ buildRequest(inputOptions: FinalRequestOptions, { retryCount }?: {
165
+ retryCount?: number;
166
+ }): Promise<{
167
+ req: FinalizedRequestInit;
168
+ url: string;
169
+ timeout: number;
170
+ }>;
171
+ private buildHeaders;
172
+ private _makeAbort;
173
+ private buildBody;
174
+ static Relay: typeof Relay;
175
+ static DEFAULT_TIMEOUT: number;
176
+ static RelayError: typeof Errors.RelayError;
177
+ static APIError: typeof Errors.APIError;
178
+ static APIConnectionError: typeof Errors.APIConnectionError;
179
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
180
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
181
+ static NotFoundError: typeof Errors.NotFoundError;
182
+ static ConflictError: typeof Errors.ConflictError;
183
+ static RateLimitError: typeof Errors.RateLimitError;
184
+ static BadRequestError: typeof Errors.BadRequestError;
185
+ static AuthenticationError: typeof Errors.AuthenticationError;
186
+ static InternalServerError: typeof Errors.InternalServerError;
187
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
188
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
189
+ static toFile: typeof Uploads.toFile;
190
+ posts: API.Posts;
191
+ accounts: API.Accounts;
192
+ media: API.Media;
193
+ webhooks: API.Webhooks;
194
+ apiKeys: API.APIKeys;
195
+ usage: API.Usage;
196
+ accountGroups: API.AccountGroups;
197
+ connect: API.Connect;
198
+ connections: API.Connections;
199
+ analytics: API.Analytics;
200
+ tools: API.Tools;
201
+ queue: API.Queue;
202
+ twitter: API.Twitter;
203
+ inbox: API.Inbox;
204
+ reddit: API.Reddit;
205
+ whatsapp: API.Whatsapp;
206
+ }
207
+ export declare namespace Relay {
208
+ export type RequestOptions = Opts.RequestOptions;
209
+ export { Posts as Posts, type PostCreateResponse as PostCreateResponse, type PostRetrieveResponse as PostRetrieveResponse, type PostUpdateResponse as PostUpdateResponse, type PostListResponse as PostListResponse, type PostBulkCreateResponse as PostBulkCreateResponse, type PostRetryResponse as PostRetryResponse, type PostUnpublishResponse as PostUnpublishResponse, type PostCreateParams as PostCreateParams, type PostUpdateParams as PostUpdateParams, type PostListParams as PostListParams, type PostBulkCreateParams as PostBulkCreateParams, };
210
+ export { Accounts as Accounts, type AccountRetrieveResponse as AccountRetrieveResponse, type AccountUpdateResponse as AccountUpdateResponse, type AccountListResponse as AccountListResponse, type AccountUpdateParams as AccountUpdateParams, type AccountListParams as AccountListParams, };
211
+ export { Media as Media, type MediaListResponse as MediaListResponse, type MediaRetrieveResponse as MediaRetrieveResponse, type MediaGetPresignURLResponse as MediaGetPresignURLResponse, type MediaUploadResponse as MediaUploadResponse, type MediaListParams as MediaListParams, type MediaGetPresignURLParams as MediaGetPresignURLParams, type MediaUploadParams as MediaUploadParams, };
212
+ export { Webhooks as Webhooks, type WebhookCreateResponse as WebhookCreateResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookListLogsResponse as WebhookListLogsResponse, type WebhookSendTestResponse as WebhookSendTestResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookListLogsParams as WebhookListLogsParams, type WebhookSendTestParams as WebhookSendTestParams, };
213
+ export { APIKeys as APIKeys, type APIKeyCreateResponse as APIKeyCreateResponse, type APIKeyListResponse as APIKeyListResponse, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyListParams as APIKeyListParams, };
214
+ export { Usage as Usage, type UsageRetrieveResponse as UsageRetrieveResponse };
215
+ export { AccountGroups as AccountGroups, type AccountGroupCreateResponse as AccountGroupCreateResponse, type AccountGroupUpdateResponse as AccountGroupUpdateResponse, type AccountGroupListResponse as AccountGroupListResponse, type AccountGroupCreateParams as AccountGroupCreateParams, type AccountGroupUpdateParams as AccountGroupUpdateParams, };
216
+ export { Connect as Connect, type ConnectCompleteOAuthCallbackResponse as ConnectCompleteOAuthCallbackResponse, type ConnectCreateBlueskyConnectionResponse as ConnectCreateBlueskyConnectionResponse, type ConnectFetchPendingDataResponse as ConnectFetchPendingDataResponse, type ConnectStartOAuthFlowResponse as ConnectStartOAuthFlowResponse, type ConnectCompleteOAuthCallbackParams as ConnectCompleteOAuthCallbackParams, type ConnectCreateBlueskyConnectionParams as ConnectCreateBlueskyConnectionParams, type ConnectFetchPendingDataParams as ConnectFetchPendingDataParams, type ConnectStartOAuthFlowParams as ConnectStartOAuthFlowParams, };
217
+ export { Connections as Connections, type ConnectionListLogsResponse as ConnectionListLogsResponse, type ConnectionListLogsParams as ConnectionListLogsParams, };
218
+ export { Analytics as Analytics, 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, };
219
+ export { Tools as Tools };
220
+ export { Queue as Queue, type QueueGetNextSlotResponse as QueueGetNextSlotResponse, type QueuePreviewResponse as QueuePreviewResponse, type QueuePreviewParams as QueuePreviewParams, };
221
+ export { Twitter as Twitter };
222
+ export { Inbox as Inbox };
223
+ export { Reddit as Reddit, type RedditGetFeedResponse as RedditGetFeedResponse, type RedditSearchResponse as RedditSearchResponse, type RedditGetFeedParams as RedditGetFeedParams, type RedditSearchParams as RedditSearchParams, };
224
+ export { Whatsapp as Whatsapp, type WhatsappBulkSendResponse as WhatsappBulkSendResponse, type WhatsappListPhoneNumbersResponse as WhatsappListPhoneNumbersResponse, type WhatsappBulkSendParams as WhatsappBulkSendParams, type WhatsappListPhoneNumbersParams as WhatsappListPhoneNumbersParams, };
225
+ }