New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@friendsofshopware/app-server-sdk-hono

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@friendsofshopware/app-server-sdk-hono - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

15

esm/mod.js

@@ -11,4 +11,3 @@ import { HTTPException } from "hono/http-exception";

if (app === null) {
const appUrl = cfg.appUrl ||
ctx.req.url.substring(0, ctx.req.url.length - (new URL(ctx.req.url).pathname.length));
const appUrl = cfg.appUrl || buildBaseUrl(ctx.req.url);
if (typeof cfg.shopRepository === "function") {

@@ -24,3 +23,2 @@ // @ts-ignore

}
// @ts-ignore
ctx.set("app", app);

@@ -30,3 +28,2 @@ await next();

hono.use(cfg.appPath, async (ctx, next) => {
// @ts-ignore
const app = ctx.get("app");

@@ -49,13 +46,10 @@ // Don't validate signature for registration

}
// @ts-ignore
ctx.set("shop", context.shop);
// @ts-ignore
ctx.set("context", context);
await next();
const cloned = ctx.res.clone();
await app.signer.signResponse(cloned, context.shop.getShopSecret());
await ctx.get("app").signer.signResponse(cloned, ctx.get("shop").getShopSecret());
ctx.header("shopware-app-signature", cloned.headers.get("shopware-app-signature"));
});
hono.get(cfg.registrationUrl, async (ctx) => {
// @ts-ignore
const app = ctx.get("app");

@@ -72,3 +66,2 @@ try {

hono.post(cfg.registerConfirmationUrl, async (ctx) => {
// @ts-ignore
const app = ctx.get("app");

@@ -85,1 +78,5 @@ try {

}
function buildBaseUrl(url) {
const u = new URL(url);
return `${u.protocol}//${u.host}`;
}

2

package.json

@@ -5,3 +5,3 @@ {

"name": "@friendsofshopware/app-server-sdk-hono",
"version": "0.0.35",
"version": "0.0.36",
"description": "Hono Integration for Shopware App Server SDK",

@@ -8,0 +8,0 @@ "license": "MIT",

import type { Context as HonoContext, Hono } from "hono";
import { ShopRepositoryInterface } from "@friendsofshopware/app-server-sdk";
import { AppServer, Context, ShopInterface, ShopRepositoryInterface } from "@friendsofshopware/app-server-sdk";
interface MiddlewareConfig {

@@ -12,3 +12,10 @@ appName: string;

}
export declare function configureAppServer(hono: Hono, cfg: MiddlewareConfig): void;
type Variables = {
app: AppServer;
shop: ShopInterface;
context: Context;
};
export declare function configureAppServer(hono: Hono<{
Variables: Variables;
}>, cfg: MiddlewareConfig): void;
export {};
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