naystack 1.5.9 → 1.5.10

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 (114) hide show
  1. package/README.md +646 -91
  2. package/dist/auth/constants.d.mts +4 -0
  3. package/dist/auth/constants.d.ts +4 -0
  4. package/dist/auth/email/client.d.mts +149 -0
  5. package/dist/auth/email/client.d.ts +149 -0
  6. package/dist/auth/email/index.cjs.js +2 -20
  7. package/dist/auth/email/index.d.mts +41 -1
  8. package/dist/auth/email/index.d.ts +41 -1
  9. package/dist/auth/email/index.esm.js +1 -17
  10. package/dist/auth/email/routes/delete.cjs.js +0 -1
  11. package/dist/auth/email/routes/delete.d.mts +5 -0
  12. package/dist/auth/email/routes/delete.d.ts +5 -0
  13. package/dist/auth/email/routes/delete.esm.js +0 -1
  14. package/dist/auth/email/routes/get.d.mts +5 -0
  15. package/dist/auth/email/routes/get.d.ts +5 -0
  16. package/dist/auth/email/routes/post.cjs.js +0 -1
  17. package/dist/auth/email/routes/post.d.mts +5 -0
  18. package/dist/auth/email/routes/post.d.ts +5 -0
  19. package/dist/auth/email/routes/post.esm.js +0 -1
  20. package/dist/auth/email/routes/put.cjs.js +0 -1
  21. package/dist/auth/email/routes/put.d.mts +5 -0
  22. package/dist/auth/email/routes/put.d.ts +5 -0
  23. package/dist/auth/email/routes/put.esm.js +0 -1
  24. package/dist/auth/email/token.d.mts +62 -0
  25. package/dist/auth/email/token.d.ts +62 -0
  26. package/dist/auth/email/types.d.mts +22 -0
  27. package/dist/auth/email/types.d.ts +22 -0
  28. package/dist/auth/email/utils.cjs.js +0 -18
  29. package/dist/auth/email/utils.d.mts +41 -3
  30. package/dist/auth/email/utils.d.ts +41 -3
  31. package/dist/auth/email/utils.esm.js +0 -16
  32. package/dist/auth/google/get.d.mts +5 -0
  33. package/dist/auth/google/get.d.ts +5 -0
  34. package/dist/auth/google/index.d.mts +39 -0
  35. package/dist/auth/google/index.d.ts +39 -0
  36. package/dist/auth/index.cjs.js +4 -22
  37. package/dist/auth/index.d.mts +1 -1
  38. package/dist/auth/index.d.ts +1 -1
  39. package/dist/auth/index.esm.js +3 -19
  40. package/dist/auth/instagram/client.d.mts +19 -0
  41. package/dist/auth/instagram/client.d.ts +19 -0
  42. package/dist/auth/instagram/index.d.mts +37 -0
  43. package/dist/auth/instagram/index.d.ts +37 -0
  44. package/dist/auth/instagram/route.d.mts +5 -0
  45. package/dist/auth/instagram/route.d.ts +5 -0
  46. package/dist/auth/instagram/utils.d.mts +13 -0
  47. package/dist/auth/instagram/utils.d.ts +13 -0
  48. package/dist/auth/types.d.mts +24 -0
  49. package/dist/auth/types.d.ts +24 -0
  50. package/dist/auth/utils/errors.d.mts +10 -0
  51. package/dist/auth/utils/errors.d.ts +10 -0
  52. package/dist/auth/utils/token.d.mts +20 -0
  53. package/dist/auth/utils/token.d.ts +20 -0
  54. package/dist/client/hooks.d.mts +59 -0
  55. package/dist/client/hooks.d.ts +59 -0
  56. package/dist/client/seo.d.mts +46 -0
  57. package/dist/client/seo.d.ts +46 -0
  58. package/dist/env.d.mts +61 -0
  59. package/dist/env.d.ts +61 -0
  60. package/dist/file/client.d.mts +53 -1
  61. package/dist/file/client.d.ts +53 -1
  62. package/dist/file/index.cjs.js +0 -1
  63. package/dist/file/index.esm.js +0 -1
  64. package/dist/file/put.cjs.js +0 -1
  65. package/dist/file/put.d.mts +11 -0
  66. package/dist/file/put.d.ts +11 -0
  67. package/dist/file/put.esm.js +0 -1
  68. package/dist/file/setup.cjs.js +0 -1
  69. package/dist/file/setup.d.mts +48 -0
  70. package/dist/file/setup.d.ts +48 -0
  71. package/dist/file/setup.esm.js +0 -1
  72. package/dist/file/utils.d.mts +41 -0
  73. package/dist/file/utils.d.ts +41 -0
  74. package/dist/graphql/client.d.mts +113 -0
  75. package/dist/graphql/client.d.ts +113 -0
  76. package/dist/graphql/errors.d.mts +26 -0
  77. package/dist/graphql/errors.d.ts +26 -0
  78. package/dist/graphql/index.cjs.js +2 -3
  79. package/dist/graphql/index.esm.js +2 -3
  80. package/dist/graphql/init.cjs.js +0 -1
  81. package/dist/graphql/init.d.mts +33 -0
  82. package/dist/graphql/init.d.ts +33 -0
  83. package/dist/graphql/init.esm.js +0 -1
  84. package/dist/graphql/server.d.mts +88 -0
  85. package/dist/graphql/server.d.ts +88 -0
  86. package/dist/graphql/types.d.mts +21 -0
  87. package/dist/graphql/types.d.ts +21 -0
  88. package/dist/graphql/utils.d.mts +217 -0
  89. package/dist/graphql/utils.d.ts +217 -0
  90. package/dist/index.d.mts +16 -0
  91. package/dist/index.d.ts +16 -0
  92. package/dist/socials/instagram/getters.d.mts +115 -0
  93. package/dist/socials/instagram/getters.d.ts +115 -0
  94. package/dist/socials/instagram/setters.d.mts +18 -0
  95. package/dist/socials/instagram/setters.d.ts +18 -0
  96. package/dist/socials/instagram/types.d.mts +46 -0
  97. package/dist/socials/instagram/types.d.ts +46 -0
  98. package/dist/socials/instagram/utils.d.mts +19 -0
  99. package/dist/socials/instagram/utils.d.ts +19 -0
  100. package/dist/socials/instagram/webhook.d.mts +31 -0
  101. package/dist/socials/instagram/webhook.d.ts +31 -0
  102. package/dist/socials/meta-webhook.d.mts +11 -0
  103. package/dist/socials/meta-webhook.d.ts +11 -0
  104. package/dist/socials/threads/getters.d.mts +57 -0
  105. package/dist/socials/threads/getters.d.ts +57 -0
  106. package/dist/socials/threads/setters.d.mts +59 -0
  107. package/dist/socials/threads/setters.d.ts +59 -0
  108. package/dist/socials/threads/types.d.mts +9 -0
  109. package/dist/socials/threads/types.d.ts +9 -0
  110. package/dist/socials/threads/utils.d.mts +19 -0
  111. package/dist/socials/threads/utils.d.ts +19 -0
  112. package/dist/socials/threads/webhook.d.mts +30 -0
  113. package/dist/socials/threads/webhook.d.ts +30 -0
  114. package/package.json +4 -2
