naystack 1.1.11 → 1.1.12-beta.1

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 (107) hide show
  1. package/dist/auth/email/index.cjs.js +203 -0
  2. package/dist/auth/email/index.d.mts +18 -0
  3. package/dist/auth/email/index.d.ts +18 -0
  4. package/dist/auth/email/index.esm.js +176 -0
  5. package/dist/auth/email/routes/delete.cjs.js +58 -0
  6. package/dist/auth/email/routes/delete.d.mts +8 -0
  7. package/dist/auth/email/routes/delete.d.ts +8 -0
  8. package/dist/auth/email/routes/delete.esm.js +31 -0
  9. package/dist/auth/email/routes/get.cjs.js +83 -0
  10. package/dist/auth/email/routes/get.d.mts +11 -0
  11. package/dist/auth/email/routes/get.d.ts +11 -0
  12. package/dist/auth/email/routes/get.esm.js +56 -0
  13. package/dist/auth/email/routes/post.cjs.js +149 -0
  14. package/dist/auth/email/routes/post.d.mts +8 -0
  15. package/dist/auth/email/routes/post.d.ts +8 -0
  16. package/dist/auth/email/routes/post.esm.js +124 -0
  17. package/dist/auth/email/routes/put.cjs.js +135 -0
  18. package/dist/auth/email/routes/put.d.mts +8 -0
  19. package/dist/auth/email/routes/put.d.ts +8 -0
  20. package/dist/auth/email/routes/put.esm.js +108 -0
  21. package/dist/auth/email/token.cjs.js +85 -0
  22. package/dist/auth/email/token.d.mts +13 -0
  23. package/dist/auth/email/token.d.ts +13 -0
  24. package/dist/auth/email/token.esm.js +56 -0
  25. package/dist/auth/email/types.cjs.js +18 -0
  26. package/dist/auth/email/types.d.mts +14 -0
  27. package/dist/auth/email/types.d.ts +14 -0
  28. package/dist/auth/email/types.esm.js +0 -0
  29. package/dist/auth/email/utils.cjs.js +83 -0
  30. package/dist/auth/email/utils.d.mts +16 -0
  31. package/dist/auth/email/utils.d.ts +16 -0
  32. package/dist/auth/email/utils.esm.js +55 -0
  33. package/dist/auth/index.d.mts +4 -45
  34. package/dist/auth/index.d.ts +4 -45
  35. package/dist/auth/types.cjs.js +18 -0
  36. package/dist/auth/types.d.mts +21 -0
  37. package/dist/auth/types.d.ts +21 -0
  38. package/dist/auth/types.esm.js +0 -0
  39. package/dist/auth/utils/errors.cjs.js +35 -0
  40. package/dist/auth/utils/errors.d.mts +6 -0
  41. package/dist/auth/utils/errors.d.ts +6 -0
  42. package/dist/auth/utils/errors.esm.js +10 -0
  43. package/dist/graphql/context.cjs.js +76 -0
  44. package/dist/graphql/context.d.mts +6 -0
  45. package/dist/graphql/context.d.ts +6 -0
  46. package/dist/graphql/context.esm.js +51 -0
  47. package/dist/graphql/index.d.mts +7 -23
  48. package/dist/graphql/index.d.ts +7 -23
  49. package/dist/graphql/init.cjs.js +124 -0
  50. package/dist/graphql/init.d.mts +16 -0
  51. package/dist/graphql/init.d.ts +16 -0
  52. package/dist/graphql/init.esm.js +104 -0
  53. package/dist/graphql/types.cjs.js +18 -0
  54. package/dist/graphql/types.d.mts +8 -0
  55. package/dist/graphql/types.d.ts +8 -0
  56. package/dist/graphql/types.esm.js +0 -0
  57. package/dist/graphql/utils.cjs.js +134 -0
  58. package/dist/graphql/utils.d.mts +29 -0
  59. package/dist/graphql/utils.d.ts +29 -0
  60. package/dist/graphql/utils.esm.js +118 -0
  61. package/dist/socials/index.d.mts +9 -130
  62. package/dist/socials/index.d.ts +9 -130
  63. package/dist/socials/instagram/getters.cjs.js +119 -0
  64. package/dist/socials/instagram/getters.d.mts +39 -0
  65. package/dist/socials/instagram/getters.d.ts +39 -0
  66. package/dist/socials/instagram/getters.esm.js +86 -0
  67. package/dist/socials/instagram/setters.cjs.js +54 -0
  68. package/dist/socials/instagram/setters.d.mts +8 -0
  69. package/dist/socials/instagram/setters.d.ts +8 -0
  70. package/dist/socials/instagram/setters.esm.js +27 -0
  71. package/dist/socials/instagram/types.cjs.js +18 -0
  72. package/dist/socials/instagram/types.d.mts +57 -0
  73. package/dist/socials/instagram/types.d.ts +57 -0
  74. package/dist/socials/instagram/types.esm.js +0 -0
  75. package/dist/socials/instagram/utils.cjs.js +44 -0
  76. package/dist/socials/instagram/utils.d.mts +6 -0
  77. package/dist/socials/instagram/utils.d.ts +6 -0
  78. package/dist/socials/instagram/utils.esm.js +18 -0
  79. package/dist/socials/instagram/webhook.cjs.js +57 -0
  80. package/dist/socials/instagram/webhook.d.mts +12 -0
  81. package/dist/socials/instagram/webhook.d.ts +12 -0
  82. package/dist/socials/instagram/webhook.esm.js +30 -0
  83. package/dist/socials/meta-webhook.cjs.js +36 -0
  84. package/dist/socials/meta-webhook.d.mts +5 -0
  85. package/dist/socials/meta-webhook.d.ts +5 -0
  86. package/dist/socials/meta-webhook.esm.js +11 -0
  87. package/dist/socials/threads/getters.cjs.js +60 -0
  88. package/dist/socials/threads/getters.d.mts +7 -0
  89. package/dist/socials/threads/getters.d.ts +7 -0
  90. package/dist/socials/threads/getters.esm.js +31 -0
  91. package/dist/socials/threads/setters.cjs.js +87 -0
  92. package/dist/socials/threads/setters.d.mts +6 -0
  93. package/dist/socials/threads/setters.d.ts +6 -0
  94. package/dist/socials/threads/setters.esm.js +57 -0
  95. package/dist/socials/threads/types.cjs.js +18 -0
  96. package/dist/socials/threads/types.d.mts +7 -0
  97. package/dist/socials/threads/types.d.ts +7 -0
  98. package/dist/socials/threads/types.esm.js +0 -0
  99. package/dist/socials/threads/utils.cjs.js +39 -0
  100. package/dist/socials/threads/utils.d.mts +4 -0
  101. package/dist/socials/threads/utils.d.ts +4 -0
  102. package/dist/socials/threads/utils.esm.js +13 -0
  103. package/dist/socials/threads/webhook.cjs.js +54 -0
  104. package/dist/socials/threads/webhook.d.mts +12 -0
  105. package/dist/socials/threads/webhook.d.ts +12 -0
  106. package/dist/socials/threads/webhook.esm.js +27 -0
  107. package/package.json +1 -1
