@friendsofshopware/app-server-sdk-hono
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -23,2 +23,3 @@ import { HTTPException } from "hono/http-exception"; | ||
} | ||
// @ts-ignore | ||
ctx.set("app", app); | ||
@@ -28,2 +29,3 @@ await next(); | ||
hono.use(cfg.appPath, async (ctx, next) => { | ||
// @ts-ignore | ||
const app = ctx.get("app"); | ||
@@ -46,10 +48,13 @@ // 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 ctx.get("app").signer.signResponse(cloned, ctx.get("shop").getShopSecret()); | ||
await app.signer.signResponse(cloned, context.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"); | ||
@@ -66,2 +71,3 @@ try { | ||
hono.post(cfg.registerConfirmationUrl, async (ctx) => { | ||
// @ts-ignore | ||
const app = ctx.get("app"); | ||
@@ -68,0 +74,0 @@ try { |
@@ -5,3 +5,3 @@ { | ||
"name": "@friendsofshopware/app-server-sdk-hono", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"description": "Hono Integration for Shopware App Server SDK", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
import type { Context as HonoContext, Hono } from "hono"; | ||
import { AppServer, Context, ShopInterface, ShopRepositoryInterface } from "@friendsofshopware/app-server-sdk"; | ||
import { ShopRepositoryInterface } from "@friendsofshopware/app-server-sdk"; | ||
interface MiddlewareConfig { | ||
@@ -12,10 +12,3 @@ appName: string; | ||
} | ||
type Variables = { | ||
app: AppServer; | ||
shop: ShopInterface; | ||
context: Context; | ||
}; | ||
export declare function configureAppServer(hono: Hono<{ | ||
Variables: Variables; | ||
}>, cfg: MiddlewareConfig): void; | ||
export declare function configureAppServer(hono: Hono, cfg: MiddlewareConfig): void; | ||
export {}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4039
92