@@ -1,6 +1,36 @@
1
1
  import * as next_server from 'next/server';
2
2
  import { NextRequest } from 'next/server';
3
3
 
4
+ /**
5
+ * Sets up GET (verification) and POST (event handling) route handlers for the Threads webhook.
6
+ *
7
+ * - **GET**: Responds to Meta's webhook verification challenge (checks `hub.verify_token` against `secret`).
8
+ * - **POST**: Parses incoming webhook events and calls your `callback` for each event.
9
+ *
10
+ * @param options - Configuration object.
11
+ * @param options.secret - The verify token you configured in the Meta Developer Portal.
12
+ * @param options.callback - Called for each webhook event: `(field, value) => Promise<boolean>`.
13
+ * - `field` — Event field name.
14
+ * - `value` — Event payload.
15
+ * Return `true` to acknowledge; return `false` to respond with HTTP 500.
16
+ * @returns Object with `GET` and `POST` — export as your route's handlers.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // app/api/webhooks/threads/route.ts
21
+ * import { setupThreadsWebhook } from "naystack/socials";
22
+ *
23
+ * export const { GET, POST } = setupThreadsWebhook({
24
+ * secret: process.env.WEBHOOK_SECRET!,
25
+ * callback: async (field, value) => {
26
+ * console.log("Threads event:", field, value);
27
+ * return true; // Return false to respond with 500
28
+ * },
29
+ * });
30
+ * ```
31
+ *
32
+ * @category Socials
33
+ */
4
34
  declare const setupThreadsWebhook: (options: {
5
35
  secret: string;
6
36
  callback: (type: string, value: any) => Promise<boolean>;
@@ -1,6 +1,36 @@
1
1
  import * as next_server from 'next/server';
2
2
  import { NextRequest } from 'next/server';
3
3
 
4
+ /**
5
+ * Sets up GET (verification) and POST (event handling) route handlers for the Threads webhook.
6
+ *
7
+ * - **GET**: Responds to Meta's webhook verification challenge (checks `hub.verify_token` against `secret`).
8
+ * - **POST**: Parses incoming webhook events and calls your `callback` for each event.
9
+ *
10
+ * @param options - Configuration object.
11
+ * @param options.secret - The verify token you configured in the Meta Developer Portal.
12
+ * @param options.callback - Called for each webhook event: `(field, value) => Promise<boolean>`.
13
+ * - `field` — Event field name.
14
+ * - `value` — Event payload.
15
+ * Return `true` to acknowledge; return `false` to respond with HTTP 500.
16
+ * @returns Object with `GET` and `POST` — export as your route's handlers.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // app/api/webhooks/threads/route.ts
21
+ * import { setupThreadsWebhook } from "naystack/socials";
22
+ *
23
+ * export const { GET, POST } = setupThreadsWebhook({
24
+ * secret: process.env.WEBHOOK_SECRET!,
25
+ * callback: async (field, value) => {
26
+ * console.log("Threads event:", field, value);
27
+ * return true; // Return false to respond with 500
28
+ * },
29
+ * });
30
+ * ```
31
+ *
32
+ * @category Socials
33
+ */
4
34
  declare const setupThreadsWebhook: (options: {
5
35
  secret: string;
6
36
  callback: (type: string, value: any) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.5.9",
3
+ "version": "1.5.10",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -9,7 +9,8 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build": "NODE_OPTIONS='--max-old-space-size=16384' tsup"
12
+ "build": "NODE_OPTIONS='--max-old-space-size=16384' tsup",
13
+ "docs": "typedoc"
13
14
  },
14
15
  "exports": {
15
16
  "./auth": {
@@ -125,6 +126,7 @@
125
126
  "prettier": "^3.5.3",
126
127
  "tsup": "^8.5.0",
127
128
  "tsx": "^4.20.5",
129
+ "typedoc": "^0.28.16",
128
130
  "typescript": "^5.9.2",
129
131
  "typescript-eslint": "^8.31.1"
130
132
  },