@@ -0,0 +1,18 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/socials/threads/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,7 @@
1
+ type ThreadsPost = {
2
+ text: string;
3
+ permalink: string;
4
+ username: string;
5
+ };
6
+
7
+ export type { ThreadsPost };
@@ -0,0 +1,7 @@
1
+ type ThreadsPost = {
2
+ text: string;
3
+ permalink: string;
4
+ username: string;
5
+ };
6
+
7
+ export type { ThreadsPost };
File without changes
@@ -0,0 +1,39 @@
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/socials/threads/utils.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ getThreadsData: () => getThreadsData,
24
+ getThreadsURL: () => getThreadsURL
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+ function getThreadsURL(token, path, params) {
28
+ return `https://graph.threads.net/v1.0/${path}?${Object.keys(params).map((key) => `${key}=${params[key]}`).join("&")}&access_token=${token}`;
29
+ }
30
+ function getThreadsData(token, path, params, method) {
31
+ return fetch(getThreadsURL(token, path, params), {
32
+ method: method || "GET"
33
+ }).then((res) => res.json());
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ getThreadsData,
38
+ getThreadsURL
39
+ });
@@ -0,0 +1,4 @@
1
+ declare function getThreadsURL(token: string, path: string, params: Record<string, string>): string;
2
+ declare function getThreadsData<T>(token: string, path: string, params: Record<string, string>, method?: "POST"): Promise<T | null>;
3
+
4
+ export { getThreadsData, getThreadsURL };
@@ -0,0 +1,4 @@
1
+ declare function getThreadsURL(token: string, path: string, params: Record<string, string>): string;
2
+ declare function getThreadsData<T>(token: string, path: string, params: Record<string, string>, method?: "POST"): Promise<T | null>;
3
+
4
+ export { getThreadsData, getThreadsURL };
@@ -0,0 +1,13 @@
1
+ // src/socials/threads/utils.ts
2
+ function getThreadsURL(token, path, params) {
3
+ return `https://graph.threads.net/v1.0/${path}?${Object.keys(params).map((key) => `${key}=${params[key]}`).join("&")}&access_token=${token}`;
4
+ }
5
+ function getThreadsData(token, path, params, method) {
6
+ return fetch(getThreadsURL(token, path, params), {
7
+ method: method || "GET"
8
+ }).then((res) => res.json());
9
+ }
10
+ export {
11
+ getThreadsData,
12
+ getThreadsURL
13
+ };
@@ -0,0 +1,54 @@
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/socials/threads/webhook.ts
21
+ var webhook_exports = {};
22
+ __export(webhook_exports, {
23
+ setupThreadsWebhook: () => setupThreadsWebhook
24
+ });
25
+ module.exports = __toCommonJS(webhook_exports);
26
+
27
+ // src/socials/meta-webhook.ts
28
+ var import_server = require("next/server");
29
+ var verifyWebhook = (secret) => (req) => {
30
+ const params = req.nextUrl.searchParams;
31
+ if (params.get("hub.verify_token") === secret) {
32
+ return new import_server.NextResponse(params.get("hub.challenge"));
33
+ }
34
+ };
35
+
36
+ // src/socials/threads/webhook.ts
37
+ var setupThreadsWebhook = (options) => {
38
+ return {
39
+ GET: verifyWebhook(options.secret),
40
+ POST: async (req) => {
41
+ const payload = await req.json();
42
+ let allGood = true;
43
+ for (const { value, field } of payload.values) {
44
+ allGood = allGood && await options.callback(field, value);
45
+ }
46
+ if (!allGood) return new Response("BAD", { status: 500 });
47
+ return new Response("OK");
48
+ }
49
+ };
50
+ };
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ setupThreadsWebhook
54
+ });
@@ -0,0 +1,12 @@
1
+ import * as next_server from 'next/server';
2
+ import { NextRequest } from 'next/server';
3
+
4
+ declare const setupThreadsWebhook: (options: {
5
+ secret: string;
6
+ callback: (type: string, value: any) => Promise<boolean>;
7
+ }) => {
8
+ GET: (req: NextRequest) => next_server.NextResponse<unknown> | undefined;
9
+ POST: (req: NextRequest) => Promise<Response>;
10
+ };
11
+
12
+ export { setupThreadsWebhook };
@@ -0,0 +1,12 @@
1
+ import * as next_server from 'next/server';
2
+ import { NextRequest } from 'next/server';
3
+
4
+ declare const setupThreadsWebhook: (options: {
5
+ secret: string;
6
+ callback: (type: string, value: any) => Promise<boolean>;
7
+ }) => {
8
+ GET: (req: NextRequest) => next_server.NextResponse<unknown> | undefined;
9
+ POST: (req: NextRequest) => Promise<Response>;
10
+ };
11
+
12
+ export { setupThreadsWebhook };
@@ -0,0 +1,27 @@
1
+ // src/socials/meta-webhook.ts
2
+ import { NextResponse } from "next/server";
3
+ var verifyWebhook = (secret) => (req) => {
4
+ const params = req.nextUrl.searchParams;
5
+ if (params.get("hub.verify_token") === secret) {
6
+ return new NextResponse(params.get("hub.challenge"));
7
+ }
8
+ };
9
+
10
+ // src/socials/threads/webhook.ts
11
+ var setupThreadsWebhook = (options) => {
12
+ return {
13
+ GET: verifyWebhook(options.secret),
14
+ POST: async (req) => {
15
+ const payload = await req.json();
16
+ let allGood = true;
17
+ for (const { value, field } of payload.values) {
18
+ allGood = allGood && await options.callback(field, value);
19
+ }
20
+ if (!allGood) return new Response("BAD", { status: 500 });
21
+ return new Response("OK");
22
+ }
23
+ };
24
+ };
25
+ export {
26
+ setupThreadsWebhook
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.1.11",
3
+ "version": "1.1.12-beta.1",
4
4
  "description": "A stack built with tight Next + Drizzle + GraphQL",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",