naystack 1.8.12 → 1.8.13

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 (74) hide show
  1. package/README.md +189 -31
  2. package/dist/auth/index.cjs.js +158 -18
  3. package/dist/auth/index.d.mts +3 -1
  4. package/dist/auth/index.d.ts +3 -1
  5. package/dist/auth/index.esm.js +158 -18
  6. package/dist/auth/instagram/index.cjs.js +158 -18
  7. package/dist/auth/instagram/index.d.mts +6 -1
  8. package/dist/auth/instagram/index.d.ts +6 -1
  9. package/dist/auth/instagram/index.esm.js +158 -18
  10. package/dist/auth/instagram/route.cjs.js +158 -18
  11. package/dist/auth/instagram/route.d.mts +3 -1
  12. package/dist/auth/instagram/route.d.ts +3 -1
  13. package/dist/auth/instagram/route.esm.js +158 -18
  14. package/dist/auth/instagram/utils.cjs.js +2 -2
  15. package/dist/auth/instagram/utils.d.mts +13 -2
  16. package/dist/auth/instagram/utils.d.ts +13 -2
  17. package/dist/auth/instagram/utils.esm.js +2 -2
  18. package/dist/file/setup.d.mts +13 -5
  19. package/dist/file/setup.d.ts +13 -5
  20. package/dist/index.d.mts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/socials/index.cjs.js +298 -72
  23. package/dist/socials/index.d.mts +6 -4
  24. package/dist/socials/index.d.ts +6 -4
  25. package/dist/socials/index.esm.js +296 -72
  26. package/dist/socials/instagram/getters.cjs.js +76 -25
  27. package/dist/socials/instagram/getters.d.mts +56 -6
  28. package/dist/socials/instagram/getters.d.ts +56 -6
  29. package/dist/socials/instagram/getters.esm.js +74 -25
  30. package/dist/socials/instagram/setters.cjs.js +192 -14
  31. package/dist/socials/instagram/setters.d.mts +43 -3
  32. package/dist/socials/instagram/setters.d.ts +43 -3
  33. package/dist/socials/instagram/setters.esm.js +191 -14
  34. package/dist/socials/instagram/types.d.mts +48 -11
  35. package/dist/socials/instagram/types.d.ts +48 -11
  36. package/dist/socials/instagram/utils.cjs.js +28 -15
  37. package/dist/socials/instagram/utils.d.mts +7 -18
  38. package/dist/socials/instagram/utils.d.ts +7 -18
  39. package/dist/socials/instagram/utils.esm.js +26 -14
  40. package/dist/socials/instagram/webhook.cjs.js +1 -1
  41. package/dist/socials/instagram/webhook.esm.js +1 -1
  42. package/dist/socials/meta/container.cjs.js +82 -0
  43. package/dist/socials/meta/container.d.mts +38 -0
  44. package/dist/socials/meta/container.d.ts +38 -0
  45. package/dist/socials/meta/container.esm.js +57 -0
  46. package/dist/socials/meta/request.cjs.js +60 -0
  47. package/dist/socials/meta/request.d.mts +50 -0
  48. package/dist/socials/meta/request.d.ts +50 -0
  49. package/dist/socials/meta/request.esm.js +34 -0
  50. package/dist/socials/meta/types.cjs.js +18 -0
  51. package/dist/socials/meta/types.d.mts +47 -0
  52. package/dist/socials/meta/types.d.ts +47 -0
  53. package/dist/socials/meta/types.esm.js +0 -0
  54. package/dist/socials/{meta-webhook.cjs.js → meta/webhook.cjs.js} +4 -4
  55. package/dist/socials/{meta-webhook.esm.js → meta/webhook.esm.js} +1 -1
  56. package/dist/socials/threads/getters.cjs.js +36 -11
  57. package/dist/socials/threads/getters.d.mts +23 -2
  58. package/dist/socials/threads/getters.d.ts +23 -2
  59. package/dist/socials/threads/getters.esm.js +35 -11
  60. package/dist/socials/threads/setters.cjs.js +150 -44
  61. package/dist/socials/threads/setters.d.mts +25 -34
  62. package/dist/socials/threads/setters.d.ts +25 -34
  63. package/dist/socials/threads/setters.esm.js +149 -41
  64. package/dist/socials/threads/types.d.mts +40 -1
  65. package/dist/socials/threads/types.d.ts +40 -1
  66. package/dist/socials/threads/utils.cjs.js +29 -11
  67. package/dist/socials/threads/utils.d.mts +8 -17
  68. package/dist/socials/threads/utils.d.ts +8 -17
  69. package/dist/socials/threads/utils.esm.js +27 -10
  70. package/dist/socials/threads/webhook.cjs.js +1 -1
  71. package/dist/socials/threads/webhook.esm.js +1 -1
  72. package/package.json +1 -1
  73. /package/dist/socials/{meta-webhook.d.mts → meta/webhook.d.mts} +0 -0
  74. /package/dist/socials/{meta-webhook.d.ts → meta/webhook.d.ts} +0 -0
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/socials/index.ts
21
21
  var socials_exports = {};
