Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

netlify-onegraph-internal

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netlify-onegraph-internal - npm Package Compare versions

Comparing version 0.0.26 to 0.0.27

2

dist/codegen/nextjsExporter.js

@@ -334,3 +334,3 @@ "use strict";

kind: "UnnamedExportedFile",
content: "" + ts(netlifyGraphConfig, 'import type { NextApiRequest, NextApiResponse } from "next";\n') + imp(netlifyGraphConfig, "NetlifyGraph", netlifyGraphConfig.netlifyGraphRequirePath) + ";\n\n" + exp(netlifyGraphConfig, "handler") + " = async (req" + ts(netlifyGraphConfig, ": NextApiRequest") + ", res" + ts(netlifyGraphConfig, ": NextApiResponse") + ") => {\n const reqBody = await extractBody(req);\n\n const payload = NetlifyGraph.parseAndVerify" + operationData.name + "Event({\n headers: req.headers,\n body: reqBody,\n });\n\n if (!payload) {\n return res.status(422).json({\n success: false,\n error: 'Unable to verify payload signature',\n });\n }\n\n const { errors, data } = payload;\n\n if (errors) {\n console.error(errors);\n }\n\n console.log(data);\n\n res.setHeader(\"Content-Type\", \"application/json\");\n\n /**\n * If you want to unsubscribe from this webhook\n * in order to stop receiving new events,\n * simply return status 410, e.g.:\n * \n * return res.status(410).json({});\n */\n\n return res.status(200).json({\n successfullyProcessedIncomingWebhook: true,\n });\n};\n\n" + expDefault(netlifyGraphConfig, "handler") + ";\n\nexport const config = {\n api: {\n // We manually parse the body of the request in order to verify\n // that it's signed by Netlify before processing the event.\n bodyParser: false,\n },\n};\n\nconst extractBody = (req" + ts(netlifyGraphConfig, ": NextApiRequest") + ")" + ts(netlifyGraphConfig, ": Promise<string>") + " => {\n let body = [];\n const promise" + ts(netlifyGraphConfig, ": Promise<string>") + " = new Promise((resolve, reject) => {\n req\n .on(\"data\", (chunk) => {\n body.push(chunk);\n })\n .on(\"end\", () => {\n const fullBody = Buffer.concat(body).toString();\n resolve(fullBody);\n });\n });\n\n return promise;\n};\n",
content: "" + ts(netlifyGraphConfig, 'import type { NextApiRequest, NextApiResponse } from "next";\n') + imp(netlifyGraphConfig, "NetlifyGraph", netlifyGraphConfig.netlifyGraphRequirePath) + ";\n\n" + exp(netlifyGraphConfig, "handler") + " = async (req" + ts(netlifyGraphConfig, ": NextApiRequest") + ", res" + ts(netlifyGraphConfig, ": NextApiResponse") + ") => {\n const reqBody = await extractBody(req);\n\n const payload = NetlifyGraph.parseAndVerify" + operationData.name + "Event({\n headers: {\n \"x-netlify-graph-signature\": req.headers[\n \"x-netlify-graph-signature\"\n ]" + ts(netlifyGraphConfig, " as string") + "\n },\n body: reqBody,\n });\n\n if (!payload) {\n return res.status(422).json({\n success: false,\n error: 'Unable to verify payload signature',\n });\n }\n\n const { errors, data } = payload;\n\n if (errors) {\n console.error(errors);\n }\n\n console.log(data);\n\n res.setHeader(\"Content-Type\", \"application/json\");\n\n /**\n * If you want to unsubscribe from this webhook\n * in order to stop receiving new events,\n * simply return status 410, e.g.:\n * \n * return res.status(410).json({});\n */\n\n return res.status(200).json({\n successfullyProcessedIncomingWebhook: true,\n });\n};\n\n" + expDefault(netlifyGraphConfig, "handler") + ";\n\nexport const config = {\n api: {\n // We manually parse the body of the request in order to verify\n // that it's signed by Netlify before processing the event.\n bodyParser: false,\n },\n};\n\nconst extractBody = (req" + ts(netlifyGraphConfig, ": NextApiRequest") + ")" + ts(netlifyGraphConfig, ": Promise<string>") + " => {\n let body = [];\n const promise" + ts(netlifyGraphConfig, ": Promise<string>") + " = new Promise((resolve, reject) => {\n req\n .on(\"data\", (chunk) => {\n body.push(chunk);\n })\n .on(\"end\", () => {\n const fullBody = Buffer.concat(body).toString();\n resolve(fullBody);\n });\n });\n\n return promise;\n};\n",
};

@@ -337,0 +337,0 @@ };

{
"name": "netlify-onegraph-internal",
"version": "0.0.26",
"version": "0.0.27",
"description": "Internal tools for use by Netlify",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc