naystack 1.1.6 → 1.1.8
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.
|
@@ -136,8 +136,11 @@ var setupInstagramWebhook = (options) => {
|
|
|
136
136
|
POST: async (req) => {
|
|
137
137
|
const payload = await req.json();
|
|
138
138
|
for (const entry of payload.entry) {
|
|
139
|
-
for (const
|
|
140
|
-
|
|
139
|
+
for (const type of Object.keys(entry)) {
|
|
140
|
+
if (!(entry[type] instanceof Array)) continue;
|
|
141
|
+
for (const change of entry[type]) {
|
|
142
|
+
await options.callback(type, change, entry.id);
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
return new Response("OK");
|
package/dist/socials/index.d.mts
CHANGED
|
@@ -99,7 +99,7 @@ declare const sendInstagramMessage: (token: string, to: string, text: string) =>
|
|
|
99
99
|
|
|
100
100
|
declare const setupInstagramWebhook: (options: {
|
|
101
101
|
secret: string;
|
|
102
|
-
callback: (type: string, value:
|
|
102
|
+
callback: (type: string, value: any, id: string) => Promise<void>;
|
|
103
103
|
}) => {
|
|
104
104
|
GET: (req: NextRequest) => next_server.NextResponse<unknown> | undefined;
|
|
105
105
|
POST: (req: NextRequest) => Promise<Response>;
|
package/dist/socials/index.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ declare const sendInstagramMessage: (token: string, to: string, text: string) =>
|
|
|
99
99
|
|
|
100
100
|
declare const setupInstagramWebhook: (options: {
|
|
101
101
|
secret: string;
|
|
102
|
-
callback: (type: string, value:
|
|
102
|
+
callback: (type: string, value: any, id: string) => Promise<void>;
|
|
103
103
|
}) => {
|
|
104
104
|
GET: (req: NextRequest) => next_server.NextResponse<unknown> | undefined;
|
|
105
105
|
POST: (req: NextRequest) => Promise<Response>;
|
|
@@ -98,8 +98,11 @@ var setupInstagramWebhook = (options) => {
|
|
|
98
98
|
POST: async (req) => {
|
|
99
99
|
const payload = await req.json();
|
|
100
100
|
for (const entry of payload.entry) {
|
|
101
|
-
for (const
|
|
102
|
-
|
|
101
|
+
for (const type of Object.keys(entry)) {
|
|
102
|
+
if (!(entry[type] instanceof Array)) continue;
|
|
103
|
+
for (const change of entry[type]) {
|
|
104
|
+
await options.callback(type, change, entry.id);
|
|
105
|
+
}
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
return new Response("OK");
|