@zernio/node 0.1.58
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/LICENSE +190 -0
- package/README.md +481 -0
- package/dist/index.d.mts +8503 -0
- package/dist/index.d.ts +8503 -0
- package/dist/index.js +1870 -0
- package/dist/index.mjs +1841 -0
- package/package.json +84 -0
- package/src/client.ts +674 -0
- package/src/errors.ts +144 -0
- package/src/generated/index.ts +3 -0
- package/src/generated/sdk.gen.ts +2259 -0
- package/src/generated/types.gen.ts +8708 -0
- package/src/index.ts +34 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1870 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
|
|
22
|
+
// src/index.ts
|
|
23
|
+
var index_exports = {};
|
|
24
|
+
__export(index_exports, {
|
|
25
|
+
Late: () => Late,
|
|
26
|
+
LateApiError: () => LateApiError,
|
|
27
|
+
RateLimitError: () => RateLimitError,
|
|
28
|
+
ValidationError: () => ValidationError,
|
|
29
|
+
default: () => Late,
|
|
30
|
+
parseApiError: () => parseApiError
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
|
+
|
|
34
|
+
// node_modules/@hey-api/client-fetch/dist/index.js
|
|
35
|
+
var U = /\{[^{}]+\}/g;
|
|
36
|
+
var S = ({ allowReserved: t, name: r, value: e }) => {
|
|
37
|
+
if (e == null) return "";
|
|
38
|
+
if (typeof e == "object") throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
|
|
39
|
+
return `${r}=${t ? e : encodeURIComponent(e)}`;
|
|
40
|
+
};
|
|
41
|
+
var $ = (t) => {
|
|
42
|
+
switch (t) {
|
|
43
|
+
case "label":
|
|
44
|
+
return ".";
|
|
45
|
+
case "matrix":
|
|
46
|
+
return ";";
|
|
47
|
+
case "simple":
|
|
48
|
+
return ",";
|
|
49
|
+
default:
|
|
50
|
+
return "&";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var k = (t) => {
|
|
54
|
+
switch (t) {
|
|
55
|
+
case "form":
|
|
56
|
+
return ",";
|
|
57
|
+
case "pipeDelimited":
|
|
58
|
+
return "|";
|
|
59
|
+
case "spaceDelimited":
|
|
60
|
+
return "%20";
|
|
61
|
+
default:
|
|
62
|
+
return ",";
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var D = (t) => {
|
|
66
|
+
switch (t) {
|
|
67
|
+
case "label":
|
|
68
|
+
return ".";
|
|
69
|
+
case "matrix":
|
|
70
|
+
return ";";
|
|
71
|
+
case "simple":
|
|
72
|
+
return ",";
|
|
73
|
+
default:
|
|
74
|
+
return "&";
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var j = ({ allowReserved: t, explode: r, name: e, style: s, value: o }) => {
|
|
78
|
+
if (!r) {
|
|
79
|
+
let n = (t ? o : o.map((c) => encodeURIComponent(c))).join(k(s));
|
|
80
|
+
switch (s) {
|
|
81
|
+
case "label":
|
|
82
|
+
return `.${n}`;
|
|
83
|
+
case "matrix":
|
|
84
|
+
return `;${e}=${n}`;
|
|
85
|
+
case "simple":
|
|
86
|
+
return n;
|
|
87
|
+
default:
|
|
88
|
+
return `${e}=${n}`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
let a = $(s), i = o.map((n) => s === "label" || s === "simple" ? t ? n : encodeURIComponent(n) : S({ allowReserved: t, name: e, value: n })).join(a);
|
|
92
|
+
return s === "label" || s === "matrix" ? a + i : i;
|
|
93
|
+
};
|
|
94
|
+
var A = ({ allowReserved: t, explode: r, name: e, style: s, value: o }) => {
|
|
95
|
+
if (o instanceof Date) return `${e}=${o.toISOString()}`;
|
|
96
|
+
if (s !== "deepObject" && !r) {
|
|
97
|
+
let n = [];
|
|
98
|
+
Object.entries(o).forEach(([f, p]) => {
|
|
99
|
+
n = [...n, f, t ? p : encodeURIComponent(p)];
|
|
100
|
+
});
|
|
101
|
+
let c = n.join(",");
|
|
102
|
+
switch (s) {
|
|
103
|
+
case "form":
|
|
104
|
+
return `${e}=${c}`;
|
|
105
|
+
case "label":
|
|
106
|
+
return `.${c}`;
|
|
107
|
+
case "matrix":
|
|
108
|
+
return `;${e}=${c}`;
|
|
109
|
+
default:
|
|
110
|
+
return c;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
let a = D(s), i = Object.entries(o).map(([n, c]) => S({ allowReserved: t, name: s === "deepObject" ? `${e}[${n}]` : n, value: c })).join(a);
|
|
114
|
+
return s === "label" || s === "matrix" ? a + i : i;
|
|
115
|
+
};
|
|
116
|
+
var _ = ({ path: t, url: r }) => {
|
|
117
|
+
let e = r, s = r.match(U);
|
|
118
|
+
if (s) for (let o of s) {
|
|
119
|
+
let a = false, i = o.substring(1, o.length - 1), n = "simple";
|
|
120
|
+
i.endsWith("*") && (a = true, i = i.substring(0, i.length - 1)), i.startsWith(".") ? (i = i.substring(1), n = "label") : i.startsWith(";") && (i = i.substring(1), n = "matrix");
|
|
121
|
+
let c = t[i];
|
|
122
|
+
if (c == null) continue;
|
|
123
|
+
if (Array.isArray(c)) {
|
|
124
|
+
e = e.replace(o, j({ explode: a, name: i, style: n, value: c }));
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (typeof c == "object") {
|
|
128
|
+
e = e.replace(o, A({ explode: a, name: i, style: n, value: c }));
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (n === "matrix") {
|
|
132
|
+
e = e.replace(o, `;${S({ name: i, value: c })}`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
let f = encodeURIComponent(n === "label" ? `.${c}` : c);
|
|
136
|
+
e = e.replace(o, f);
|
|
137
|
+
}
|
|
138
|
+
return e;
|
|
139
|
+
};
|
|
140
|
+
var C = ({ allowReserved: t, array: r, object: e } = {}) => (o) => {
|
|
141
|
+
let a = [];
|
|
142
|
+
if (o && typeof o == "object") for (let i in o) {
|
|
143
|
+
let n = o[i];
|
|
144
|
+
if (n != null) {
|
|
145
|
+
if (Array.isArray(n)) {
|
|
146
|
+
a = [...a, j({ allowReserved: t, explode: true, name: i, style: "form", value: n, ...r })];
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (typeof n == "object") {
|
|
150
|
+
a = [...a, A({ allowReserved: t, explode: true, name: i, style: "deepObject", value: n, ...e })];
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
a = [...a, S({ allowReserved: t, name: i, value: n })];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return a.join("&");
|
|
157
|
+
};
|
|
158
|
+
var w = (t) => {
|
|
159
|
+
if (!t) return "stream";
|
|
160
|
+
let r = t.split(";")[0]?.trim();
|
|
161
|
+
if (r) {
|
|
162
|
+
if (r.startsWith("application/json") || r.endsWith("+json")) return "json";
|
|
163
|
+
if (r === "multipart/form-data") return "formData";
|
|
164
|
+
if (["application/", "audio/", "image/", "video/"].some((e) => r.startsWith(e))) return "blob";
|
|
165
|
+
if (r.startsWith("text/")) return "text";
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
var H = async (t, r) => {
|
|
169
|
+
let e = typeof r == "function" ? await r(t) : r;
|
|
170
|
+
if (e) return t.scheme === "bearer" ? `Bearer ${e}` : t.scheme === "basic" ? `Basic ${btoa(e)}` : e;
|
|
171
|
+
};
|
|
172
|
+
var P = async ({ security: t, ...r }) => {
|
|
173
|
+
for (let e of t) {
|
|
174
|
+
let s = await H(e, r.auth);
|
|
175
|
+
if (!s) continue;
|
|
176
|
+
let o = e.name ?? "Authorization";
|
|
177
|
+
switch (e.in) {
|
|
178
|
+
case "query":
|
|
179
|
+
r.query || (r.query = {}), r.query[o] = s;
|
|
180
|
+
break;
|
|
181
|
+
case "header":
|
|
182
|
+
default:
|
|
183
|
+
r.headers.set(o, s);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var b = (t) => B({ baseUrl: t.baseUrl ?? "", path: t.path, query: t.query, querySerializer: typeof t.querySerializer == "function" ? t.querySerializer : C(t.querySerializer), url: t.url });
|
|
190
|
+
var B = ({ baseUrl: t, path: r, query: e, querySerializer: s, url: o }) => {
|
|
191
|
+
let a = o.startsWith("/") ? o : `/${o}`, i = t + a;
|
|
192
|
+
r && (i = _({ path: r, url: i }));
|
|
193
|
+
let n = e ? s(e) : "";
|
|
194
|
+
return n.startsWith("?") && (n = n.substring(1)), n && (i += `?${n}`), i;
|
|
195
|
+
};
|
|
196
|
+
var R = (t, r) => {
|
|
197
|
+
let e = { ...t, ...r };
|
|
198
|
+
return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = O(t.headers, r.headers), e;
|
|
199
|
+
};
|
|
200
|
+
var O = (...t) => {
|
|
201
|
+
let r = new Headers();
|
|
202
|
+
for (let e of t) {
|
|
203
|
+
if (!e || typeof e != "object") continue;
|
|
204
|
+
let s = e instanceof Headers ? e.entries() : Object.entries(e);
|
|
205
|
+
for (let [o, a] of s) if (a === null) r.delete(o);
|
|
206
|
+
else if (Array.isArray(a)) for (let i of a) r.append(o, i);
|
|
207
|
+
else a !== void 0 && r.set(o, typeof a == "object" ? JSON.stringify(a) : a);
|
|
208
|
+
}
|
|
209
|
+
return r;
|
|
210
|
+
};
|
|
211
|
+
var y = class {
|
|
212
|
+
constructor() {
|
|
213
|
+
__publicField(this, "_fns");
|
|
214
|
+
this._fns = [];
|
|
215
|
+
}
|
|
216
|
+
clear() {
|
|
217
|
+
this._fns = [];
|
|
218
|
+
}
|
|
219
|
+
exists(r) {
|
|
220
|
+
return this._fns.indexOf(r) !== -1;
|
|
221
|
+
}
|
|
222
|
+
eject(r) {
|
|
223
|
+
let e = this._fns.indexOf(r);
|
|
224
|
+
e !== -1 && (this._fns = [...this._fns.slice(0, e), ...this._fns.slice(e + 1)]);
|
|
225
|
+
}
|
|
226
|
+
use(r) {
|
|
227
|
+
this._fns = [...this._fns, r];
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var E = () => ({ error: new y(), request: new y(), response: new y() });
|
|
231
|
+
var x = (t, r, e) => {
|
|
232
|
+
typeof e == "string" || e instanceof Blob ? t.append(r, e) : t.append(r, JSON.stringify(e));
|
|
233
|
+
};
|
|
234
|
+
var W = { bodySerializer: (t) => {
|
|
235
|
+
let r = new FormData();
|
|
236
|
+
return Object.entries(t).forEach(([e, s]) => {
|
|
237
|
+
s != null && (Array.isArray(s) ? s.forEach((o) => x(r, e, o)) : x(r, e, s));
|
|
238
|
+
}), r;
|
|
239
|
+
} };
|
|
240
|
+
var I = { bodySerializer: (t) => JSON.stringify(t) };
|
|
241
|
+
var Q = C({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } });
|
|
242
|
+
var V = { "Content-Type": "application/json" };
|
|
243
|
+
var q = (t = {}) => ({ ...I, baseUrl: "", headers: V, parseAs: "auto", querySerializer: Q, ...t });
|
|
244
|
+
var M = (t = {}) => {
|
|
245
|
+
let r = R(q(), t), e = () => ({ ...r }), s = (i) => (r = R(r, i), e()), o = E(), a = async (i) => {
|
|
246
|
+
let n = { ...r, ...i, fetch: i.fetch ?? r.fetch ?? globalThis.fetch, headers: O(r.headers, i.headers) };
|
|
247
|
+
n.security && await P({ ...n, security: n.security }), n.body && n.bodySerializer && (n.body = n.bodySerializer(n.body)), n.body || n.headers.delete("Content-Type");
|
|
248
|
+
let c = b(n), f = { redirect: "follow", ...n }, p = new Request(c, f);
|
|
249
|
+
for (let u of o.request._fns) p = await u(p, n);
|
|
250
|
+
let T = n.fetch, l = await T(p);
|
|
251
|
+
for (let u of o.response._fns) l = await u(l, p, n);
|
|
252
|
+
let h = { request: p, response: l };
|
|
253
|
+
if (l.ok) {
|
|
254
|
+
if (l.status === 204 || l.headers.get("Content-Length") === "0") return { data: {}, ...h };
|
|
255
|
+
let u = (n.parseAs === "auto" ? w(l.headers.get("Content-Type")) : n.parseAs) ?? "json";
|
|
256
|
+
if (u === "stream") return { data: l.body, ...h };
|
|
257
|
+
let g = await l[u]();
|
|
258
|
+
return u === "json" && (n.responseValidator && await n.responseValidator(g), n.responseTransformer && (g = await n.responseTransformer(g))), { data: g, ...h };
|
|
259
|
+
}
|
|
260
|
+
let m = await l.text();
|
|
261
|
+
try {
|
|
262
|
+
m = JSON.parse(m);
|
|
263
|
+
} catch {
|
|
264
|
+
}
|
|
265
|
+
let d = m;
|
|
266
|
+
for (let u of o.error._fns) d = await u(m, l, p, n);
|
|
267
|
+
if (d = d || {}, n.throwOnError) throw d;
|
|
268
|
+
return { error: d, ...h };
|
|
269
|
+
};
|
|
270
|
+
return { buildUrl: b, connect: (i) => a({ ...i, method: "CONNECT" }), delete: (i) => a({ ...i, method: "DELETE" }), get: (i) => a({ ...i, method: "GET" }), getConfig: e, head: (i) => a({ ...i, method: "HEAD" }), interceptors: o, options: (i) => a({ ...i, method: "OPTIONS" }), patch: (i) => a({ ...i, method: "PATCH" }), post: (i) => a({ ...i, method: "POST" }), put: (i) => a({ ...i, method: "PUT" }), request: a, setConfig: s, trace: (i) => a({ ...i, method: "TRACE" }) };
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// src/generated/sdk.gen.ts
|
|
274
|
+
var client = M(q());
|
|
275
|
+
var downloadYouTubeVideo = (options) => {
|
|
276
|
+
return (options?.client ?? client).get({
|
|
277
|
+
...options,
|
|
278
|
+
url: "/v1/tools/youtube/download"
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
var getYouTubeTranscript = (options) => {
|
|
282
|
+
return (options?.client ?? client).get({
|
|
283
|
+
...options,
|
|
284
|
+
url: "/v1/tools/youtube/transcript"
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
var downloadInstagramMedia = (options) => {
|
|
288
|
+
return (options?.client ?? client).get({
|
|
289
|
+
...options,
|
|
290
|
+
url: "/v1/tools/instagram/download"
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
var checkInstagramHashtags = (options) => {
|
|
294
|
+
return (options?.client ?? client).post({
|
|
295
|
+
...options,
|
|
296
|
+
url: "/v1/tools/instagram/hashtag-checker"
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
var downloadTikTokVideo = (options) => {
|
|
300
|
+
return (options?.client ?? client).get({
|
|
301
|
+
...options,
|
|
302
|
+
url: "/v1/tools/tiktok/download"
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
var downloadTwitterMedia = (options) => {
|
|
306
|
+
return (options?.client ?? client).get({
|
|
307
|
+
...options,
|
|
308
|
+
url: "/v1/tools/twitter/download"
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
var downloadFacebookVideo = (options) => {
|
|
312
|
+
return (options?.client ?? client).get({
|
|
313
|
+
...options,
|
|
314
|
+
url: "/v1/tools/facebook/download"
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
var downloadLinkedInVideo = (options) => {
|
|
318
|
+
return (options?.client ?? client).get({
|
|
319
|
+
...options,
|
|
320
|
+
url: "/v1/tools/linkedin/download"
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
var downloadBlueskyMedia = (options) => {
|
|
324
|
+
return (options?.client ?? client).get({
|
|
325
|
+
...options,
|
|
326
|
+
url: "/v1/tools/bluesky/download"
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
var validatePostLength = (options) => {
|
|
330
|
+
return (options?.client ?? client).post({
|
|
331
|
+
...options,
|
|
332
|
+
url: "/v1/tools/validate/post-length"
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
var validatePost = (options) => {
|
|
336
|
+
return (options?.client ?? client).post({
|
|
337
|
+
...options,
|
|
338
|
+
url: "/v1/tools/validate/post"
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
var validateMedia = (options) => {
|
|
342
|
+
return (options?.client ?? client).post({
|
|
343
|
+
...options,
|
|
344
|
+
url: "/v1/tools/validate/media"
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
var validateSubreddit = (options) => {
|
|
348
|
+
return (options?.client ?? client).get({
|
|
349
|
+
...options,
|
|
350
|
+
url: "/v1/tools/validate/subreddit"
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
var getAnalytics = (options) => {
|
|
354
|
+
return (options?.client ?? client).get({
|
|
355
|
+
...options,
|
|
356
|
+
url: "/v1/analytics"
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
var getYouTubeDailyViews = (options) => {
|
|
360
|
+
return (options?.client ?? client).get({
|
|
361
|
+
...options,
|
|
362
|
+
url: "/v1/analytics/youtube/daily-views"
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
var getDailyMetrics = (options) => {
|
|
366
|
+
return (options?.client ?? client).get({
|
|
367
|
+
...options,
|
|
368
|
+
url: "/v1/analytics/daily-metrics"
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
var getBestTimeToPost = (options) => {
|
|
372
|
+
return (options?.client ?? client).get({
|
|
373
|
+
...options,
|
|
374
|
+
url: "/v1/analytics/best-time"
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
var getContentDecay = (options) => {
|
|
378
|
+
return (options?.client ?? client).get({
|
|
379
|
+
...options,
|
|
380
|
+
url: "/v1/analytics/content-decay"
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
var getPostingFrequency = (options) => {
|
|
384
|
+
return (options?.client ?? client).get({
|
|
385
|
+
...options,
|
|
386
|
+
url: "/v1/analytics/posting-frequency"
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
var getPostTimeline = (options) => {
|
|
390
|
+
return (options?.client ?? client).get({
|
|
391
|
+
...options,
|
|
392
|
+
url: "/v1/analytics/post-timeline"
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
var listAccountGroups = (options) => {
|
|
396
|
+
return (options?.client ?? client).get({
|
|
397
|
+
...options,
|
|
398
|
+
url: "/v1/account-groups"
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
var createAccountGroup = (options) => {
|
|
402
|
+
return (options?.client ?? client).post({
|
|
403
|
+
...options,
|
|
404
|
+
url: "/v1/account-groups"
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
var updateAccountGroup = (options) => {
|
|
408
|
+
return (options?.client ?? client).put({
|
|
409
|
+
...options,
|
|
410
|
+
url: "/v1/account-groups/{groupId}"
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
var deleteAccountGroup = (options) => {
|
|
414
|
+
return (options?.client ?? client).delete({
|
|
415
|
+
...options,
|
|
416
|
+
url: "/v1/account-groups/{groupId}"
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
var getMediaPresignedUrl = (options) => {
|
|
420
|
+
return (options?.client ?? client).post({
|
|
421
|
+
...options,
|
|
422
|
+
url: "/v1/media/presign"
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
var searchReddit = (options) => {
|
|
426
|
+
return (options?.client ?? client).get({
|
|
427
|
+
...options,
|
|
428
|
+
url: "/v1/reddit/search"
|
|
429
|
+
});
|
|
430
|
+
};
|
|
431
|
+
var getRedditFeed = (options) => {
|
|
432
|
+
return (options?.client ?? client).get({
|
|
433
|
+
...options,
|
|
434
|
+
url: "/v1/reddit/feed"
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
var getUsageStats = (options) => {
|
|
438
|
+
return (options?.client ?? client).get({
|
|
439
|
+
...options,
|
|
440
|
+
url: "/v1/usage-stats"
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
var listPosts = (options) => {
|
|
444
|
+
return (options?.client ?? client).get({
|
|
445
|
+
...options,
|
|
446
|
+
url: "/v1/posts"
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
var createPost = (options) => {
|
|
450
|
+
return (options?.client ?? client).post({
|
|
451
|
+
...options,
|
|
452
|
+
url: "/v1/posts"
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
var getPost = (options) => {
|
|
456
|
+
return (options?.client ?? client).get({
|
|
457
|
+
...options,
|
|
458
|
+
url: "/v1/posts/{postId}"
|
|
459
|
+
});
|
|
460
|
+
};
|
|
461
|
+
var updatePost = (options) => {
|
|
462
|
+
return (options?.client ?? client).put({
|
|
463
|
+
...options,
|
|
464
|
+
url: "/v1/posts/{postId}"
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
var deletePost = (options) => {
|
|
468
|
+
return (options?.client ?? client).delete({
|
|
469
|
+
...options,
|
|
470
|
+
url: "/v1/posts/{postId}"
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
var bulkUploadPosts = (options) => {
|
|
474
|
+
return (options?.client ?? client).post({
|
|
475
|
+
...options,
|
|
476
|
+
...W,
|
|
477
|
+
headers: {
|
|
478
|
+
"Content-Type": null,
|
|
479
|
+
...options?.headers
|
|
480
|
+
},
|
|
481
|
+
url: "/v1/posts/bulk-upload"
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
var retryPost = (options) => {
|
|
485
|
+
return (options?.client ?? client).post({
|
|
486
|
+
...options,
|
|
487
|
+
url: "/v1/posts/{postId}/retry"
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
var unpublishPost = (options) => {
|
|
491
|
+
return (options?.client ?? client).post({
|
|
492
|
+
...options,
|
|
493
|
+
url: "/v1/posts/{postId}/unpublish"
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
var listUsers = (options) => {
|
|
497
|
+
return (options?.client ?? client).get({
|
|
498
|
+
...options,
|
|
499
|
+
url: "/v1/users"
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
var getUser = (options) => {
|
|
503
|
+
return (options?.client ?? client).get({
|
|
504
|
+
...options,
|
|
505
|
+
url: "/v1/users/{userId}"
|
|
506
|
+
});
|
|
507
|
+
};
|
|
508
|
+
var listProfiles = (options) => {
|
|
509
|
+
return (options?.client ?? client).get({
|
|
510
|
+
...options,
|
|
511
|
+
url: "/v1/profiles"
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
var createProfile = (options) => {
|
|
515
|
+
return (options?.client ?? client).post({
|
|
516
|
+
...options,
|
|
517
|
+
url: "/v1/profiles"
|
|
518
|
+
});
|
|
519
|
+
};
|
|
520
|
+
var getProfile = (options) => {
|
|
521
|
+
return (options?.client ?? client).get({
|
|
522
|
+
...options,
|
|
523
|
+
url: "/v1/profiles/{profileId}"
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
var updateProfile = (options) => {
|
|
527
|
+
return (options?.client ?? client).put({
|
|
528
|
+
...options,
|
|
529
|
+
url: "/v1/profiles/{profileId}"
|
|
530
|
+
});
|
|
531
|
+
};
|
|
532
|
+
var deleteProfile = (options) => {
|
|
533
|
+
return (options?.client ?? client).delete({
|
|
534
|
+
...options,
|
|
535
|
+
url: "/v1/profiles/{profileId}"
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
var listAccounts = (options) => {
|
|
539
|
+
return (options?.client ?? client).get({
|
|
540
|
+
...options,
|
|
541
|
+
url: "/v1/accounts"
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
var getFollowerStats = (options) => {
|
|
545
|
+
return (options?.client ?? client).get({
|
|
546
|
+
...options,
|
|
547
|
+
url: "/v1/accounts/follower-stats"
|
|
548
|
+
});
|
|
549
|
+
};
|
|
550
|
+
var updateAccount = (options) => {
|
|
551
|
+
return (options?.client ?? client).put({
|
|
552
|
+
...options,
|
|
553
|
+
url: "/v1/accounts/{accountId}"
|
|
554
|
+
});
|
|
555
|
+
};
|
|
556
|
+
var deleteAccount = (options) => {
|
|
557
|
+
return (options?.client ?? client).delete({
|
|
558
|
+
...options,
|
|
559
|
+
url: "/v1/accounts/{accountId}"
|
|
560
|
+
});
|
|
561
|
+
};
|
|
562
|
+
var getAllAccountsHealth = (options) => {
|
|
563
|
+
return (options?.client ?? client).get({
|
|
564
|
+
...options,
|
|
565
|
+
url: "/v1/accounts/health"
|
|
566
|
+
});
|
|
567
|
+
};
|
|
568
|
+
var getAccountHealth = (options) => {
|
|
569
|
+
return (options?.client ?? client).get({
|
|
570
|
+
...options,
|
|
571
|
+
url: "/v1/accounts/{accountId}/health"
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
var listApiKeys = (options) => {
|
|
575
|
+
return (options?.client ?? client).get({
|
|
576
|
+
...options,
|
|
577
|
+
url: "/v1/api-keys"
|
|
578
|
+
});
|
|
579
|
+
};
|
|
580
|
+
var createApiKey = (options) => {
|
|
581
|
+
return (options?.client ?? client).post({
|
|
582
|
+
...options,
|
|
583
|
+
url: "/v1/api-keys"
|
|
584
|
+
});
|
|
585
|
+
};
|
|
586
|
+
var deleteApiKey = (options) => {
|
|
587
|
+
return (options?.client ?? client).delete({
|
|
588
|
+
...options,
|
|
589
|
+
url: "/v1/api-keys/{keyId}"
|
|
590
|
+
});
|
|
591
|
+
};
|
|
592
|
+
var createInviteToken = (options) => {
|
|
593
|
+
return (options?.client ?? client).post({
|
|
594
|
+
...options,
|
|
595
|
+
url: "/v1/invite/tokens"
|
|
596
|
+
});
|
|
597
|
+
};
|
|
598
|
+
var getConnectUrl = (options) => {
|
|
599
|
+
return (options?.client ?? client).get({
|
|
600
|
+
...options,
|
|
601
|
+
url: "/v1/connect/{platform}"
|
|
602
|
+
});
|
|
603
|
+
};
|
|
604
|
+
var handleOAuthCallback = (options) => {
|
|
605
|
+
return (options?.client ?? client).post({
|
|
606
|
+
...options,
|
|
607
|
+
url: "/v1/connect/{platform}"
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
var listFacebookPages = (options) => {
|
|
611
|
+
return (options?.client ?? client).get({
|
|
612
|
+
...options,
|
|
613
|
+
url: "/v1/connect/facebook/select-page"
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
var selectFacebookPage = (options) => {
|
|
617
|
+
return (options?.client ?? client).post({
|
|
618
|
+
...options,
|
|
619
|
+
url: "/v1/connect/facebook/select-page"
|
|
620
|
+
});
|
|
621
|
+
};
|
|
622
|
+
var listGoogleBusinessLocations = (options) => {
|
|
623
|
+
return (options?.client ?? client).get({
|
|
624
|
+
...options,
|
|
625
|
+
url: "/v1/connect/googlebusiness/locations"
|
|
626
|
+
});
|
|
627
|
+
};
|
|
628
|
+
var selectGoogleBusinessLocation = (options) => {
|
|
629
|
+
return (options?.client ?? client).post({
|
|
630
|
+
...options,
|
|
631
|
+
url: "/v1/connect/googlebusiness/select-location"
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
var getGoogleBusinessReviews = (options) => {
|
|
635
|
+
return (options?.client ?? client).get({
|
|
636
|
+
...options,
|
|
637
|
+
url: "/v1/accounts/{accountId}/gmb-reviews"
|
|
638
|
+
});
|
|
639
|
+
};
|
|
640
|
+
var getGoogleBusinessFoodMenus = (options) => {
|
|
641
|
+
return (options?.client ?? client).get({
|
|
642
|
+
...options,
|
|
643
|
+
url: "/v1/accounts/{accountId}/gmb-food-menus"
|
|
644
|
+
});
|
|
645
|
+
};
|
|
646
|
+
var updateGoogleBusinessFoodMenus = (options) => {
|
|
647
|
+
return (options?.client ?? client).put({
|
|
648
|
+
...options,
|
|
649
|
+
url: "/v1/accounts/{accountId}/gmb-food-menus"
|
|
650
|
+
});
|
|
651
|
+
};
|
|
652
|
+
var getGoogleBusinessLocationDetails = (options) => {
|
|
653
|
+
return (options?.client ?? client).get({
|
|
654
|
+
...options,
|
|
655
|
+
url: "/v1/accounts/{accountId}/gmb-location-details"
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
var updateGoogleBusinessLocationDetails = (options) => {
|
|
659
|
+
return (options?.client ?? client).put({
|
|
660
|
+
...options,
|
|
661
|
+
url: "/v1/accounts/{accountId}/gmb-location-details"
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
var listGoogleBusinessMedia = (options) => {
|
|
665
|
+
return (options?.client ?? client).get({
|
|
666
|
+
...options,
|
|
667
|
+
url: "/v1/accounts/{accountId}/gmb-media"
|
|
668
|
+
});
|
|
669
|
+
};
|
|
670
|
+
var createGoogleBusinessMedia = (options) => {
|
|
671
|
+
return (options?.client ?? client).post({
|
|
672
|
+
...options,
|
|
673
|
+
url: "/v1/accounts/{accountId}/gmb-media"
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
var deleteGoogleBusinessMedia = (options) => {
|
|
677
|
+
return (options?.client ?? client).delete({
|
|
678
|
+
...options,
|
|
679
|
+
url: "/v1/accounts/{accountId}/gmb-media"
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
var getGoogleBusinessAttributes = (options) => {
|
|
683
|
+
return (options?.client ?? client).get({
|
|
684
|
+
...options,
|
|
685
|
+
url: "/v1/accounts/{accountId}/gmb-attributes"
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
var updateGoogleBusinessAttributes = (options) => {
|
|
689
|
+
return (options?.client ?? client).put({
|
|
690
|
+
...options,
|
|
691
|
+
url: "/v1/accounts/{accountId}/gmb-attributes"
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
var listGoogleBusinessPlaceActions = (options) => {
|
|
695
|
+
return (options?.client ?? client).get({
|
|
696
|
+
...options,
|
|
697
|
+
url: "/v1/accounts/{accountId}/gmb-place-actions"
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
var createGoogleBusinessPlaceAction = (options) => {
|
|
701
|
+
return (options?.client ?? client).post({
|
|
702
|
+
...options,
|
|
703
|
+
url: "/v1/accounts/{accountId}/gmb-place-actions"
|
|
704
|
+
});
|
|
705
|
+
};
|
|
706
|
+
var deleteGoogleBusinessPlaceAction = (options) => {
|
|
707
|
+
return (options?.client ?? client).delete({
|
|
708
|
+
...options,
|
|
709
|
+
url: "/v1/accounts/{accountId}/gmb-place-actions"
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
var getPendingOAuthData = (options) => {
|
|
713
|
+
return (options?.client ?? client).get({
|
|
714
|
+
...options,
|
|
715
|
+
url: "/v1/connect/pending-data"
|
|
716
|
+
});
|
|
717
|
+
};
|
|
718
|
+
var listLinkedInOrganizations = (options) => {
|
|
719
|
+
return (options?.client ?? client).get({
|
|
720
|
+
...options,
|
|
721
|
+
url: "/v1/connect/linkedin/organizations"
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
var selectLinkedInOrganization = (options) => {
|
|
725
|
+
return (options?.client ?? client).post({
|
|
726
|
+
...options,
|
|
727
|
+
url: "/v1/connect/linkedin/select-organization"
|
|
728
|
+
});
|
|
729
|
+
};
|
|
730
|
+
var listPinterestBoardsForSelection = (options) => {
|
|
731
|
+
return (options?.client ?? client).get({
|
|
732
|
+
...options,
|
|
733
|
+
url: "/v1/connect/pinterest/select-board"
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
var selectPinterestBoard = (options) => {
|
|
737
|
+
return (options?.client ?? client).post({
|
|
738
|
+
...options,
|
|
739
|
+
url: "/v1/connect/pinterest/select-board"
|
|
740
|
+
});
|
|
741
|
+
};
|
|
742
|
+
var listSnapchatProfiles = (options) => {
|
|
743
|
+
return (options?.client ?? client).get({
|
|
744
|
+
...options,
|
|
745
|
+
url: "/v1/connect/snapchat/select-profile"
|
|
746
|
+
});
|
|
747
|
+
};
|
|
748
|
+
var selectSnapchatProfile = (options) => {
|
|
749
|
+
return (options?.client ?? client).post({
|
|
750
|
+
...options,
|
|
751
|
+
url: "/v1/connect/snapchat/select-profile"
|
|
752
|
+
});
|
|
753
|
+
};
|
|
754
|
+
var connectBlueskyCredentials = (options) => {
|
|
755
|
+
return (options?.client ?? client).post({
|
|
756
|
+
...options,
|
|
757
|
+
url: "/v1/connect/bluesky/credentials"
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
var connectWhatsAppCredentials = (options) => {
|
|
761
|
+
return (options?.client ?? client).post({
|
|
762
|
+
...options,
|
|
763
|
+
url: "/v1/connect/whatsapp/credentials"
|
|
764
|
+
});
|
|
765
|
+
};
|
|
766
|
+
var getTelegramConnectStatus = (options) => {
|
|
767
|
+
return (options?.client ?? client).get({
|
|
768
|
+
...options,
|
|
769
|
+
url: "/v1/connect/telegram"
|
|
770
|
+
});
|
|
771
|
+
};
|
|
772
|
+
var initiateTelegramConnect = (options) => {
|
|
773
|
+
return (options?.client ?? client).post({
|
|
774
|
+
...options,
|
|
775
|
+
url: "/v1/connect/telegram"
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
var completeTelegramConnect = (options) => {
|
|
779
|
+
return (options?.client ?? client).patch({
|
|
780
|
+
...options,
|
|
781
|
+
url: "/v1/connect/telegram"
|
|
782
|
+
});
|
|
783
|
+
};
|
|
784
|
+
var getFacebookPages = (options) => {
|
|
785
|
+
return (options?.client ?? client).get({
|
|
786
|
+
...options,
|
|
787
|
+
url: "/v1/accounts/{accountId}/facebook-page"
|
|
788
|
+
});
|
|
789
|
+
};
|
|
790
|
+
var updateFacebookPage = (options) => {
|
|
791
|
+
return (options?.client ?? client).put({
|
|
792
|
+
...options,
|
|
793
|
+
url: "/v1/accounts/{accountId}/facebook-page"
|
|
794
|
+
});
|
|
795
|
+
};
|
|
796
|
+
var getLinkedInOrganizations = (options) => {
|
|
797
|
+
return (options?.client ?? client).get({
|
|
798
|
+
...options,
|
|
799
|
+
url: "/v1/accounts/{accountId}/linkedin-organizations"
|
|
800
|
+
});
|
|
801
|
+
};
|
|
802
|
+
var getLinkedInAggregateAnalytics = (options) => {
|
|
803
|
+
return (options?.client ?? client).get({
|
|
804
|
+
...options,
|
|
805
|
+
url: "/v1/accounts/{accountId}/linkedin-aggregate-analytics"
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
var getLinkedInPostAnalytics = (options) => {
|
|
809
|
+
return (options?.client ?? client).get({
|
|
810
|
+
...options,
|
|
811
|
+
url: "/v1/accounts/{accountId}/linkedin-post-analytics"
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
var getLinkedInPostReactions = (options) => {
|
|
815
|
+
return (options?.client ?? client).get({
|
|
816
|
+
...options,
|
|
817
|
+
url: "/v1/accounts/{accountId}/linkedin-post-reactions"
|
|
818
|
+
});
|
|
819
|
+
};
|
|
820
|
+
var updateLinkedInOrganization = (options) => {
|
|
821
|
+
return (options?.client ?? client).put({
|
|
822
|
+
...options,
|
|
823
|
+
url: "/v1/accounts/{accountId}/linkedin-organization"
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
var getLinkedInMentions = (options) => {
|
|
827
|
+
return (options?.client ?? client).get({
|
|
828
|
+
...options,
|
|
829
|
+
url: "/v1/accounts/{accountId}/linkedin-mentions"
|
|
830
|
+
});
|
|
831
|
+
};
|
|
832
|
+
var getPinterestBoards = (options) => {
|
|
833
|
+
return (options?.client ?? client).get({
|
|
834
|
+
...options,
|
|
835
|
+
url: "/v1/accounts/{accountId}/pinterest-boards"
|
|
836
|
+
});
|
|
837
|
+
};
|
|
838
|
+
var updatePinterestBoards = (options) => {
|
|
839
|
+
return (options?.client ?? client).put({
|
|
840
|
+
...options,
|
|
841
|
+
url: "/v1/accounts/{accountId}/pinterest-boards"
|
|
842
|
+
});
|
|
843
|
+
};
|
|
844
|
+
var getGmbLocations = (options) => {
|
|
845
|
+
return (options?.client ?? client).get({
|
|
846
|
+
...options,
|
|
847
|
+
url: "/v1/accounts/{accountId}/gmb-locations"
|
|
848
|
+
});
|
|
849
|
+
};
|
|
850
|
+
var updateGmbLocation = (options) => {
|
|
851
|
+
return (options?.client ?? client).put({
|
|
852
|
+
...options,
|
|
853
|
+
url: "/v1/accounts/{accountId}/gmb-locations"
|
|
854
|
+
});
|
|
855
|
+
};
|
|
856
|
+
var getRedditSubreddits = (options) => {
|
|
857
|
+
return (options?.client ?? client).get({
|
|
858
|
+
...options,
|
|
859
|
+
url: "/v1/accounts/{accountId}/reddit-subreddits"
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
var updateRedditSubreddits = (options) => {
|
|
863
|
+
return (options?.client ?? client).put({
|
|
864
|
+
...options,
|
|
865
|
+
url: "/v1/accounts/{accountId}/reddit-subreddits"
|
|
866
|
+
});
|
|
867
|
+
};
|
|
868
|
+
var getRedditFlairs = (options) => {
|
|
869
|
+
return (options?.client ?? client).get({
|
|
870
|
+
...options,
|
|
871
|
+
url: "/v1/accounts/{accountId}/reddit-flairs"
|
|
872
|
+
});
|
|
873
|
+
};
|
|
874
|
+
var listQueueSlots = (options) => {
|
|
875
|
+
return (options?.client ?? client).get({
|
|
876
|
+
...options,
|
|
877
|
+
url: "/v1/queue/slots"
|
|
878
|
+
});
|
|
879
|
+
};
|
|
880
|
+
var createQueueSlot = (options) => {
|
|
881
|
+
return (options?.client ?? client).post({
|
|
882
|
+
...options,
|
|
883
|
+
url: "/v1/queue/slots"
|
|
884
|
+
});
|
|
885
|
+
};
|
|
886
|
+
var updateQueueSlot = (options) => {
|
|
887
|
+
return (options?.client ?? client).put({
|
|
888
|
+
...options,
|
|
889
|
+
url: "/v1/queue/slots"
|
|
890
|
+
});
|
|
891
|
+
};
|
|
892
|
+
var deleteQueueSlot = (options) => {
|
|
893
|
+
return (options?.client ?? client).delete({
|
|
894
|
+
...options,
|
|
895
|
+
url: "/v1/queue/slots"
|
|
896
|
+
});
|
|
897
|
+
};
|
|
898
|
+
var previewQueue = (options) => {
|
|
899
|
+
return (options?.client ?? client).get({
|
|
900
|
+
...options,
|
|
901
|
+
url: "/v1/queue/preview"
|
|
902
|
+
});
|
|
903
|
+
};
|
|
904
|
+
var getNextQueueSlot = (options) => {
|
|
905
|
+
return (options?.client ?? client).get({
|
|
906
|
+
...options,
|
|
907
|
+
url: "/v1/queue/next-slot"
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
var getWebhookSettings = (options) => {
|
|
911
|
+
return (options?.client ?? client).get({
|
|
912
|
+
...options,
|
|
913
|
+
url: "/v1/webhooks/settings"
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
var createWebhookSettings = (options) => {
|
|
917
|
+
return (options?.client ?? client).post({
|
|
918
|
+
...options,
|
|
919
|
+
url: "/v1/webhooks/settings"
|
|
920
|
+
});
|
|
921
|
+
};
|
|
922
|
+
var updateWebhookSettings = (options) => {
|
|
923
|
+
return (options?.client ?? client).put({
|
|
924
|
+
...options,
|
|
925
|
+
url: "/v1/webhooks/settings"
|
|
926
|
+
});
|
|
927
|
+
};
|
|
928
|
+
var deleteWebhookSettings = (options) => {
|
|
929
|
+
return (options?.client ?? client).delete({
|
|
930
|
+
...options,
|
|
931
|
+
url: "/v1/webhooks/settings"
|
|
932
|
+
});
|
|
933
|
+
};
|
|
934
|
+
var testWebhook = (options) => {
|
|
935
|
+
return (options?.client ?? client).post({
|
|
936
|
+
...options,
|
|
937
|
+
url: "/v1/webhooks/test"
|
|
938
|
+
});
|
|
939
|
+
};
|
|
940
|
+
var getWebhookLogs = (options) => {
|
|
941
|
+
return (options?.client ?? client).get({
|
|
942
|
+
...options,
|
|
943
|
+
url: "/v1/webhooks/logs"
|
|
944
|
+
});
|
|
945
|
+
};
|
|
946
|
+
var listPostsLogs = (options) => {
|
|
947
|
+
return (options?.client ?? client).get({
|
|
948
|
+
...options,
|
|
949
|
+
url: "/v1/posts/logs"
|
|
950
|
+
});
|
|
951
|
+
};
|
|
952
|
+
var listConnectionLogs = (options) => {
|
|
953
|
+
return (options?.client ?? client).get({
|
|
954
|
+
...options,
|
|
955
|
+
url: "/v1/connections/logs"
|
|
956
|
+
});
|
|
957
|
+
};
|
|
958
|
+
var getPostLogs = (options) => {
|
|
959
|
+
return (options?.client ?? client).get({
|
|
960
|
+
...options,
|
|
961
|
+
url: "/v1/posts/{postId}/logs"
|
|
962
|
+
});
|
|
963
|
+
};
|
|
964
|
+
var listInboxConversations = (options) => {
|
|
965
|
+
return (options?.client ?? client).get({
|
|
966
|
+
...options,
|
|
967
|
+
url: "/v1/inbox/conversations"
|
|
968
|
+
});
|
|
969
|
+
};
|
|
970
|
+
var getInboxConversation = (options) => {
|
|
971
|
+
return (options?.client ?? client).get({
|
|
972
|
+
...options,
|
|
973
|
+
url: "/v1/inbox/conversations/{conversationId}"
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
var updateInboxConversation = (options) => {
|
|
977
|
+
return (options?.client ?? client).put({
|
|
978
|
+
...options,
|
|
979
|
+
url: "/v1/inbox/conversations/{conversationId}"
|
|
980
|
+
});
|
|
981
|
+
};
|
|
982
|
+
var getInboxConversationMessages = (options) => {
|
|
983
|
+
return (options?.client ?? client).get({
|
|
984
|
+
...options,
|
|
985
|
+
url: "/v1/inbox/conversations/{conversationId}/messages"
|
|
986
|
+
});
|
|
987
|
+
};
|
|
988
|
+
var sendInboxMessage = (options) => {
|
|
989
|
+
return (options?.client ?? client).post({
|
|
990
|
+
...options,
|
|
991
|
+
url: "/v1/inbox/conversations/{conversationId}/messages"
|
|
992
|
+
});
|
|
993
|
+
};
|
|
994
|
+
var editInboxMessage = (options) => {
|
|
995
|
+
return (options?.client ?? client).patch({
|
|
996
|
+
...options,
|
|
997
|
+
url: "/v1/inbox/conversations/{conversationId}/messages/{messageId}"
|
|
998
|
+
});
|
|
999
|
+
};
|
|
1000
|
+
var getMessengerMenu = (options) => {
|
|
1001
|
+
return (options?.client ?? client).get({
|
|
1002
|
+
...options,
|
|
1003
|
+
url: "/v1/accounts/{accountId}/messenger-menu"
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
var setMessengerMenu = (options) => {
|
|
1007
|
+
return (options?.client ?? client).put({
|
|
1008
|
+
...options,
|
|
1009
|
+
url: "/v1/accounts/{accountId}/messenger-menu"
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
var deleteMessengerMenu = (options) => {
|
|
1013
|
+
return (options?.client ?? client).delete({
|
|
1014
|
+
...options,
|
|
1015
|
+
url: "/v1/accounts/{accountId}/messenger-menu"
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
var getInstagramIceBreakers = (options) => {
|
|
1019
|
+
return (options?.client ?? client).get({
|
|
1020
|
+
...options,
|
|
1021
|
+
url: "/v1/accounts/{accountId}/instagram-ice-breakers"
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
var setInstagramIceBreakers = (options) => {
|
|
1025
|
+
return (options?.client ?? client).put({
|
|
1026
|
+
...options,
|
|
1027
|
+
url: "/v1/accounts/{accountId}/instagram-ice-breakers"
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
var deleteInstagramIceBreakers = (options) => {
|
|
1031
|
+
return (options?.client ?? client).delete({
|
|
1032
|
+
...options,
|
|
1033
|
+
url: "/v1/accounts/{accountId}/instagram-ice-breakers"
|
|
1034
|
+
});
|
|
1035
|
+
};
|
|
1036
|
+
var getTelegramCommands = (options) => {
|
|
1037
|
+
return (options?.client ?? client).get({
|
|
1038
|
+
...options,
|
|
1039
|
+
url: "/v1/accounts/{accountId}/telegram-commands"
|
|
1040
|
+
});
|
|
1041
|
+
};
|
|
1042
|
+
var setTelegramCommands = (options) => {
|
|
1043
|
+
return (options?.client ?? client).put({
|
|
1044
|
+
...options,
|
|
1045
|
+
url: "/v1/accounts/{accountId}/telegram-commands"
|
|
1046
|
+
});
|
|
1047
|
+
};
|
|
1048
|
+
var deleteTelegramCommands = (options) => {
|
|
1049
|
+
return (options?.client ?? client).delete({
|
|
1050
|
+
...options,
|
|
1051
|
+
url: "/v1/accounts/{accountId}/telegram-commands"
|
|
1052
|
+
});
|
|
1053
|
+
};
|
|
1054
|
+
var listInboxComments = (options) => {
|
|
1055
|
+
return (options?.client ?? client).get({
|
|
1056
|
+
...options,
|
|
1057
|
+
url: "/v1/inbox/comments"
|
|
1058
|
+
});
|
|
1059
|
+
};
|
|
1060
|
+
var getInboxPostComments = (options) => {
|
|
1061
|
+
return (options?.client ?? client).get({
|
|
1062
|
+
...options,
|
|
1063
|
+
url: "/v1/inbox/comments/{postId}"
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
var replyToInboxPost = (options) => {
|
|
1067
|
+
return (options?.client ?? client).post({
|
|
1068
|
+
...options,
|
|
1069
|
+
url: "/v1/inbox/comments/{postId}"
|
|
1070
|
+
});
|
|
1071
|
+
};
|
|
1072
|
+
var deleteInboxComment = (options) => {
|
|
1073
|
+
return (options?.client ?? client).delete({
|
|
1074
|
+
...options,
|
|
1075
|
+
url: "/v1/inbox/comments/{postId}"
|
|
1076
|
+
});
|
|
1077
|
+
};
|
|
1078
|
+
var hideInboxComment = (options) => {
|
|
1079
|
+
return (options?.client ?? client).post({
|
|
1080
|
+
...options,
|
|
1081
|
+
url: "/v1/inbox/comments/{postId}/{commentId}/hide"
|
|
1082
|
+
});
|
|
1083
|
+
};
|
|
1084
|
+
var unhideInboxComment = (options) => {
|
|
1085
|
+
return (options?.client ?? client).delete({
|
|
1086
|
+
...options,
|
|
1087
|
+
url: "/v1/inbox/comments/{postId}/{commentId}/hide"
|
|
1088
|
+
});
|
|
1089
|
+
};
|
|
1090
|
+
var likeInboxComment = (options) => {
|
|
1091
|
+
return (options?.client ?? client).post({
|
|
1092
|
+
...options,
|
|
1093
|
+
url: "/v1/inbox/comments/{postId}/{commentId}/like"
|
|
1094
|
+
});
|
|
1095
|
+
};
|
|
1096
|
+
var unlikeInboxComment = (options) => {
|
|
1097
|
+
return (options?.client ?? client).delete({
|
|
1098
|
+
...options,
|
|
1099
|
+
url: "/v1/inbox/comments/{postId}/{commentId}/like"
|
|
1100
|
+
});
|
|
1101
|
+
};
|
|
1102
|
+
var sendPrivateReplyToComment = (options) => {
|
|
1103
|
+
return (options?.client ?? client).post({
|
|
1104
|
+
...options,
|
|
1105
|
+
url: "/v1/inbox/comments/{postId}/{commentId}/private-reply"
|
|
1106
|
+
});
|
|
1107
|
+
};
|
|
1108
|
+
var retweetPost = (options) => {
|
|
1109
|
+
return (options?.client ?? client).post({
|
|
1110
|
+
...options,
|
|
1111
|
+
url: "/v1/twitter/retweet"
|
|
1112
|
+
});
|
|
1113
|
+
};
|
|
1114
|
+
var undoRetweet = (options) => {
|
|
1115
|
+
return (options?.client ?? client).delete({
|
|
1116
|
+
...options,
|
|
1117
|
+
url: "/v1/twitter/retweet"
|
|
1118
|
+
});
|
|
1119
|
+
};
|
|
1120
|
+
var bookmarkPost = (options) => {
|
|
1121
|
+
return (options?.client ?? client).post({
|
|
1122
|
+
...options,
|
|
1123
|
+
url: "/v1/twitter/bookmark"
|
|
1124
|
+
});
|
|
1125
|
+
};
|
|
1126
|
+
var removeBookmark = (options) => {
|
|
1127
|
+
return (options?.client ?? client).delete({
|
|
1128
|
+
...options,
|
|
1129
|
+
url: "/v1/twitter/bookmark"
|
|
1130
|
+
});
|
|
1131
|
+
};
|
|
1132
|
+
var followUser = (options) => {
|
|
1133
|
+
return (options?.client ?? client).post({
|
|
1134
|
+
...options,
|
|
1135
|
+
url: "/v1/twitter/follow"
|
|
1136
|
+
});
|
|
1137
|
+
};
|
|
1138
|
+
var unfollowUser = (options) => {
|
|
1139
|
+
return (options?.client ?? client).delete({
|
|
1140
|
+
...options,
|
|
1141
|
+
url: "/v1/twitter/follow"
|
|
1142
|
+
});
|
|
1143
|
+
};
|
|
1144
|
+
var listInboxReviews = (options) => {
|
|
1145
|
+
return (options?.client ?? client).get({
|
|
1146
|
+
...options,
|
|
1147
|
+
url: "/v1/inbox/reviews"
|
|
1148
|
+
});
|
|
1149
|
+
};
|
|
1150
|
+
var replyToInboxReview = (options) => {
|
|
1151
|
+
return (options?.client ?? client).post({
|
|
1152
|
+
...options,
|
|
1153
|
+
url: "/v1/inbox/reviews/{reviewId}/reply"
|
|
1154
|
+
});
|
|
1155
|
+
};
|
|
1156
|
+
var deleteInboxReviewReply = (options) => {
|
|
1157
|
+
return (options?.client ?? client).delete({
|
|
1158
|
+
...options,
|
|
1159
|
+
url: "/v1/inbox/reviews/{reviewId}/reply"
|
|
1160
|
+
});
|
|
1161
|
+
};
|
|
1162
|
+
var sendWhatsAppBulk = (options) => {
|
|
1163
|
+
return (options?.client ?? client).post({
|
|
1164
|
+
...options,
|
|
1165
|
+
url: "/v1/whatsapp/bulk"
|
|
1166
|
+
});
|
|
1167
|
+
};
|
|
1168
|
+
var getWhatsAppContacts = (options) => {
|
|
1169
|
+
return (options?.client ?? client).get({
|
|
1170
|
+
...options,
|
|
1171
|
+
url: "/v1/whatsapp/contacts"
|
|
1172
|
+
});
|
|
1173
|
+
};
|
|
1174
|
+
var createWhatsAppContact = (options) => {
|
|
1175
|
+
return (options?.client ?? client).post({
|
|
1176
|
+
...options,
|
|
1177
|
+
url: "/v1/whatsapp/contacts"
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
var getWhatsAppContact = (options) => {
|
|
1181
|
+
return (options?.client ?? client).get({
|
|
1182
|
+
...options,
|
|
1183
|
+
url: "/v1/whatsapp/contacts/{contactId}"
|
|
1184
|
+
});
|
|
1185
|
+
};
|
|
1186
|
+
var updateWhatsAppContact = (options) => {
|
|
1187
|
+
return (options?.client ?? client).put({
|
|
1188
|
+
...options,
|
|
1189
|
+
url: "/v1/whatsapp/contacts/{contactId}"
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
var deleteWhatsAppContact = (options) => {
|
|
1193
|
+
return (options?.client ?? client).delete({
|
|
1194
|
+
...options,
|
|
1195
|
+
url: "/v1/whatsapp/contacts/{contactId}"
|
|
1196
|
+
});
|
|
1197
|
+
};
|
|
1198
|
+
var importWhatsAppContacts = (options) => {
|
|
1199
|
+
return (options?.client ?? client).post({
|
|
1200
|
+
...options,
|
|
1201
|
+
url: "/v1/whatsapp/contacts/import"
|
|
1202
|
+
});
|
|
1203
|
+
};
|
|
1204
|
+
var bulkUpdateWhatsAppContacts = (options) => {
|
|
1205
|
+
return (options?.client ?? client).post({
|
|
1206
|
+
...options,
|
|
1207
|
+
url: "/v1/whatsapp/contacts/bulk"
|
|
1208
|
+
});
|
|
1209
|
+
};
|
|
1210
|
+
var bulkDeleteWhatsAppContacts = (options) => {
|
|
1211
|
+
return (options?.client ?? client).delete({
|
|
1212
|
+
...options,
|
|
1213
|
+
url: "/v1/whatsapp/contacts/bulk"
|
|
1214
|
+
});
|
|
1215
|
+
};
|
|
1216
|
+
var getWhatsAppGroups = (options) => {
|
|
1217
|
+
return (options?.client ?? client).get({
|
|
1218
|
+
...options,
|
|
1219
|
+
url: "/v1/whatsapp/groups"
|
|
1220
|
+
});
|
|
1221
|
+
};
|
|
1222
|
+
var renameWhatsAppGroup = (options) => {
|
|
1223
|
+
return (options?.client ?? client).post({
|
|
1224
|
+
...options,
|
|
1225
|
+
url: "/v1/whatsapp/groups"
|
|
1226
|
+
});
|
|
1227
|
+
};
|
|
1228
|
+
var deleteWhatsAppGroup = (options) => {
|
|
1229
|
+
return (options?.client ?? client).delete({
|
|
1230
|
+
...options,
|
|
1231
|
+
url: "/v1/whatsapp/groups"
|
|
1232
|
+
});
|
|
1233
|
+
};
|
|
1234
|
+
var getWhatsAppTemplates = (options) => {
|
|
1235
|
+
return (options?.client ?? client).get({
|
|
1236
|
+
...options,
|
|
1237
|
+
url: "/v1/whatsapp/templates"
|
|
1238
|
+
});
|
|
1239
|
+
};
|
|
1240
|
+
var createWhatsAppTemplate = (options) => {
|
|
1241
|
+
return (options?.client ?? client).post({
|
|
1242
|
+
...options,
|
|
1243
|
+
url: "/v1/whatsapp/templates"
|
|
1244
|
+
});
|
|
1245
|
+
};
|
|
1246
|
+
var getWhatsAppTemplate = (options) => {
|
|
1247
|
+
return (options?.client ?? client).get({
|
|
1248
|
+
...options,
|
|
1249
|
+
url: "/v1/whatsapp/templates/{templateName}"
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
var updateWhatsAppTemplate = (options) => {
|
|
1253
|
+
return (options?.client ?? client).patch({
|
|
1254
|
+
...options,
|
|
1255
|
+
url: "/v1/whatsapp/templates/{templateName}"
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
var deleteWhatsAppTemplate = (options) => {
|
|
1259
|
+
return (options?.client ?? client).delete({
|
|
1260
|
+
...options,
|
|
1261
|
+
url: "/v1/whatsapp/templates/{templateName}"
|
|
1262
|
+
});
|
|
1263
|
+
};
|
|
1264
|
+
var getWhatsAppBroadcasts = (options) => {
|
|
1265
|
+
return (options?.client ?? client).get({
|
|
1266
|
+
...options,
|
|
1267
|
+
url: "/v1/whatsapp/broadcasts"
|
|
1268
|
+
});
|
|
1269
|
+
};
|
|
1270
|
+
var createWhatsAppBroadcast = (options) => {
|
|
1271
|
+
return (options?.client ?? client).post({
|
|
1272
|
+
...options,
|
|
1273
|
+
url: "/v1/whatsapp/broadcasts"
|
|
1274
|
+
});
|
|
1275
|
+
};
|
|
1276
|
+
var getWhatsAppBroadcast = (options) => {
|
|
1277
|
+
return (options?.client ?? client).get({
|
|
1278
|
+
...options,
|
|
1279
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}"
|
|
1280
|
+
});
|
|
1281
|
+
};
|
|
1282
|
+
var deleteWhatsAppBroadcast = (options) => {
|
|
1283
|
+
return (options?.client ?? client).delete({
|
|
1284
|
+
...options,
|
|
1285
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}"
|
|
1286
|
+
});
|
|
1287
|
+
};
|
|
1288
|
+
var sendWhatsAppBroadcast = (options) => {
|
|
1289
|
+
return (options?.client ?? client).post({
|
|
1290
|
+
...options,
|
|
1291
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/send"
|
|
1292
|
+
});
|
|
1293
|
+
};
|
|
1294
|
+
var scheduleWhatsAppBroadcast = (options) => {
|
|
1295
|
+
return (options?.client ?? client).post({
|
|
1296
|
+
...options,
|
|
1297
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/schedule"
|
|
1298
|
+
});
|
|
1299
|
+
};
|
|
1300
|
+
var cancelWhatsAppBroadcastSchedule = (options) => {
|
|
1301
|
+
return (options?.client ?? client).delete({
|
|
1302
|
+
...options,
|
|
1303
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/schedule"
|
|
1304
|
+
});
|
|
1305
|
+
};
|
|
1306
|
+
var getWhatsAppBroadcastRecipients = (options) => {
|
|
1307
|
+
return (options?.client ?? client).get({
|
|
1308
|
+
...options,
|
|
1309
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/recipients"
|
|
1310
|
+
});
|
|
1311
|
+
};
|
|
1312
|
+
var addWhatsAppBroadcastRecipients = (options) => {
|
|
1313
|
+
return (options?.client ?? client).patch({
|
|
1314
|
+
...options,
|
|
1315
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/recipients"
|
|
1316
|
+
});
|
|
1317
|
+
};
|
|
1318
|
+
var removeWhatsAppBroadcastRecipients = (options) => {
|
|
1319
|
+
return (options?.client ?? client).delete({
|
|
1320
|
+
...options,
|
|
1321
|
+
url: "/v1/whatsapp/broadcasts/{broadcastId}/recipients"
|
|
1322
|
+
});
|
|
1323
|
+
};
|
|
1324
|
+
var getWhatsAppBusinessProfile = (options) => {
|
|
1325
|
+
return (options?.client ?? client).get({
|
|
1326
|
+
...options,
|
|
1327
|
+
url: "/v1/whatsapp/business-profile"
|
|
1328
|
+
});
|
|
1329
|
+
};
|
|
1330
|
+
var updateWhatsAppBusinessProfile = (options) => {
|
|
1331
|
+
return (options?.client ?? client).post({
|
|
1332
|
+
...options,
|
|
1333
|
+
url: "/v1/whatsapp/business-profile"
|
|
1334
|
+
});
|
|
1335
|
+
};
|
|
1336
|
+
var uploadWhatsAppProfilePhoto = (options) => {
|
|
1337
|
+
return (options?.client ?? client).post({
|
|
1338
|
+
...options,
|
|
1339
|
+
...W,
|
|
1340
|
+
headers: {
|
|
1341
|
+
"Content-Type": null,
|
|
1342
|
+
...options?.headers
|
|
1343
|
+
},
|
|
1344
|
+
url: "/v1/whatsapp/business-profile/photo"
|
|
1345
|
+
});
|
|
1346
|
+
};
|
|
1347
|
+
var getWhatsAppDisplayName = (options) => {
|
|
1348
|
+
return (options?.client ?? client).get({
|
|
1349
|
+
...options,
|
|
1350
|
+
url: "/v1/whatsapp/business-profile/display-name"
|
|
1351
|
+
});
|
|
1352
|
+
};
|
|
1353
|
+
var updateWhatsAppDisplayName = (options) => {
|
|
1354
|
+
return (options?.client ?? client).post({
|
|
1355
|
+
...options,
|
|
1356
|
+
url: "/v1/whatsapp/business-profile/display-name"
|
|
1357
|
+
});
|
|
1358
|
+
};
|
|
1359
|
+
var getWhatsAppPhoneNumbers = (options) => {
|
|
1360
|
+
return (options?.client ?? client).get({
|
|
1361
|
+
...options,
|
|
1362
|
+
url: "/v1/whatsapp/phone-numbers"
|
|
1363
|
+
});
|
|
1364
|
+
};
|
|
1365
|
+
var purchaseWhatsAppPhoneNumber = (options) => {
|
|
1366
|
+
return (options?.client ?? client).post({
|
|
1367
|
+
...options,
|
|
1368
|
+
url: "/v1/whatsapp/phone-numbers/purchase"
|
|
1369
|
+
});
|
|
1370
|
+
};
|
|
1371
|
+
var getWhatsAppPhoneNumber = (options) => {
|
|
1372
|
+
return (options?.client ?? client).get({
|
|
1373
|
+
...options,
|
|
1374
|
+
url: "/v1/whatsapp/phone-numbers/{phoneNumberId}"
|
|
1375
|
+
});
|
|
1376
|
+
};
|
|
1377
|
+
var releaseWhatsAppPhoneNumber = (options) => {
|
|
1378
|
+
return (options?.client ?? client).delete({
|
|
1379
|
+
...options,
|
|
1380
|
+
url: "/v1/whatsapp/phone-numbers/{phoneNumberId}"
|
|
1381
|
+
});
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
// src/errors.ts
|
|
1385
|
+
var LateApiError = class _LateApiError extends Error {
|
|
1386
|
+
constructor(message, statusCode, code, details) {
|
|
1387
|
+
super(message);
|
|
1388
|
+
this.name = "LateApiError";
|
|
1389
|
+
this.statusCode = statusCode;
|
|
1390
|
+
this.code = code;
|
|
1391
|
+
this.details = details;
|
|
1392
|
+
if (Error.captureStackTrace) {
|
|
1393
|
+
Error.captureStackTrace(this, _LateApiError);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Check if this is a rate limit error
|
|
1398
|
+
*/
|
|
1399
|
+
isRateLimited() {
|
|
1400
|
+
return this.statusCode === 429;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Check if this is an authentication error
|
|
1404
|
+
*/
|
|
1405
|
+
isAuthError() {
|
|
1406
|
+
return this.statusCode === 401;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Check if this is a permission/access error
|
|
1410
|
+
*/
|
|
1411
|
+
isForbidden() {
|
|
1412
|
+
return this.statusCode === 403;
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Check if this is a not found error
|
|
1416
|
+
*/
|
|
1417
|
+
isNotFound() {
|
|
1418
|
+
return this.statusCode === 404;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Check if this is a validation error
|
|
1422
|
+
*/
|
|
1423
|
+
isValidationError() {
|
|
1424
|
+
return this.statusCode === 400;
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Check if this is a payment required error
|
|
1428
|
+
*/
|
|
1429
|
+
isPaymentRequired() {
|
|
1430
|
+
return this.statusCode === 402;
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
var RateLimitError = class extends LateApiError {
|
|
1434
|
+
constructor(message, limit, remaining, resetAt) {
|
|
1435
|
+
super(message, 429, "rate_limit_exceeded");
|
|
1436
|
+
this.name = "RateLimitError";
|
|
1437
|
+
this.limit = limit;
|
|
1438
|
+
this.remaining = remaining;
|
|
1439
|
+
this.resetAt = resetAt;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Get seconds until rate limit resets
|
|
1443
|
+
*/
|
|
1444
|
+
getSecondsUntilReset() {
|
|
1445
|
+
if (!this.resetAt) return void 0;
|
|
1446
|
+
return Math.max(0, Math.ceil((this.resetAt.getTime() - Date.now()) / 1e3));
|
|
1447
|
+
}
|
|
1448
|
+
};
|
|
1449
|
+
var ValidationError = class extends LateApiError {
|
|
1450
|
+
constructor(message, fields) {
|
|
1451
|
+
super(message, 400, "validation_error", { fields });
|
|
1452
|
+
this.name = "ValidationError";
|
|
1453
|
+
this.fields = fields;
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
function parseApiError(response, body) {
|
|
1457
|
+
const message = body?.error || body?.message || response.statusText || "Unknown error";
|
|
1458
|
+
const code = body?.code;
|
|
1459
|
+
const details = body?.details;
|
|
1460
|
+
if (response.status === 429) {
|
|
1461
|
+
const limit = response.headers.get("X-RateLimit-Limit");
|
|
1462
|
+
const remaining = response.headers.get("X-RateLimit-Remaining");
|
|
1463
|
+
const reset = response.headers.get("X-RateLimit-Reset");
|
|
1464
|
+
return new RateLimitError(
|
|
1465
|
+
message,
|
|
1466
|
+
limit ? parseInt(limit, 10) : void 0,
|
|
1467
|
+
remaining ? parseInt(remaining, 10) : void 0,
|
|
1468
|
+
reset ? new Date(parseInt(reset, 10) * 1e3) : void 0
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
if (response.status === 400 && details?.fields) {
|
|
1472
|
+
return new ValidationError(message, details.fields);
|
|
1473
|
+
}
|
|
1474
|
+
return new LateApiError(message, response.status, code, details);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
// src/client.ts
|
|
1478
|
+
var Late = class {
|
|
1479
|
+
/**
|
|
1480
|
+
* Create a new Late API client.
|
|
1481
|
+
*
|
|
1482
|
+
* @param options - Configuration options for the client
|
|
1483
|
+
*/
|
|
1484
|
+
constructor(options = {}) {
|
|
1485
|
+
/**
|
|
1486
|
+
* Tools API - Media download and utilities
|
|
1487
|
+
*/
|
|
1488
|
+
this.tools = {
|
|
1489
|
+
downloadYouTubeVideo,
|
|
1490
|
+
getYouTubeTranscript,
|
|
1491
|
+
downloadInstagramMedia,
|
|
1492
|
+
checkInstagramHashtags,
|
|
1493
|
+
downloadTikTokVideo,
|
|
1494
|
+
downloadTwitterMedia,
|
|
1495
|
+
downloadFacebookVideo,
|
|
1496
|
+
downloadLinkedInVideo,
|
|
1497
|
+
downloadBlueskyMedia
|
|
1498
|
+
};
|
|
1499
|
+
/**
|
|
1500
|
+
* validate API
|
|
1501
|
+
*/
|
|
1502
|
+
this.validate = {
|
|
1503
|
+
validatePostLength,
|
|
1504
|
+
validatePost,
|
|
1505
|
+
validateMedia,
|
|
1506
|
+
validateSubreddit
|
|
1507
|
+
};
|
|
1508
|
+
/**
|
|
1509
|
+
* Analytics API - Get performance metrics
|
|
1510
|
+
*/
|
|
1511
|
+
this.analytics = {
|
|
1512
|
+
getAnalytics,
|
|
1513
|
+
getYouTubeDailyViews,
|
|
1514
|
+
getDailyMetrics,
|
|
1515
|
+
getBestTimeToPost,
|
|
1516
|
+
getContentDecay,
|
|
1517
|
+
getPostingFrequency,
|
|
1518
|
+
getPostTimeline,
|
|
1519
|
+
getLinkedInAggregateAnalytics,
|
|
1520
|
+
getLinkedInPostAnalytics,
|
|
1521
|
+
getLinkedInPostReactions
|
|
1522
|
+
};
|
|
1523
|
+
/**
|
|
1524
|
+
* Account Groups API - Organize accounts into groups
|
|
1525
|
+
*/
|
|
1526
|
+
this.accountGroups = {
|
|
1527
|
+
listAccountGroups,
|
|
1528
|
+
createAccountGroup,
|
|
1529
|
+
updateAccountGroup,
|
|
1530
|
+
deleteAccountGroup
|
|
1531
|
+
};
|
|
1532
|
+
/**
|
|
1533
|
+
* Media API - Upload and manage media files
|
|
1534
|
+
*/
|
|
1535
|
+
this.media = {
|
|
1536
|
+
getMediaPresignedUrl
|
|
1537
|
+
};
|
|
1538
|
+
/**
|
|
1539
|
+
* Reddit API - Search and feed
|
|
1540
|
+
*/
|
|
1541
|
+
this.reddit = {
|
|
1542
|
+
searchReddit,
|
|
1543
|
+
getRedditFeed
|
|
1544
|
+
};
|
|
1545
|
+
/**
|
|
1546
|
+
* Usage API - Get usage statistics
|
|
1547
|
+
*/
|
|
1548
|
+
this.usage = {
|
|
1549
|
+
getUsageStats
|
|
1550
|
+
};
|
|
1551
|
+
/**
|
|
1552
|
+
* Posts API - Create, schedule, and manage social media posts
|
|
1553
|
+
*/
|
|
1554
|
+
this.posts = {
|
|
1555
|
+
listPosts,
|
|
1556
|
+
createPost,
|
|
1557
|
+
getPost,
|
|
1558
|
+
updatePost,
|
|
1559
|
+
deletePost,
|
|
1560
|
+
bulkUploadPosts,
|
|
1561
|
+
retryPost,
|
|
1562
|
+
unpublishPost
|
|
1563
|
+
};
|
|
1564
|
+
/**
|
|
1565
|
+
* Users API - User management
|
|
1566
|
+
*/
|
|
1567
|
+
this.users = {
|
|
1568
|
+
listUsers,
|
|
1569
|
+
getUser
|
|
1570
|
+
};
|
|
1571
|
+
/**
|
|
1572
|
+
* Profiles API - Manage workspace profiles
|
|
1573
|
+
*/
|
|
1574
|
+
this.profiles = {
|
|
1575
|
+
listProfiles,
|
|
1576
|
+
createProfile,
|
|
1577
|
+
getProfile,
|
|
1578
|
+
updateProfile,
|
|
1579
|
+
deleteProfile
|
|
1580
|
+
};
|
|
1581
|
+
/**
|
|
1582
|
+
* Accounts API - Manage connected social media accounts
|
|
1583
|
+
*/
|
|
1584
|
+
this.accounts = {
|
|
1585
|
+
listAccounts,
|
|
1586
|
+
getFollowerStats,
|
|
1587
|
+
updateAccount,
|
|
1588
|
+
deleteAccount,
|
|
1589
|
+
getAllAccountsHealth,
|
|
1590
|
+
getAccountHealth,
|
|
1591
|
+
getGoogleBusinessReviews,
|
|
1592
|
+
getLinkedInMentions
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* API Keys API - Manage API keys
|
|
1596
|
+
*/
|
|
1597
|
+
this.apiKeys = {
|
|
1598
|
+
listApiKeys,
|
|
1599
|
+
createApiKey,
|
|
1600
|
+
deleteApiKey
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* Invites API - Team invitations
|
|
1604
|
+
*/
|
|
1605
|
+
this.invites = {
|
|
1606
|
+
createInviteToken
|
|
1607
|
+
};
|
|
1608
|
+
/**
|
|
1609
|
+
* Connect API - OAuth connection flows
|
|
1610
|
+
*/
|
|
1611
|
+
this.connect = {
|
|
1612
|
+
getConnectUrl,
|
|
1613
|
+
handleOAuthCallback,
|
|
1614
|
+
getPendingOAuthData,
|
|
1615
|
+
connectWhatsAppCredentials,
|
|
1616
|
+
getFacebookPages,
|
|
1617
|
+
updateFacebookPage,
|
|
1618
|
+
getLinkedInOrganizations,
|
|
1619
|
+
updateLinkedInOrganization,
|
|
1620
|
+
getPinterestBoards,
|
|
1621
|
+
updatePinterestBoards,
|
|
1622
|
+
getGmbLocations,
|
|
1623
|
+
updateGmbLocation,
|
|
1624
|
+
getRedditSubreddits,
|
|
1625
|
+
updateRedditSubreddits,
|
|
1626
|
+
getRedditFlairs,
|
|
1627
|
+
facebook: {
|
|
1628
|
+
listFacebookPages,
|
|
1629
|
+
selectFacebookPage
|
|
1630
|
+
},
|
|
1631
|
+
googleBusiness: {
|
|
1632
|
+
listGoogleBusinessLocations,
|
|
1633
|
+
selectGoogleBusinessLocation
|
|
1634
|
+
},
|
|
1635
|
+
linkedin: {
|
|
1636
|
+
listLinkedInOrganizations,
|
|
1637
|
+
selectLinkedInOrganization
|
|
1638
|
+
},
|
|
1639
|
+
pinterest: {
|
|
1640
|
+
listPinterestBoardsForSelection,
|
|
1641
|
+
selectPinterestBoard
|
|
1642
|
+
},
|
|
1643
|
+
snapchat: {
|
|
1644
|
+
listSnapchatProfiles,
|
|
1645
|
+
selectSnapchatProfile
|
|
1646
|
+
},
|
|
1647
|
+
bluesky: {
|
|
1648
|
+
connectBlueskyCredentials
|
|
1649
|
+
},
|
|
1650
|
+
telegram: {
|
|
1651
|
+
getTelegramConnectStatus,
|
|
1652
|
+
initiateTelegramConnect,
|
|
1653
|
+
completeTelegramConnect
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
/**
|
|
1657
|
+
* gmbfoodmenus API
|
|
1658
|
+
*/
|
|
1659
|
+
this.gmbfoodmenus = {
|
|
1660
|
+
getGoogleBusinessFoodMenus,
|
|
1661
|
+
updateGoogleBusinessFoodMenus
|
|
1662
|
+
};
|
|
1663
|
+
/**
|
|
1664
|
+
* gmblocationdetails API
|
|
1665
|
+
*/
|
|
1666
|
+
this.gmblocationdetails = {
|
|
1667
|
+
getGoogleBusinessLocationDetails,
|
|
1668
|
+
updateGoogleBusinessLocationDetails
|
|
1669
|
+
};
|
|
1670
|
+
/**
|
|
1671
|
+
* gmbmedia API
|
|
1672
|
+
*/
|
|
1673
|
+
this.gmbmedia = {
|
|
1674
|
+
listGoogleBusinessMedia,
|
|
1675
|
+
createGoogleBusinessMedia,
|
|
1676
|
+
deleteGoogleBusinessMedia
|
|
1677
|
+
};
|
|
1678
|
+
/**
|
|
1679
|
+
* gmbattributes API
|
|
1680
|
+
*/
|
|
1681
|
+
this.gmbattributes = {
|
|
1682
|
+
getGoogleBusinessAttributes,
|
|
1683
|
+
updateGoogleBusinessAttributes
|
|
1684
|
+
};
|
|
1685
|
+
/**
|
|
1686
|
+
* gmbplaceactions API
|
|
1687
|
+
*/
|
|
1688
|
+
this.gmbplaceactions = {
|
|
1689
|
+
listGoogleBusinessPlaceActions,
|
|
1690
|
+
createGoogleBusinessPlaceAction,
|
|
1691
|
+
deleteGoogleBusinessPlaceAction
|
|
1692
|
+
};
|
|
1693
|
+
/**
|
|
1694
|
+
* Queue API - Manage posting queue
|
|
1695
|
+
*/
|
|
1696
|
+
this.queue = {
|
|
1697
|
+
listQueueSlots,
|
|
1698
|
+
createQueueSlot,
|
|
1699
|
+
updateQueueSlot,
|
|
1700
|
+
deleteQueueSlot,
|
|
1701
|
+
previewQueue,
|
|
1702
|
+
getNextQueueSlot
|
|
1703
|
+
};
|
|
1704
|
+
/**
|
|
1705
|
+
* Webhooks API - Configure event webhooks
|
|
1706
|
+
*/
|
|
1707
|
+
this.webhooks = {
|
|
1708
|
+
getWebhookSettings,
|
|
1709
|
+
createWebhookSettings,
|
|
1710
|
+
updateWebhookSettings,
|
|
1711
|
+
deleteWebhookSettings,
|
|
1712
|
+
testWebhook,
|
|
1713
|
+
getWebhookLogs
|
|
1714
|
+
};
|
|
1715
|
+
/**
|
|
1716
|
+
* Logs API - Publishing logs
|
|
1717
|
+
*/
|
|
1718
|
+
this.logs = {
|
|
1719
|
+
listPostsLogs,
|
|
1720
|
+
listConnectionLogs,
|
|
1721
|
+
getPostLogs
|
|
1722
|
+
};
|
|
1723
|
+
/**
|
|
1724
|
+
* messages API
|
|
1725
|
+
*/
|
|
1726
|
+
this.messages = {
|
|
1727
|
+
listInboxConversations,
|
|
1728
|
+
getInboxConversation,
|
|
1729
|
+
updateInboxConversation,
|
|
1730
|
+
getInboxConversationMessages,
|
|
1731
|
+
sendInboxMessage,
|
|
1732
|
+
editInboxMessage
|
|
1733
|
+
};
|
|
1734
|
+
/**
|
|
1735
|
+
* accountsettings API
|
|
1736
|
+
*/
|
|
1737
|
+
this.accountsettings = {
|
|
1738
|
+
getMessengerMenu,
|
|
1739
|
+
setMessengerMenu,
|
|
1740
|
+
deleteMessengerMenu,
|
|
1741
|
+
getInstagramIceBreakers,
|
|
1742
|
+
setInstagramIceBreakers,
|
|
1743
|
+
deleteInstagramIceBreakers,
|
|
1744
|
+
getTelegramCommands,
|
|
1745
|
+
setTelegramCommands,
|
|
1746
|
+
deleteTelegramCommands
|
|
1747
|
+
};
|
|
1748
|
+
/**
|
|
1749
|
+
* comments API
|
|
1750
|
+
*/
|
|
1751
|
+
this.comments = {
|
|
1752
|
+
listInboxComments,
|
|
1753
|
+
getInboxPostComments,
|
|
1754
|
+
replyToInboxPost,
|
|
1755
|
+
deleteInboxComment,
|
|
1756
|
+
hideInboxComment,
|
|
1757
|
+
unhideInboxComment,
|
|
1758
|
+
likeInboxComment,
|
|
1759
|
+
unlikeInboxComment,
|
|
1760
|
+
sendPrivateReplyToComment
|
|
1761
|
+
};
|
|
1762
|
+
/**
|
|
1763
|
+
* twitterengagement API
|
|
1764
|
+
*/
|
|
1765
|
+
this.twitterengagement = {
|
|
1766
|
+
retweetPost,
|
|
1767
|
+
undoRetweet,
|
|
1768
|
+
bookmarkPost,
|
|
1769
|
+
removeBookmark,
|
|
1770
|
+
followUser,
|
|
1771
|
+
unfollowUser
|
|
1772
|
+
};
|
|
1773
|
+
/**
|
|
1774
|
+
* reviews API
|
|
1775
|
+
*/
|
|
1776
|
+
this.reviews = {
|
|
1777
|
+
listInboxReviews,
|
|
1778
|
+
replyToInboxReview,
|
|
1779
|
+
deleteInboxReviewReply
|
|
1780
|
+
};
|
|
1781
|
+
/**
|
|
1782
|
+
* whatsapp API
|
|
1783
|
+
*/
|
|
1784
|
+
this.whatsapp = {
|
|
1785
|
+
sendWhatsAppBulk,
|
|
1786
|
+
getWhatsAppContacts,
|
|
1787
|
+
createWhatsAppContact,
|
|
1788
|
+
getWhatsAppContact,
|
|
1789
|
+
updateWhatsAppContact,
|
|
1790
|
+
deleteWhatsAppContact,
|
|
1791
|
+
importWhatsAppContacts,
|
|
1792
|
+
bulkUpdateWhatsAppContacts,
|
|
1793
|
+
bulkDeleteWhatsAppContacts,
|
|
1794
|
+
getWhatsAppGroups,
|
|
1795
|
+
renameWhatsAppGroup,
|
|
1796
|
+
deleteWhatsAppGroup,
|
|
1797
|
+
getWhatsAppTemplates,
|
|
1798
|
+
createWhatsAppTemplate,
|
|
1799
|
+
getWhatsAppTemplate,
|
|
1800
|
+
updateWhatsAppTemplate,
|
|
1801
|
+
deleteWhatsAppTemplate,
|
|
1802
|
+
getWhatsAppBroadcasts,
|
|
1803
|
+
createWhatsAppBroadcast,
|
|
1804
|
+
getWhatsAppBroadcast,
|
|
1805
|
+
deleteWhatsAppBroadcast,
|
|
1806
|
+
sendWhatsAppBroadcast,
|
|
1807
|
+
scheduleWhatsAppBroadcast,
|
|
1808
|
+
cancelWhatsAppBroadcastSchedule,
|
|
1809
|
+
getWhatsAppBroadcastRecipients,
|
|
1810
|
+
addWhatsAppBroadcastRecipients,
|
|
1811
|
+
removeWhatsAppBroadcastRecipients,
|
|
1812
|
+
getWhatsAppBusinessProfile,
|
|
1813
|
+
updateWhatsAppBusinessProfile,
|
|
1814
|
+
uploadWhatsAppProfilePhoto,
|
|
1815
|
+
getWhatsAppDisplayName,
|
|
1816
|
+
updateWhatsAppDisplayName
|
|
1817
|
+
};
|
|
1818
|
+
/**
|
|
1819
|
+
* whatsappphonenumbers API
|
|
1820
|
+
*/
|
|
1821
|
+
this.whatsappphonenumbers = {
|
|
1822
|
+
getWhatsAppPhoneNumbers,
|
|
1823
|
+
purchaseWhatsAppPhoneNumber,
|
|
1824
|
+
getWhatsAppPhoneNumber,
|
|
1825
|
+
releaseWhatsAppPhoneNumber
|
|
1826
|
+
};
|
|
1827
|
+
const apiKey = options.apiKey ?? process.env["LATE_API_KEY"];
|
|
1828
|
+
if (!apiKey) {
|
|
1829
|
+
throw new LateApiError(
|
|
1830
|
+
"The LATE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Late client with an apiKey option, like new Late({ apiKey: 'sk_...' }).",
|
|
1831
|
+
401,
|
|
1832
|
+
"missing_api_key"
|
|
1833
|
+
);
|
|
1834
|
+
}
|
|
1835
|
+
this.apiKey = apiKey;
|
|
1836
|
+
this.baseURL = options.baseURL ?? "https://getlate.dev/api";
|
|
1837
|
+
this._options = options;
|
|
1838
|
+
client.setConfig({
|
|
1839
|
+
baseUrl: this.baseURL
|
|
1840
|
+
});
|
|
1841
|
+
client.interceptors.request.use((request) => {
|
|
1842
|
+
request.headers.set("Authorization", `Bearer ${this.apiKey}`);
|
|
1843
|
+
if (options.defaultHeaders) {
|
|
1844
|
+
for (const [key, value] of Object.entries(options.defaultHeaders)) {
|
|
1845
|
+
request.headers.set(key, value);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
return request;
|
|
1849
|
+
});
|
|
1850
|
+
client.interceptors.response.use(async (response) => {
|
|
1851
|
+
if (!response.ok) {
|
|
1852
|
+
let body;
|
|
1853
|
+
try {
|
|
1854
|
+
body = await response.clone().json();
|
|
1855
|
+
} catch {
|
|
1856
|
+
}
|
|
1857
|
+
throw parseApiError(response, body);
|
|
1858
|
+
}
|
|
1859
|
+
return response;
|
|
1860
|
+
});
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1864
|
+
0 && (module.exports = {
|
|
1865
|
+
Late,
|
|
1866
|
+
LateApiError,
|
|
1867
|
+
RateLimitError,
|
|
1868
|
+
ValidationError,
|
|
1869
|
+
parseApiError
|
|
1870
|
+
});
|