naystack 1.8.18 → 1.9.0

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 (122) hide show
  1. package/README.md +94 -34
  2. package/dist/auth/client.cjs.js +2 -2
  3. package/dist/auth/client.esm.js +2 -2
  4. package/dist/auth/email/client.cjs.js +2 -2
  5. package/dist/auth/email/client.esm.js +2 -2
  6. package/dist/auth/email/index.cjs.js +2 -2
  7. package/dist/auth/email/index.esm.js +2 -2
  8. package/dist/auth/email/next.cjs.js +2 -2
  9. package/dist/auth/email/next.esm.js +2 -2
  10. package/dist/auth/email/routes/delete.cjs.js +2 -2
  11. package/dist/auth/email/routes/delete.esm.js +2 -2
  12. package/dist/auth/email/routes/get.cjs.js +2 -2
  13. package/dist/auth/email/routes/get.esm.js +2 -2
  14. package/dist/auth/email/routes/post.cjs.js +2 -2
  15. package/dist/auth/email/routes/post.esm.js +2 -2
  16. package/dist/auth/email/routes/put.cjs.js +2 -2
  17. package/dist/auth/email/routes/put.esm.js +2 -2
  18. package/dist/auth/email/token.cjs.js +2 -2
  19. package/dist/auth/email/token.esm.js +2 -2
  20. package/dist/auth/email/utils.cjs.js +2 -2
  21. package/dist/auth/email/utils.esm.js +2 -2
  22. package/dist/auth/google/get.cjs.js +2 -2
  23. package/dist/auth/google/get.esm.js +2 -2
  24. package/dist/auth/google/index.cjs.js +2 -2
  25. package/dist/auth/google/index.esm.js +2 -2
  26. package/dist/auth/index.cjs.js +4 -297
  27. package/dist/auth/index.d.mts +0 -5
  28. package/dist/auth/index.d.ts +0 -5
  29. package/dist/auth/index.esm.js +3 -293
  30. package/dist/auth/token-store.cjs.js +2 -2
  31. package/dist/auth/token-store.esm.js +2 -2
  32. package/dist/env.cjs.js +3 -3
  33. package/dist/env.d.mts +3 -2
  34. package/dist/env.d.ts +3 -2
  35. package/dist/env.esm.js +3 -3
  36. package/dist/file/client.cjs.js +2 -2
  37. package/dist/file/client.esm.js +2 -2
  38. package/dist/file/index.cjs.js +2 -2
  39. package/dist/file/index.esm.js +2 -2
  40. package/dist/file/put.cjs.js +2 -2
  41. package/dist/file/put.esm.js +2 -2
  42. package/dist/file/setup.cjs.js +2 -2
  43. package/dist/file/setup.esm.js +2 -2
  44. package/dist/file/utils.cjs.js +2 -2
  45. package/dist/file/utils.esm.js +2 -2
  46. package/dist/graphql/client.cjs.js +2 -2
  47. package/dist/graphql/client.esm.js +2 -2
  48. package/dist/graphql/index.cjs.js +2 -2
  49. package/dist/graphql/index.esm.js +2 -2
  50. package/dist/graphql/init.cjs.js +2 -2
  51. package/dist/graphql/init.esm.js +2 -2
  52. package/dist/graphql/links.cjs.js +2 -2
  53. package/dist/graphql/links.esm.js +2 -2
  54. package/dist/graphql/next.cjs.js +2 -2
  55. package/dist/graphql/next.esm.js +2 -2
  56. package/dist/graphql/server.cjs.js +2 -2
  57. package/dist/graphql/server.esm.js +2 -2
  58. package/dist/graphql/utils.cjs.js +2 -2
  59. package/dist/graphql/utils.esm.js +2 -2
  60. package/dist/socials/connect.cjs.js +151 -0
  61. package/dist/socials/connect.d.mts +70 -0
  62. package/dist/socials/connect.d.ts +70 -0
  63. package/dist/socials/connect.esm.js +126 -0
  64. package/dist/socials/index.cjs.js +367 -35
  65. package/dist/socials/index.d.mts +8 -2
  66. package/dist/socials/index.d.ts +8 -2
  67. package/dist/socials/index.esm.js +357 -34
  68. package/dist/socials/instagram/adapter.cjs.js +275 -0
  69. package/dist/socials/instagram/adapter.d.mts +30 -0
  70. package/dist/socials/instagram/adapter.d.ts +30 -0
  71. package/dist/socials/instagram/adapter.esm.js +248 -0
  72. package/dist/{auth/instagram/utils.cjs.js → socials/instagram/auth.cjs.js} +43 -41
  73. package/dist/socials/instagram/auth.d.mts +52 -0
  74. package/dist/socials/instagram/auth.d.ts +52 -0
  75. package/dist/{auth/instagram/utils.esm.js → socials/instagram/auth.esm.js} +37 -35
  76. package/dist/socials/instagram/getters.d.mts +1 -0
  77. package/dist/socials/instagram/getters.d.ts +1 -0
  78. package/dist/socials/instagram/setters.cjs.js +56 -31
  79. package/dist/socials/instagram/setters.d.mts +1 -0
  80. package/dist/socials/instagram/setters.d.ts +1 -0
  81. package/dist/socials/instagram/setters.esm.js +56 -31
  82. package/dist/socials/instagram/types.d.mts +2 -1
  83. package/dist/socials/instagram/types.d.ts +2 -1
  84. package/dist/socials/meta/container.cjs.js +57 -30
  85. package/dist/socials/meta/container.d.mts +15 -28
  86. package/dist/socials/meta/container.d.ts +15 -28
  87. package/dist/socials/meta/container.esm.js +56 -31
  88. package/dist/socials/provider.cjs.js +18 -0
  89. package/dist/socials/provider.d.mts +52 -0
  90. package/dist/socials/provider.d.ts +52 -0
  91. package/dist/socials/provider.esm.js +0 -0
  92. package/dist/socials/threads/getters.d.mts +1 -0
  93. package/dist/socials/threads/getters.d.ts +1 -0
  94. package/dist/socials/threads/setters.cjs.js +56 -31
  95. package/dist/socials/threads/setters.d.mts +1 -0
  96. package/dist/socials/threads/setters.d.ts +1 -0
  97. package/dist/socials/threads/setters.esm.js +56 -31
  98. package/dist/socials/threads/types.d.mts +2 -1
  99. package/dist/socials/threads/types.d.ts +2 -1
  100. package/dist/socials/types.cjs.js +43 -0
  101. package/dist/socials/types.d.mts +99 -0
  102. package/dist/socials/types.d.ts +99 -0
  103. package/dist/socials/types.esm.js +17 -0
  104. package/dist/socials/utils/poll.cjs.js +59 -0
  105. package/dist/socials/utils/poll.d.mts +85 -0
  106. package/dist/socials/utils/poll.d.ts +85 -0
  107. package/dist/socials/utils/poll.esm.js +33 -0
  108. package/dist/utils/client/index.cjs.js +2 -2
  109. package/dist/utils/client/index.esm.js +2 -2
  110. package/dist/utils/client/seo.cjs.js +2 -2
  111. package/dist/utils/client/seo.esm.js +2 -2
  112. package/package.json +1 -1
  113. package/dist/auth/instagram/index.cjs.js +0 -379
  114. package/dist/auth/instagram/index.d.mts +0 -58
  115. package/dist/auth/instagram/index.d.ts +0 -58
  116. package/dist/auth/instagram/index.esm.js +0 -350
  117. package/dist/auth/instagram/route.cjs.js +0 -359
  118. package/dist/auth/instagram/route.d.mts +0 -15
  119. package/dist/auth/instagram/route.d.ts +0 -15
  120. package/dist/auth/instagram/route.esm.js +0 -334
  121. package/dist/auth/instagram/utils.d.mts +0 -57
  122. package/dist/auth/instagram/utils.d.ts +0 -57
