@easy-cms/plugin-ecommerce 0.47.3 → 0.48.0
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.
|
@@ -702,7 +702,7 @@ var STATUS_LABELS = {
|
|
|
702
702
|
import { AsyncLocalStorage } from "async_hooks";
|
|
703
703
|
import {
|
|
704
704
|
definePlugin,
|
|
705
|
-
ForbiddenError,
|
|
705
|
+
ForbiddenError as ForbiddenError2,
|
|
706
706
|
UnauthorizedError
|
|
707
707
|
} from "@easy-cms/core";
|
|
708
708
|
|
|
@@ -781,12 +781,13 @@ var newOrder = ({ order, locale, currency }) => {
|
|
|
781
781
|
// src/info.ts
|
|
782
782
|
var INFO = {
|
|
783
783
|
name: "@easy-cms/plugin-ecommerce",
|
|
784
|
-
...true ? { version: "0.
|
|
784
|
+
...true ? { version: "0.48.0" } : {}
|
|
785
785
|
};
|
|
786
786
|
|
|
787
787
|
// src/shop.ts
|
|
788
788
|
import { createHash, randomBytes, timingSafeEqual } from "crypto";
|
|
789
789
|
import {
|
|
790
|
+
ForbiddenError,
|
|
790
791
|
NotFoundError,
|
|
791
792
|
QueryError,
|
|
792
793
|
ValidationError as ValidationError2
|
|
@@ -1407,6 +1408,8 @@ var Orders = class {
|
|
|
1407
1408
|
depth: 0
|
|
1408
1409
|
}).catch(() => null);
|
|
1409
1410
|
if (!visible) throw new NotFoundError(ORDERS, String(id));
|
|
1411
|
+
const { update } = await this.cms.documentPermissions(ORDERS, oid, who.user, who.context);
|
|
1412
|
+
if (!update) throw new ForbiddenError();
|
|
1410
1413
|
const transaction = await this.transactionOf(visible);
|
|
1411
1414
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1412
1415
|
const move = async (from, to, extra = {}) => {
|
|
@@ -1538,7 +1541,7 @@ var signedIn = (req) => {
|
|
|
1538
1541
|
};
|
|
1539
1542
|
var staffOnly = (req) => {
|
|
1540
1543
|
const user = signedIn(req);
|
|
1541
|
-
if (user.member === true) throw new
|
|
1544
|
+
if (user.member === true) throw new ForbiddenError2();
|
|
1542
1545
|
return user;
|
|
1543
1546
|
};
|
|
1544
1547
|
function cartRef(body) {
|
|
@@ -1762,7 +1765,7 @@ function ecommercePlugin(options) {
|
|
|
1762
1765
|
handler: async (req) => {
|
|
1763
1766
|
staffOnly(req);
|
|
1764
1767
|
const action = req.params.action;
|
|
1765
|
-
if (!ORDER_ACTIONS.has(action)) throw new
|
|
1768
|
+
if (!ORDER_ACTIONS.has(action)) throw new ForbiddenError2();
|
|
1766
1769
|
const order = await runtime(req.cms).orders.act(req.params.id, action, who(req));
|
|
1767
1770
|
return { order };
|
|
1768
1771
|
}
|
package/dist/index.js
CHANGED
package/dist/stripe.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paymentFailed,
|
|
3
3
|
paymentSucceeded
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R6ND4JF3.js";
|
|
5
5
|
|
|
6
6
|
// src/stripe.ts
|
|
7
7
|
function stripeAdapter(options) {
|
|
@@ -61,7 +61,7 @@ function stripeAdapter(options) {
|
|
|
61
61
|
method: "post",
|
|
62
62
|
handler: async (req) => {
|
|
63
63
|
const signature = req.request.headers.get("stripe-signature") ?? "";
|
|
64
|
-
const body = await req.
|
|
64
|
+
const body = await req.text();
|
|
65
65
|
let event;
|
|
66
66
|
try {
|
|
67
67
|
event = await (await stripe()).webhooks.constructEventAsync(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/plugin-ecommerce",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "A shop for Easy CMS: products and variants, prices in several currencies, carts (guests too), checkout with Stripe or bank transfer, orders, stock, customer accounts, and React and Vue hooks",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": ">=18.0.0",
|
|
37
37
|
"stripe": ">=17.0.0",
|
|
38
38
|
"vue": "^3.4.0",
|
|
39
|
-
"@easy-cms/core": "^0.
|
|
39
|
+
"@easy-cms/core": "^0.48.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependenciesMeta": {
|
|
42
42
|
"react": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"happy-dom": "^20.14.5",
|
|
55
55
|
"react": "^19.2.0",
|
|
56
56
|
"vue": "^3.5.43",
|
|
57
|
-
"@easy-cms/core": "^0.
|
|
58
|
-
"@easy-cms/db-sqlite": "^0.
|
|
59
|
-
"@easy-cms/plugin-multi-tenant": "^0.
|
|
57
|
+
"@easy-cms/core": "^0.48.0",
|
|
58
|
+
"@easy-cms/db-sqlite": "^0.48.0",
|
|
59
|
+
"@easy-cms/plugin-multi-tenant": "^0.48.0"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=22.12"
|