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.
- package/dist/auth/email/index.cjs.js +203 -0
- package/dist/auth/email/index.d.mts +18 -0
- package/dist/auth/email/index.d.ts +18 -0
- package/dist/auth/email/index.esm.js +176 -0
- package/dist/auth/email/routes/delete.cjs.js +58 -0
- package/dist/auth/email/routes/delete.d.mts +8 -0
- package/dist/auth/email/routes/delete.d.ts +8 -0
- package/dist/auth/email/routes/delete.esm.js +31 -0
- package/dist/auth/email/routes/get.cjs.js +83 -0
- package/dist/auth/email/routes/get.d.mts +11 -0
- package/dist/auth/email/routes/get.d.ts +11 -0
- package/dist/auth/email/routes/get.esm.js +56 -0
- package/dist/auth/email/routes/post.cjs.js +149 -0
- package/dist/auth/email/routes/post.d.mts +8 -0
- package/dist/auth/email/routes/post.d.ts +8 -0
- package/dist/auth/email/routes/post.esm.js +124 -0
- package/dist/auth/email/routes/put.cjs.js +135 -0
- package/dist/auth/email/routes/put.d.mts +8 -0
- package/dist/auth/email/routes/put.d.ts +8 -0
- package/dist/auth/email/routes/put.esm.js +108 -0
- package/dist/auth/email/token.cjs.js +85 -0
- package/dist/auth/email/token.d.mts +13 -0
- package/dist/auth/email/token.d.ts +13 -0
- package/dist/auth/email/token.esm.js +56 -0
- package/dist/auth/email/types.cjs.js +18 -0
- package/dist/auth/email/types.d.mts +14 -0
- package/dist/auth/email/types.d.ts +14 -0
- package/dist/auth/email/types.esm.js +0 -0
- package/dist/auth/email/utils.cjs.js +83 -0
- package/dist/auth/email/utils.d.mts +16 -0
- package/dist/auth/email/utils.d.ts +16 -0
- package/dist/auth/email/utils.esm.js +55 -0
- package/dist/auth/index.d.mts +4 -45
- package/dist/auth/index.d.ts +4 -45
- package/dist/auth/types.cjs.js +18 -0
- package/dist/auth/types.d.mts +21 -0
- package/dist/auth/types.d.ts +21 -0
- package/dist/auth/types.esm.js +0 -0
- package/dist/auth/utils/errors.cjs.js +35 -0
- package/dist/auth/utils/errors.d.mts +6 -0
- package/dist/auth/utils/errors.d.ts +6 -0
- package/dist/auth/utils/errors.esm.js +10 -0
- package/dist/graphql/context.cjs.js +76 -0
- package/dist/graphql/context.d.mts +6 -0
- package/dist/graphql/context.d.ts +6 -0
- package/dist/graphql/context.esm.js +51 -0
- package/dist/graphql/index.d.mts +7 -23
- package/dist/graphql/index.d.ts +7 -23
- package/dist/graphql/init.cjs.js +124 -0
- package/dist/graphql/init.d.mts +16 -0
- package/dist/graphql/init.d.ts +16 -0
- package/dist/graphql/init.esm.js +104 -0
- package/dist/graphql/types.cjs.js +18 -0
- package/dist/graphql/types.d.mts +8 -0
- package/dist/graphql/types.d.ts +8 -0
- package/dist/graphql/types.esm.js +0 -0
- package/dist/graphql/utils.cjs.js +134 -0
- package/dist/graphql/utils.d.mts +29 -0
- package/dist/graphql/utils.d.ts +29 -0
- package/dist/graphql/utils.esm.js +118 -0
- package/dist/socials/index.d.mts +9 -130
- package/dist/socials/index.d.ts +9 -130
- package/dist/socials/instagram/getters.cjs.js +119 -0
- package/dist/socials/instagram/getters.d.mts +39 -0
- package/dist/socials/instagram/getters.d.ts +39 -0
- package/dist/socials/instagram/getters.esm.js +86 -0
- package/dist/socials/instagram/setters.cjs.js +54 -0
- package/dist/socials/instagram/setters.d.mts +8 -0
- package/dist/socials/instagram/setters.d.ts +8 -0
- package/dist/socials/instagram/setters.esm.js +27 -0
- package/dist/socials/instagram/types.cjs.js +18 -0
- package/dist/socials/instagram/types.d.mts +57 -0
- package/dist/socials/instagram/types.d.ts +57 -0
- package/dist/socials/instagram/types.esm.js +0 -0
- package/dist/socials/instagram/utils.cjs.js +44 -0
- package/dist/socials/instagram/utils.d.mts +6 -0
- package/dist/socials/instagram/utils.d.ts +6 -0
- package/dist/socials/instagram/utils.esm.js +18 -0
- package/dist/socials/instagram/webhook.cjs.js +57 -0
- package/dist/socials/instagram/webhook.d.mts +12 -0
- package/dist/socials/instagram/webhook.d.ts +12 -0
- package/dist/socials/instagram/webhook.esm.js +30 -0
- package/dist/socials/meta-webhook.cjs.js +36 -0
- package/dist/socials/meta-webhook.d.mts +5 -0
- package/dist/socials/meta-webhook.d.ts +5 -0
- package/dist/socials/meta-webhook.esm.js +11 -0
- package/dist/socials/threads/getters.cjs.js +60 -0
- package/dist/socials/threads/getters.d.mts +7 -0
- package/dist/socials/threads/getters.d.ts +7 -0
- package/dist/socials/threads/getters.esm.js +31 -0
- package/dist/socials/threads/setters.cjs.js +87 -0
- package/dist/socials/threads/setters.d.mts +6 -0
- package/dist/socials/threads/setters.d.ts +6 -0
- package/dist/socials/threads/setters.esm.js +57 -0
- package/dist/socials/threads/types.cjs.js +18 -0
- package/dist/socials/threads/types.d.mts +7 -0
- package/dist/socials/threads/types.d.ts +7 -0
- package/dist/socials/threads/types.esm.js +0 -0
- package/dist/socials/threads/utils.cjs.js +39 -0
- package/dist/socials/threads/utils.d.mts +4 -0
- package/dist/socials/threads/utils.d.ts +4 -0
- package/dist/socials/threads/utils.esm.js +13 -0
- package/dist/socials/threads/webhook.cjs.js +54 -0
- package/dist/socials/threads/webhook.d.mts +12 -0
- package/dist/socials/threads/webhook.d.ts +12 -0
- package/dist/socials/threads/webhook.esm.js +27 -0
- 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);
|
|
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
|
+
};
|