Refresh UI components and showcase; release updated framework packages
This commit is contained in:
1 parent
d800228585
commit
c77f5e1cec
293 files changed
+22544
-35778
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/payment",
|
||||
"version": "0.8.8",
|
||||
"version": "0.8.9",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
|
||||
@@ -60,7 +60,7 @@ export function paymentPlugin() {
|
||||
if (!context.metadata.get(key)) return [];
|
||||
const apiEnabled = context.metadata.get("@wrnexus/payment:api") !== false;
|
||||
return [
|
||||
{ kind: "api" as const, path: "/api/payments/webhook/:gateway", entry: webhookEntry },
|
||||
{ kind: "api" as const, path: "/api/payments/webhook/[gateway]", entry: webhookEntry },
|
||||
...(apiEnabled
|
||||
? apiRoutes.map((path) => ({ kind: "api" as const, path, entry: apiEntry }))
|
||||
: []),
|
||||
|
||||
@@ -3,6 +3,7 @@ import { closeDatabases, setDb } from "@wrnexus/db";
|
||||
import { connectFromConfig } from "@wrnexus/db/connect";
|
||||
import { createPluginRunner } from "@wrnexus/plugin";
|
||||
import { parse } from "@wrnexus/syntax";
|
||||
import { compileRoutePattern } from "../../router/src/match.ts";
|
||||
import { readFileSync, readdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { databasePaymentStore, paymentPlugin } from "../src/index.ts";
|
||||
@@ -25,7 +26,10 @@ test("payment plugin contributes its schema only when configured", async () => {
|
||||
"wrnexus-payment-002-event-order",
|
||||
]);
|
||||
expect(contributions.componentDirs).toHaveLength(1);
|
||||
expect(contributions.routes.map((row) => row.path)).toEqual(["/api/payments/webhook/:gateway"]);
|
||||
expect(contributions.routes.map((row) => row.path)).toEqual(["/api/payments/webhook/[gateway]"]);
|
||||
const webhookPattern = compileRoutePattern(contributions.routes[0]!.path);
|
||||
expect(webhookPattern.regex.exec("/api/payments/webhook/razorpay")?.[1]).toBe("razorpay");
|
||||
expect(webhookPattern.paramNames).toEqual(["gateway"]);
|
||||
const off = createPluginRunner(paymentPlugin(), { ...context, metadata: new Map() });
|
||||
await off.configure({} as any);
|
||||
expect((await off.contributions()).migrations).toHaveLength(0);
|
||||
|
||||
Reference in new issue
Block a user