@@ -1,359 +0,0 @@
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 __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/auth/instagram/route.ts
21
- var route_exports = {};
22
- __export(route_exports, {
23
- getInstagramRoute: () => getInstagramRoute
24
- });
25
- module.exports = __toCommonJS(route_exports);
26
- var import_server3 = require("next/server");
27
-
28
- // src/auth/email/token.ts
29
- var import_bcryptjs = require("bcryptjs");
30
- var import_jsonwebtoken = require("jsonwebtoken");
31
- var import_headers = require("next/headers");
32
- var import_navigation = require("next/navigation");
33
- var import_server = require("next/server");
34
-
35
- // src/env.ts
36
- var EXTRA_ENV = globalThis.__NAYSTACK_ENV__ || (globalThis.__NAYSTACK_ENV__ = {});
37
- var getEnvValue = (key) => {
38
- switch (key) {
39
- case "NEXT_PUBLIC_GRAPHQL_ENDPOINT" /* NEXT_PUBLIC_GRAPHQL_ENDPOINT */:
40
- return process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT || EXTRA_ENV.GRAPHQL_ENDPOINT;
41
- case "NEXT_PUBLIC_EMAIL_AUTH_ENDPOINT" /* NEXT_PUBLIC_EMAIL_AUTH_ENDPOINT */:
42
- return process.env.NEXT_PUBLIC_EMAIL_AUTH_ENDPOINT || EXTRA_ENV.EMAIL_AUTH_ENDPOINT;
43
- case "NEXT_PUBLIC_GOOGLE_AUTH_ENDPOINT" /* NEXT_PUBLIC_GOOGLE_AUTH_ENDPOINT */:
44
- return process.env.NEXT_PUBLIC_GOOGLE_AUTH_ENDPOINT || EXTRA_ENV.GOOGLE_AUTH_ENDPOINT;
45
- case "NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT" /* NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT */:
46
- return process.env.NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT || EXTRA_ENV.INSTAGRAM_AUTH_ENDPOINT;
47
- case "NEXT_PUBLIC_FILE_ENDPOINT" /* NEXT_PUBLIC_FILE_ENDPOINT */:
48
- return process.env.NEXT_PUBLIC_FILE_ENDPOINT || EXTRA_ENV.FILE_ENDPOINT;
49
- case "NEXT_PUBLIC_BASE_URL" /* NEXT_PUBLIC_BASE_URL */:
50
- return process.env.NEXT_PUBLIC_BASE_URL || EXTRA_ENV.BASE_URL;
51
- case "REFRESH_KEY" /* REFRESH_KEY */:
52
- return process.env.REFRESH_KEY;
53
- case "SIGNING_KEY" /* SIGNING_KEY */:
54
- return process.env.SIGNING_KEY;
55
- case "INSTAGRAM_CLIENT_SECRET" /* INSTAGRAM_CLIENT_SECRET */:
56
- return process.env.INSTAGRAM_CLIENT_SECRET;
57
- case "INSTAGRAM_CLIENT_ID" /* INSTAGRAM_CLIENT_ID */:
58
- return process.env.INSTAGRAM_CLIENT_ID;
59
- case "GOOGLE_CLIENT_SECRET" /* GOOGLE_CLIENT_SECRET */:
60
- return process.env.GOOGLE_CLIENT_SECRET;
61
- case "GOOGLE_CLIENT_ID" /* GOOGLE_CLIENT_ID */:
62
- return process.env.GOOGLE_CLIENT_ID;
63
- case "TURNSTILE_KEY" /* TURNSTILE_KEY */:
64
- return process.env.TURNSTILE_KEY;
65
- case "S3_ACCESS_KEY_ID" /* S3_ACCESS_KEY_ID */:
66
- return process.env.S3_ACCESS_KEY_ID;
67
- case "S3_ACCESS_KEY_SECRET" /* S3_ACCESS_KEY_SECRET */:
68
- return process.env.S3_ACCESS_KEY_SECRET;
69
- case "S3_REGION" /* S3_REGION */:
70
- return process.env.S3_REGION;
71
- case "S3_BUCKET" /* S3_BUCKET */:
72
- return process.env.S3_BUCKET;
73
- case "NODE_ENV" /* NODE_ENV */:
74
- return process.env.NODE_ENV;
75
- default:
76
- return process.env[key];
77
- }
78
- };
79
- function getEnv(key, skipCheck) {
80
- const value = getEnvValue(key);
81
- if (!skipCheck && !value) throw new Error(`${key} is not defined`);
82
- return value;
83
- }
84
-
85
- // src/auth/email/token.ts
86
- function getUserIdFromAccessToken(accessToken) {
87
- if (accessToken)
88
- try {
89
- const decoded = (0, import_jsonwebtoken.verify)(accessToken, getEnv("SIGNING_KEY" /* SIGNING_KEY */));
90
- if (typeof decoded !== "string" && typeof decoded.id === "number")
91
- return decoded.id;
92
- } catch (e) {
93
- if (!(e instanceof import_jsonwebtoken.JsonWebTokenError)) console.error(e, "errors");
94
- return null;
95
- }
96
- return null;
97
- }
98
-
99
- // src/auth/instagram/utils.ts
100
- async function getLongLivedToken(code, redirectURL, clientId, clientSecret) {
101
- const formData = new FormData();
102
- formData.set("client_id", clientId);
103
- formData.set("client_secret", clientSecret);
104
- formData.set("grant_type", "authorization_code");
105
- formData.set("redirect_uri", redirectURL);
106
- formData.set("code", code);
107
- const shortRes = await fetch("https://api.instagram.com/oauth/access_token", {
108
- method: "POST",
109
- body: formData
110
- });
111
- if (shortRes.ok) {
112
- const shortResData = await shortRes.json();
113
- if (shortResData.access_token) {
114
- const shortLivedToken = shortResData.access_token;
115
- const longRes = await fetch(
116
- `https://graph.instagram.com/access_token?grant_type=ig_exchange_token&access_token=${shortLivedToken}&client_secret=${getEnv("INSTAGRAM_CLIENT_SECRET" /* INSTAGRAM_CLIENT_SECRET */)}`
117
- );
118
- if (longRes.ok) {
119
- const longResData = await longRes.json();
120
- return {
121
- accessToken: longResData.access_token,
122
- userId: shortResData.user_id
123
- };
124
- }
125
- }
126
- }
127
- }
128
- var getInstagramAuthorizationURL = (token, scopes = ["instagram_business_basic"]) => `https://www.instagram.com/oauth/authorize/?client_id=${getEnv(
129
- "INSTAGRAM_CLIENT_ID" /* INSTAGRAM_CLIENT_ID */
130
- )}&response_type=code&enable_fb_login=0&force_authentication=1&scope=${scopes.join(",")}&state=${token}&redirect_uri=${getEnv("NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT" /* NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT */)}#weblink`;
131
-
132
- // src/socials/meta/request.ts
133
- function createGraphClient(baseURL) {
134
- const buildURL = (token, path, params = {}) => {
135
- const search = new URLSearchParams();
136
- for (const [key, value] of Object.entries(params)) {
137
- if (value !== void 0) search.set(key, String(value));
138
- }
139
- search.set("access_token", token);
140
- return `${baseURL}/${path}?${search.toString()}`;
141
- };
142
- const request = async (token, path, options = {}) => {
143
- const response = await fetch(buildURL(token, path, options.params), {
144
- method: options.method || (options.body ? "POST" : "GET"),
145
- headers: {
146
- Authorization: `Bearer ${token}`,
147
- ...options.body ? { "Content-Type": "application/json" } : {}
148
- },
149
- ...options.body ? { body: JSON.stringify(options.body) } : {}
150
- });
151
- return response.json().catch(() => null);
152
- };
153
- return { buildURL, request };
154
- }
155
- function readGraphID(label, result) {
156
- if (result?.error) {
157
- console.error(`[naystack] ${label} failed: ${result.error.message}`);
158
- return null;
159
- }
160
- return result?.id || null;
161
- }
162
-
163
- // src/socials/instagram/utils.ts
164
- var client = createGraphClient("https://graph.instagram.com/v23.0");
165
- var getInstagramData = client.request;
166
-
167
- // src/socials/instagram/getters.ts
168
- var getInstagramUser = (token, id, fields) => {
169
- return getInstagramData(token, id || "me", {
170
- params: {
171
- fields: fields ? fields.join(",") : "username,followers_count,media_count"
172
- }
173
- });
174
- };
175
- var getInstagramContainerStatus = async (token, id) => {
176
- const result = await getInstagramData(token, id, { params: { fields: "status_code,status" } });
177
- if (!result?.status_code) return null;
178
- return {
179
- status: result.status_code,
180
- error: result.status_code === "ERROR" ? result.status : void 0
181
- };
182
- };
183
-
184
- // src/socials/meta/container.ts
185
- var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
186
- async function waitForContainer(getState, { intervalMS = 5e3, timeoutMS = 3e5 } = {}) {
187
- const deadline = Date.now() + timeoutMS;
188
- let state = await getState();
189
- if (!state) {
190
- await sleep(2e3);
191
- return null;
192
- }
193
- while (state?.status === "IN_PROGRESS" && Date.now() < deadline) {
194
- await sleep(intervalMS);
195
- state = await getState();
196
- }
197
- return state;
198
- }
199
- function createPublisher(platform) {
200
- const isReady = async (token, id, label, wait) => {
201
- const state = await waitForContainer(
202
- () => platform.getStatus(token, id),
203
- wait
204
- );
205
- if (state && state.status !== "FINISHED" && state.status !== "PUBLISHED") {
206
- console.error(
207
- `[naystack] ${platform.name} ${label} ${id} is ${state.status}${state.error ? `: ${state.error}` : ""}`
208
- );
209
- return false;
210
- }
211
- return true;
212
- };
213
- const createReady = async (token, params, label, wait, retry) => {
214
- const attempts = Math.max(1, retry?.attempts ?? 3);
215
- const backoffMS = retry?.backoffMS ?? 2e3;
216
- for (let attempt = 1; attempt <= attempts; attempt++) {
217
- const id = await platform.createContainer(token, params);
218
- if (id && await isReady(token, id, label, wait)) return id;
219
- if (attempt < attempts) {
220
- const delay = backoffMS * 2 ** (attempt - 1);
221
- console.warn(
222
- `[naystack] ${platform.name} ${label} attempt ${attempt}/${attempts} failed \u2014 retrying in ${delay}ms`
223
- );
224
- await sleep(delay);
225
- }
226
- }
227
- return null;
228
- };
229
- return {
230
- /** Creates a container, waits for it to finish processing, then publishes it. */
231
- publish: async (token, params, wait, retry) => {
232
- const containerID = await createReady(
233
- token,
234
- params,
235
- "container",
236
- wait,
237
- retry
238
- );
239
- if (!containerID) return null;
240
- return platform.publish(token, containerID);
241
- },
242
- /** Creates and awaits every carousel child, resolving to their ids — or `null` if any failed. */
243
- createChildren: async (token, items, wait, retry) => {
244
- const children = [];
245
- for (const item of items) {
246
- const childID = await createReady(
247
- token,
248
- { ...item, is_carousel_item: true },
249
- "carousel item",
250
- wait,
251
- retry
252
- );
253
- if (!childID) return null;
254
- children.push(childID);
255
- }
256
- return children;
257
- }
258
- };
259
- }
260
-
261
- // src/socials/instagram/setters.ts
262
- var publisher = createPublisher({
263
- name: "Instagram",
264
- getStatus: getInstagramContainerStatus,
265
- createContainer: async (token, params) => readGraphID(
266
- "Instagram media container",
267
- await getInstagramData(token, "me/media", {
268
- params,
269
- method: "POST"
270
- })
271
- ),
272
- publish: async (token, creationID) => readGraphID(
273
- "Instagram publish",
274
- await getInstagramData(token, "me/media_publish", {
275
- params: { creation_id: creationID },
276
- method: "POST"
277
- })
278
- )
279
- });
280
-
281
- // src/socials/meta/webhook.ts
282
- var import_server2 = require("next/server");
283
-
284
- // src/socials/threads/utils.ts
285
- var client2 = createGraphClient("https://graph.threads.net/v1.0");
286
- var getThreadsData = client2.request;
287
-
288
- // src/socials/threads/getters.ts
289
- var getThreadsContainerStatus = async (token, id) => {
290
- const result = await getThreadsData(token, id, { params: { fields: "status,error_message" } });
291
- if (!result?.status) return null;
292
- return { status: result.status, error: result.error_message };
293
- };
294
-
295
- // src/socials/threads/setters.ts
296
- var publisher2 = createPublisher({
297
- name: "Threads",
298
- getStatus: getThreadsContainerStatus,
299
- createContainer: async (token, params) => readGraphID(
300
- "Threads container",
301
- await getThreadsData(token, "me/threads", {
302
- params,
303
- method: "POST"
304
- })
305
- ),
306
- publish: async (token, creationID) => readGraphID(
307
- "Threads publish",
308
- await getThreadsData(token, "me/threads_publish", {
309
- params: { creation_id: creationID },
310
- method: "POST"
311
- })
312
- )
313
- });
314
-
315
- // src/auth/instagram/route.ts
316
- var getInstagramRoute = ({
317
- redirectURL,
318
- errorRedirectURL,
319
- onUser,
320
- scopes
321
- }) => {
322
- const handleError = (message) => import_server3.NextResponse.redirect(`${errorRedirectURL}?error=${message}`);
323
- return async (req) => {
324
- const accessCode = req.nextUrl.searchParams.get("code");
325
- const error = req.nextUrl.searchParams.get("error");
326
- const stateToken = req.nextUrl.searchParams.get("state");
327
- if (error) return handleError(error);
328
- if (!accessCode) {
329
- if (!stateToken) return handleError("Invalid request");
330
- return import_server3.NextResponse.redirect(
331
- getInstagramAuthorizationURL(stateToken, scopes),
332
- 302
333
- );
334
- }
335
- if (!stateToken) return handleError("Invalid request");
336
- const instagramData = await getLongLivedToken(
337
- accessCode,
338
- getEnv("NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT" /* NEXT_PUBLIC_INSTAGRAM_AUTH_ENDPOINT */),
339
- getEnv("INSTAGRAM_CLIENT_ID" /* INSTAGRAM_CLIENT_ID */),
340
- getEnv("INSTAGRAM_CLIENT_SECRET" /* INSTAGRAM_CLIENT_SECRET */)
341
- );
342
- if (!instagramData?.accessToken)
343
- return handleError("Unable to reach Instagram");
344
- const personalInfo = await getInstagramUser(instagramData.accessToken);
345
- if (!personalInfo?.username) return handleError("You are not logged in");
346
- const loggedInUserID = getUserIdFromAccessToken(stateToken);
347
- const errorMessage = await onUser(
348
- personalInfo,
349
- loggedInUserID,
350
- instagramData.accessToken
351
- );
352
- if (errorMessage) return handleError(errorMessage);
353
- return import_server3.NextResponse.redirect(redirectURL);
354
- };
355
- };
356
- // Annotate the CommonJS export names for ESM import in node:
357
- 0 && (module.exports = {
358
- getInstagramRoute
359
- });
@@ -1,15 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
- import { SetupInstagramAuthOptions } from './index.mjs';
3
- import './utils.mjs';
4
- import '../../socials/instagram/types.mjs';
5
- import '../../socials/meta/container.mjs';
6
- import '../../socials/meta/types.mjs';
7
-
8
- /**
9
- * Returns the GET route handler for Instagram OAuth callback.
10
- * @param options - SetupInstagramAuthOptions (onUser, redirect URLs)
11
- * @returns Async route handler for the OAuth callback
12
- */
13
- declare const getInstagramRoute: ({ redirectURL, errorRedirectURL, onUser, scopes, }: SetupInstagramAuthOptions) => (req: NextRequest) => Promise<NextResponse<unknown>>;
14
-
15
- export { getInstagramRoute };
@@ -1,15 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
- import { SetupInstagramAuthOptions } from './index.js';
3
- import './utils.js';
4
- import '../../socials/instagram/types.js';
5
- import '../../socials/meta/container.js';
6
- import '../../socials/meta/types.js';
7
-
8
- /**
9
- * Returns the GET route handler for Instagram OAuth callback.
10
- * @param options - SetupInstagramAuthOptions (onUser, redirect URLs)
11
- * @returns Async route handler for the OAuth callback
12
- */
13
- declare const getInstagramRoute: ({ redirectURL, errorRedirectURL, onUser, scopes, }: SetupInstagramAuthOptions) => (req: NextRequest) => Promise<NextResponse<unknown>>;
14
-
15
- export { getInstagramRoute };