22
22
  __export(socials_exports, {
23
+ canPublishToInstagram: () => canPublishToInstagram,
24
+ createInstagramPost: () => createInstagramPost,
23
25
  createThread: () => createThread,
24
26
  createThreadsPost: () => createThreadsPost,
25
27
  getInstagramConversation: () => getInstagramConversation,
@@ -38,39 +40,65 @@ __export(socials_exports, {
38
40
  });
39
41
  module.exports = __toCommonJS(socials_exports);
40
42
 
41
- // src/socials/instagram/utils.ts
42
- function getInstagramURL(token, path, params) {
43
- return `https://graph.instagram.com/v23.0/${path}?${Object.keys(params).map((key) => `${key}=${params[key]}`).join("&")}&access_token=${token}`;
44
- }
45
- function getInstagramData(token, path, params = {}, postData) {
46
- return fetch(getInstagramURL(token, path, params), {
47
- method: postData ? "POST" : "GET",
48
- body: JSON.stringify(postData),
49
- headers: {
50
- Authorization: `Bearer ${token}`,
51
- "Content-Type": "application/json"
43
+ // src/socials/meta/request.ts
44
+ function createGraphClient(baseURL) {
45
+ const buildURL = (token, path, params = {}) => {
46
+ const search = new URLSearchParams();
47
+ for (const [key, value] of Object.entries(params)) {
48
+ if (value !== void 0) search.set(key, String(value));
52
49
  }
53
- }).then((res) => res.json());
50
+ search.set("access_token", token);
51
+ return `${baseURL}/${path}?${search.toString()}`;
52
+ };
53
+ const request = async (token, path, options = {}) => {
54
+ const response = await fetch(buildURL(token, path, options.params), {
55
+ method: options.method || (options.body ? "POST" : "GET"),
56
+ headers: {
57
+ Authorization: `Bearer ${token}`,
58
+ ...options.body ? { "Content-Type": "application/json" } : {}
59
+ },
60
+ ...options.body ? { body: JSON.stringify(options.body) } : {}
61
+ });
62
+ return response.json().catch(() => null);
63
+ };
64
+ return { buildURL, request };
65
+ }
66
+ function readGraphID(label, result) {
67
+ if (result?.error) {
68
+ console.error(`[naystack] ${label} failed: ${result.error.message}`);
69
+ return null;
70
+ }
71
+ return result?.id || null;
54
72
  }
55
73
 
74
+ // src/socials/instagram/utils.ts
75
+ var client = createGraphClient("https://graph.instagram.com/v23.0");
76
+ var getInstagramData = client.request;
77
+
56
78
  // src/socials/instagram/getters.ts
57
79
  var getInstagramUser = (token, id, fields) => {
58
80
  return getInstagramData(token, id || "me", {
59
- fields: fields ? fields.join(",") : "username,followers_count,media_count"
81
+ params: {
82
+ fields: fields ? fields.join(",") : "username,followers_count,media_count"
83
+ }
60
84
  });
61
85
  };
62
86
  var getInstagramMedia = (token, fields, limit = 12) => {
63
87
  return getInstagramData(token, "me/media", {
64
- fields: fields ? fields.join(",") : "like_count,comments_count,permalink",
65
- limit: limit?.toString()
88
+ params: {
89
+ fields: fields ? fields.join(",") : "like_count,comments_count,permalink",
90
+ limit
91
+ }
66
92
  });
67
93
  };
68
94
  var getInstagramConversations = async (token, limit = 25, cursor) => {
69
95
  const result = await getInstagramData(token, "me/conversations", {
70
- platform: "instagram",
71
- fields: "participants,messages,updated_time",
72
- limit: limit.toString(),
73
- ...cursor ? { after: cursor } : {}
96
+ params: {
97
+ platform: "instagram",
98
+ fields: "participants,messages,updated_time",
99
+ limit,
100
+ after: cursor
101
+ }
74
102
  });
75
103
  return {
76
104
  data: result?.data.map((item) => ({
@@ -86,8 +114,10 @@ var getInstagramConversationsByUser = (token, userID) => {
86
114
  token,
87
115
  "me/conversations",
88
116
  {
89
- fields: "participants,messages,updated_time",
90
- user_id: userID
117
+ params: {
118
+ fields: "participants,messages,updated_time",
119
+ user_id: userID
120
+ }
91
121
  }
92
122
  );
93
123
  };
@@ -96,9 +126,11 @@ var getInstagramConversationByUser = async (token, userID) => {
96
126
  return res?.data?.find((item) => item.participants?.data.length === 2);
97
127
  };
98
128
  var getInstagramConversation = async (token, id, cursor) => {
99
- const result = await getInstagramData(token, id + "", {
100
- fields: "participants,messages,updated_time",
101
- ...cursor ? { after: cursor } : {}
129
+ const result = await getInstagramData(token, id, {
130
+ params: {
131
+ fields: "participants,messages,updated_time",
132
+ after: cursor
133
+ }
102
134
  });
103
135
  return {
104
136
  messages: result?.messages?.data,
@@ -112,21 +144,191 @@ var getInstagramConversation = async (token, id, cursor) => {
112
144
  };
113
145
  var getInstagramMessage = (token, id, fields) => {
114
146
  return getInstagramData(token, id, {
115
- fields: fields ? fields.join(",") : "id,created_time,from,to,message"
147
+ params: {
148
+ fields: fields ? fields.join(",") : "id,created_time,from,to,message"
149
+ }
116
150
  });
117
151
  };
152
+ var getInstagramContainerStatus = async (token, id) => {
153
+ const result = await getInstagramData(token, id, { params: { fields: "status_code,status" } });
154
+ if (!result?.status_code) return null;
155
+ return {
156
+ status: result.status_code,
157
+ error: result.status_code === "ERROR" ? result.status : void 0
158
+ };
159
+ };
160
+ var canPublishToInstagram = async (token) => {
161
+ const result = await getInstagramData(
162
+ token,
163
+ "me/content_publishing_limit",
164
+ { params: { fields: "quota_usage" } }
165
+ );
166
+ if (!Array.isArray(result?.data)) {
167
+ console.error(
168
+ `[naystack] Instagram token cannot publish${result?.error ? `: ${result.error.message}` : ""}`
169
+ );
170
+ return false;
171
+ }
172
+ return true;
173
+ };
174
+
175
+ // src/socials/meta/container.ts
176
+ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
177
+ async function waitForContainer(getState, { intervalMS = 5e3, timeoutMS = 3e5 } = {}) {
178
+ const deadline = Date.now() + timeoutMS;
179
+ let state = await getState();
180
+ if (!state) {
181
+ await sleep(2e3);
182
+ return null;
183
+ }
184
+ while (state?.status === "IN_PROGRESS" && Date.now() < deadline) {
185
+ await sleep(intervalMS);
186
+ state = await getState();
187
+ }
188
+ return state;
189
+ }
190
+ function createPublisher(platform) {
191
+ const isReady = async (token, id, label, wait) => {
192
+ const state = await waitForContainer(
193
+ () => platform.getStatus(token, id),
194
+ wait
195
+ );
196
+ if (state && state.status !== "FINISHED" && state.status !== "PUBLISHED") {
197
+ console.error(
198
+ `[naystack] ${platform.name} ${label} ${id} is ${state.status}${state.error ? `: ${state.error}` : ""}`
199
+ );
200
+ return false;
201
+ }
202
+ return true;
203
+ };
204
+ return {
205
+ /** Creates a container, waits for it to finish processing, then publishes it. */
206
+ publish: async (token, params, wait) => {
207
+ const containerID = await platform.createContainer(token, params);
208
+ if (!containerID) return null;
209
+ if (!await isReady(token, containerID, "container", wait)) return null;
210
+ return platform.publish(token, containerID);
211
+ },
212
+ /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
213
+ createChildren: async (token, items, wait) => {
214
+ const children = [];
215
+ for (const item of items) {
216
+ const childID = await platform.createContainer(token, {
217
+ ...item,
218
+ is_carousel_item: true
219
+ });
220
+ if (!childID) return null;
221
+ if (!await isReady(token, childID, "carousel item", wait))
222
+ return null;
223
+ children.push(childID);
224
+ }
225
+ return children;
226
+ }
227
+ };
228
+ }
118
229
 
119
230
  // src/socials/instagram/setters.ts
231
+ var publisher = createPublisher({
232
+ name: "Instagram",
233
+ getStatus: getInstagramContainerStatus,
234
+ createContainer: async (token, params) => readGraphID(
235
+ "Instagram media container",
236
+ await getInstagramData(token, "me/media", {
237
+ params,
238
+ method: "POST"
239
+ })
240
+ ),
241
+ publish: async (token, creationID) => readGraphID(
242
+ "Instagram publish",
243
+ await getInstagramData(token, "me/media_publish", {
244
+ params: { creation_id: creationID },
245
+ method: "POST"
246
+ })
247
+ )
248
+ });
249
+ var mediaParams = (media) => ({
250
+ media_type: media.type === "video" ? "VIDEO" : void 0,
251
+ image_url: media.type === "image" ? media.url : void 0,
252
+ video_url: media.type === "video" ? media.url : void 0,
253
+ // Instagram accepts alt text on images only.
254
+ alt_text: media.type === "image" ? media.altText : void 0
255
+ });
256
+ var createInstagramPost = async (token, input) => {
257
+ const media = [input.media].flat();
258
+ const first = media[0];
259
+ if (!first) {
260
+ console.error(
261
+ "[naystack] Instagram posts need at least one image or video"
262
+ );
263
+ return null;
264
+ }
265
+ if (input.story) {
266
+ return publisher.publish(
267
+ token,
268
+ {
269
+ ...mediaParams(first),
270
+ media_type: "STORIES",
271
+ alt_text: void 0
272
+ },
273
+ input.wait
274
+ );
275
+ }
276
+ if (media.length > 1) {
277
+ const children = await publisher.createChildren(
278
+ token,
279
+ media.map(mediaParams),
280
+ input.wait
281
+ );
282
+ if (!children) return null;
283
+ return publisher.publish(
284
+ token,
285
+ {
286
+ media_type: "CAROUSEL",
287
+ children: children.join(","),
288
+ caption: input.caption
289
+ },
290
+ input.wait
291
+ );
292
+ }
293
+ if (first.type === "video") {
294
+ return publisher.publish(
295
+ token,
296
+ {
297
+ media_type: "REELS",
298
+ video_url: first.url,
299
+ caption: input.caption,
300
+ cover_url: input.coverURL,
301
+ thumb_offset: input.thumbOffset,
302
+ share_to_feed: input.shareToFeed,
303
+ audio_name: input.audioName,
304
+ collaborators: input.collaborators && JSON.stringify(input.collaborators)
305
+ },
306
+ input.wait
307
+ );
308
+ }
309
+ return publisher.publish(
310
+ token,
311
+ {
312
+ image_url: first.url,
313
+ caption: input.caption,
314
+ alt_text: first.altText,
315
+ location_id: input.locationID
316
+ },
317
+ input.wait
318
+ );
319
+ };
120
320
  var sendInstagramMessage = (token, to, text) => {
121
- return getInstagramData(token, "me/messages", void 0, {
122
- recipient: { id: to },
123
- message: {
124
- text
321
+ return getInstagramData(token, "me/messages", {
322
+ body: {
323
+ recipient: { id: to },
324
+ message: {
325
+ text
326
+ }
125
327
  }
126
328
  });
127
329
  };
128
330
 
129
- // src/socials/meta-webhook.ts
331
+ // src/socials/meta/webhook.ts
130
332
  var import_server = require("next/server");
131
333
  var verifyWebhook = (secret) => (req) => {
132
334
  const params = req.nextUrl.searchParams;
@@ -155,69 +357,91 @@ var setupInstagramWebhook = (options) => {
155
357
  };
156
358
 
157
359
  // src/socials/threads/utils.ts
158
- function getThreadsURL(token, path, params) {
159
- return `https://graph.threads.net/v1.0/${path}?${Object.keys(params).map((key) => `${key}=${params[key]}`).join("&")}&access_token=${token}`;
160
- }
161
- function getThreadsData(token, path, params, method) {
162
- return fetch(getThreadsURL(token, path, params), {
163
- method: method || "GET"
164
- }).then((res) => res.json());
165
- }
360
+ var client2 = createGraphClient("https://graph.threads.net/v1.0");
361
+ var getThreadsData = client2.request;
166
362
 
167
363
  // src/socials/threads/getters.ts
168
364
  var getThread = (token, id, fields) => {
169
365
  return getThreadsData(token, id, {
170
- fields: fields ? fields.join(",") : "text,permalink,username"
366
+ params: { fields: fields ? fields.join(",") : "text,permalink,username" }
171
367
  });
172
368
  };
173
369
  var getThreads = (token, fields) => {
174
370
  return getThreadsData(token, "me/threads", {
175
- fields: fields ? fields.join(",") : "text,permalink,username"
371
+ params: { fields: fields ? fields.join(",") : "text,permalink,username" }
176
372
  }).then((res) => res?.data);
177
373
  };
178
374
  var getThreadsReplies = (token, id, fields) => {
179
375
  return getThreadsData(token, `${id}/replies`, {
180
- fields: fields ? fields.join(",") : "text,username,permalink"
376
+ params: { fields: fields ? fields.join(",") : "text,username,permalink" }
181
377
  }).then((res) => res?.data);
182
378
  };
379
+ var getThreadsContainerStatus = async (token, id) => {
380
+ const result = await getThreadsData(token, id, { params: { fields: "status,error_message" } });
381
+ if (!result?.status) return null;
382
+ return { status: result.status, error: result.error_message };
383
+ };
183
384
 
184
385
  // src/socials/threads/setters.ts
185
- function createContainer(token, text, reply_to_id) {
186
- return getThreadsData(
187
- token,
188
- "me/threads",
189
- {
190
- media_type: "TEXT",
191
- text,
192
- ...reply_to_id ? { reply_to_id } : {}
193
- },
194
- "POST"
195
- ).then((res) => res?.id);
196
- }
197
- function publishContainer(token, creation_id) {
198
- return getThreadsData(
386
+ var publisher2 = createPublisher({
387
+ name: "Threads",
388
+ getStatus: getThreadsContainerStatus,
389
+ createContainer: async (token, params) => readGraphID(
390
+ "Threads container",
391
+ await getThreadsData(token, "me/threads", {
392
+ params,
393
+ method: "POST"
394
+ })
395
+ ),
396
+ publish: async (token, creationID) => readGraphID(
397
+ "Threads publish",
398
+ await getThreadsData(token, "me/threads_publish", {
399
+ params: { creation_id: creationID },
400
+ method: "POST"
401
+ })
402
+ )
403
+ });
404
+ var mediaParams2 = (media) => ({
405
+ media_type: media ? media.type === "video" ? "VIDEO" : "IMAGE" : "TEXT",
406
+ image_url: media?.type === "image" ? media.url : void 0,
407
+ video_url: media?.type === "video" ? media.url : void 0,
408
+ alt_text: media?.altText
409
+ });
410
+ var createThreadsPost = async (token, input, replyToID) => {
411
+ const post = typeof input === "string" ? { text: input } : input;
412
+ const media = post.media ? [post.media].flat() : [];
413
+ const shared = {
414
+ text: post.text,
415
+ reply_to_id: post.replyToID || replyToID,
416
+ reply_control: post.replyControl
417
+ };
418
+ if (media.length > 1) {
419
+ const children = await publisher2.createChildren(
420
+ token,
421
+ media.map((item) => mediaParams2(item)),
422
+ post.wait
423
+ );
424
+ if (!children) return null;
425
+ return publisher2.publish(
426
+ token,
427
+ { ...shared, media_type: "CAROUSEL", children: children.join(",") },
428
+ post.wait
429
+ );
430
+ }
431
+ return publisher2.publish(
199
432
  token,
200
- "me/threads_publish",
201
433
  {
202
- creation_id
434
+ ...mediaParams2(media[0]),
435
+ ...shared,
436
+ link_attachment: post.linkAttachment
203
437
  },
204
- "POST"
205
- ).then((res) => res?.id);
206
- }
207
- var createThreadsPost = async (token, text, reply_to_id) => {
208
- const containerID = await createContainer(token, text, reply_to_id);
209
- if (!containerID) return null;
210
- await new Promise((resolve) => setTimeout(resolve, 2e3));
211
- return publishContainer(token, containerID);
438
+ post.wait
439
+ );
212
440
  };
213
- var createThread = async (token, threads) => {
441
+ var createThread = async (token, posts) => {
214
442
  const publishedIDs = [];
215
- for (const thread of threads) {
216
- const postID = await createThreadsPost(
217
- token,
218
- thread.split("\n").join("%0A"),
219
- publishedIDs.at(-1)
220
- );
443
+ for (const post of posts) {
444
+ const postID = await createThreadsPost(token, post, publishedIDs.at(-1));
221
445
  if (postID) publishedIDs.push(postID);
222
446
  }
223
447
  return publishedIDs[0];
@@ -240,6 +464,8 @@ var setupThreadsWebhook = (options) => {
240
464
  };
241
465
  // Annotate the CommonJS export names for ESM import in node:
242
466
  0 && (module.exports = {
467
+ canPublishToInstagram,
468
+ createInstagramPost,
243
469
  createThread,
244
470
  createThreadsPost,
245
471
  getInstagramConversation,
@@ -1,9 +1,11 @@
1
- export { getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser } from './instagram/getters.mjs';
2
- export { sendInstagramMessage } from './instagram/setters.mjs';
1
+ export { canPublishToInstagram, getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser } from './instagram/getters.mjs';
2
+ export { createInstagramPost, sendInstagramMessage } from './instagram/setters.mjs';
3
+ export { InstagramConversation, InstagramMedia, InstagramMessage, InstagramPostInput, InstagramPostMedia, InstagramUser } from './instagram/types.mjs';
3
4
  export { setupInstagramWebhook } from './instagram/webhook.mjs';
5
+ export { WaitForContainerOptions } from './meta/container.mjs';
6
+ export { GraphError } from './meta/types.mjs';
4
7
  export { getThread, getThreads, getThreadsReplies } from './threads/getters.mjs';
5
8
  export { createThread, createThreadsPost } from './threads/setters.mjs';
9
+ export { ThreadsPost, ThreadsPostInput, ThreadsPostMedia } from './threads/types.mjs';
6
10
  export { setupThreadsWebhook } from './threads/webhook.mjs';
7
- import './instagram/types.mjs';
8
11
  import 'next/server';
9
- import './threads/types.mjs';
@@ -1,9 +1,11 @@
1
- export { getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser } from './instagram/getters.js';
2
- export { sendInstagramMessage } from './instagram/setters.js';
1
+ export { canPublishToInstagram, getInstagramConversation, getInstagramConversationByUser, getInstagramConversations, getInstagramConversationsByUser, getInstagramMedia, getInstagramMessage, getInstagramUser } from './instagram/getters.js';
2
+ export { createInstagramPost, sendInstagramMessage } from './instagram/setters.js';
3
+ export { InstagramConversation, InstagramMedia, InstagramMessage, InstagramPostInput, InstagramPostMedia, InstagramUser } from './instagram/types.js';
3
4
  export { setupInstagramWebhook } from './instagram/webhook.js';
5
+ export { WaitForContainerOptions } from './meta/container.js';
6
+ export { GraphError } from './meta/types.js';
4
7
  export { getThread, getThreads, getThreadsReplies } from './threads/getters.js';
5
8
  export { createThread, createThreadsPost } from './threads/setters.js';
9
+ export { ThreadsPost, ThreadsPostInput, ThreadsPostMedia } from './threads/types.js';
6
10
  export { setupThreadsWebhook } from './threads/webhook.js';
7
- import './instagram/types.js';
8
11
  import 'next/server';
9
- import './threads/types.js';