build: rebuild release and app bundles
This commit is contained in:
+36
-22
@@ -99080,15 +99080,25 @@ var require_admin_products_service = __commonJS({
|
||||
* their sortOrder refreshed, genuinely new URLs are inserted, and rows the
|
||||
* form dropped are deleted.
|
||||
*
|
||||
* The form always posts all 4 image fields together (even as empty/absent),
|
||||
* so any one of them being present means this is a real submit rather than a
|
||||
* partial PATCH that happens to omit the others.
|
||||
* Only the slots whose key is present are reconciled; an absent key leaves
|
||||
* that slot's rows alone. The form posts all 4 (empty as null / []), but the
|
||||
* controller strips the site slots for anyone but the super admin, and
|
||||
* those must survive the save.
|
||||
*/
|
||||
async syncImages(productId, data) {
|
||||
if (!["indicator_id", "mobile_pic", "images", "images_mobile"].some((k) => k in data))
|
||||
const slotRoles = [
|
||||
["indicator_id", "FEATURED"],
|
||||
["mobile_pic", "FEATURED_MOBILE"],
|
||||
["images", "GALLERY"],
|
||||
["images_mobile", "GALLERY_MOBILE"]
|
||||
];
|
||||
const roles = slotRoles.filter(([key]) => key in data).map(([, role]) => role);
|
||||
if (!roles.length)
|
||||
return;
|
||||
const desired = this.imageCreateData(data);
|
||||
const current = await this.prisma.productImage.findMany({ where: { productId } });
|
||||
const current = await this.prisma.productImage.findMany({
|
||||
where: { productId, role: { in: roles } }
|
||||
});
|
||||
const pools = /* @__PURE__ */ new Map();
|
||||
for (const row of current) {
|
||||
const key = `${row.role}\0${row.url}`;
|
||||
@@ -99256,6 +99266,14 @@ var require_admin_products_controller = __commonJS({
|
||||
var table_query_dto_1 = require_table_query_dto();
|
||||
var guards_1 = require_guards2();
|
||||
var super_admin_1 = require_super_admin();
|
||||
var SITE_FIELDS = ["show_type", "body_html", "description", "indicator_id", "images"];
|
||||
function withoutSiteFields(data, admin) {
|
||||
if ((0, super_admin_1.isSuperAdmin)(admin.mobile))
|
||||
return data;
|
||||
for (const key of SITE_FIELDS)
|
||||
delete data[key];
|
||||
return data;
|
||||
}
|
||||
var AdminProductsController = class AdminProductsController {
|
||||
products;
|
||||
constructor(products) {
|
||||
@@ -99304,7 +99322,7 @@ var require_admin_products_controller = __commonJS({
|
||||
create(data, admin) {
|
||||
if (!(0, super_admin_1.isSuperAdmin)(admin.mobile))
|
||||
delete data.ciny_ids;
|
||||
return this.products.create(data);
|
||||
return this.products.create(withoutSiteFields(data, admin));
|
||||
}
|
||||
remove(id) {
|
||||
return this.products.remove(id);
|
||||
@@ -99315,8 +99333,8 @@ var require_admin_products_controller = __commonJS({
|
||||
findOne(id) {
|
||||
return this.products.findOne(id);
|
||||
}
|
||||
update(id, data) {
|
||||
return this.products.update(id, data);
|
||||
update(id, data, admin) {
|
||||
return this.products.update(id, withoutSiteFields(data, admin));
|
||||
}
|
||||
};
|
||||
exports2.AdminProductsController = AdminProductsController;
|
||||
@@ -99446,8 +99464,9 @@ var require_admin_products_controller = __commonJS({
|
||||
(0, guards_1.RequirePermission)("product.list.edit"),
|
||||
__param3(0, (0, common_12.Param)("id")),
|
||||
__param3(1, (0, common_12.Body)()),
|
||||
__param3(2, (0, guards_1.CurrentAdmin)()),
|
||||
__metadata3("design:type", Function),
|
||||
__metadata3("design:paramtypes", [String, Object]),
|
||||
__metadata3("design:paramtypes", [String, Object, Object]),
|
||||
__metadata3("design:returntype", void 0)
|
||||
], AdminProductsController.prototype, "update", null);
|
||||
exports2.AdminProductsController = AdminProductsController = __decorate4([
|
||||
@@ -102800,11 +102819,9 @@ var require_admin_misc_controller = __commonJS({
|
||||
}
|
||||
// The mobile home slider ("اسلایدر موبایل") is stored under the same
|
||||
// `Setting` table as every other `const/:key` entry (key: mobile_main_slider),
|
||||
// but it gets its own permission (`custom.config.statics.slider`, per
|
||||
// acl.constants.ts / permissionConst.ts) rather than the broad `config.statics`
|
||||
// that guards the rest of the "مدیریت ثابت ها" screen — uploading/replacing the
|
||||
// public site banner is more sensitive than editing brand/tag lists, so it
|
||||
// should not be reachable by everyone who can merely open that screen.
|
||||
// and is open to everyone who can use the "مدیریت ثابت ها" screen
|
||||
// (`config.statics`). The older `custom.config.statics.slider` rid stays in
|
||||
// the catalogue so roles that still hold it keep saving, but gates nothing.
|
||||
// Routes declared ahead of `const/:key` so Nest doesn't match `const/slider`
|
||||
// (the legacy REST shape) to the generic key handler instead.
|
||||
getSlider() {
|
||||
@@ -102828,11 +102845,8 @@ var require_admin_misc_controller = __commonJS({
|
||||
this.assertNotSliderKey(key);
|
||||
return this.misc.removeConst(key);
|
||||
}
|
||||
// Blocks the generic `config.statics`-gated routes from reaching the slider
|
||||
// setting by its raw key — otherwise anyone with `config.statics` could
|
||||
// bypass the dedicated `const/slider` routes (guarded by the stricter
|
||||
// `custom.config.statics.slider`) simply by calling `const/mobile_main_slider`
|
||||
// directly, since the underlying Setting row is keyed the same either way.
|
||||
// Keys with a dedicated route are refused here so each has exactly one way
|
||||
// in: the slider (`const/slider`) and the accounting and pricing settings.
|
||||
assertNotSliderKey(key) {
|
||||
if (key === "mobile_main_slider" || (0, accounting_config_1.isAccountingSettingKey)(key) || key.trim().toLowerCase().startsWith(wage_service_1.PRICING_SETTING_PREFIX)) {
|
||||
throw new common_12.ForbiddenException("\u0627\u06CC\u0646 \u062A\u0646\u0638\u06CC\u0645 \u0641\u0642\u0637 \u0627\u0632 \u0645\u0633\u06CC\u0631 \u0627\u062E\u062A\u0635\u0627\u0635\u06CC \u062E\u0648\u062F \u0642\u0627\u0628\u0644 \u062F\u0633\u062A\u0631\u0633\u06CC \u0627\u0633\u062A");
|
||||
@@ -103021,14 +103035,14 @@ var require_admin_misc_controller = __commonJS({
|
||||
], AdminMiscController.prototype, "removeBrand", null);
|
||||
__decorate4([
|
||||
(0, common_12.Get)("const/slider"),
|
||||
(0, guards_1.RequirePermission)("custom.config.statics.slider"),
|
||||
(0, guards_1.RequirePermission)("config.statics"),
|
||||
__metadata3("design:type", Function),
|
||||
__metadata3("design:paramtypes", []),
|
||||
__metadata3("design:returntype", void 0)
|
||||
], AdminMiscController.prototype, "getSlider", null);
|
||||
__decorate4([
|
||||
(0, common_12.Put)("const/slider"),
|
||||
(0, guards_1.RequirePermission)("custom.config.statics.slider"),
|
||||
(0, guards_1.RequirePermission)("config.statics"),
|
||||
__param3(0, (0, common_12.Body)()),
|
||||
__metadata3("design:type", Function),
|
||||
__metadata3("design:paramtypes", [Object]),
|
||||
@@ -103036,7 +103050,7 @@ var require_admin_misc_controller = __commonJS({
|
||||
], AdminMiscController.prototype, "setSlider", null);
|
||||
__decorate4([
|
||||
(0, common_12.Delete)("const/slider"),
|
||||
(0, guards_1.RequirePermission)("custom.config.statics.slider"),
|
||||
(0, guards_1.RequirePermission)("config.statics"),
|
||||
__metadata3("design:type", Function),
|
||||
__metadata3("design:paramtypes", []),
|
||||
__metadata3("design:returntype", void 0)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
class PrismaClient {
|
||||
constructor() {
|
||||
throw new Error(
|
||||
'@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export { PrismaClient }
|
||||
+2
-2
@@ -800,7 +800,7 @@ const config = {
|
||||
"value": "prisma-client-js"
|
||||
},
|
||||
"output": {
|
||||
"value": "E:\\gold-bank\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client",
|
||||
"value": "E:\\tehran_taj\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client",
|
||||
"fromEnvVar": null
|
||||
},
|
||||
"config": {
|
||||
@@ -818,7 +818,7 @@ const config = {
|
||||
}
|
||||
],
|
||||
"previewFeatures": [],
|
||||
"sourceFilePath": "E:\\gold-bank\\apps\\api\\prisma\\schema.prisma"
|
||||
"sourceFilePath": "E:\\tehran_taj\\apps\\api\\prisma\\schema.prisma"
|
||||
},
|
||||
"relativeEnvPaths": {
|
||||
"rootEnvPath": null,
|
||||
|
||||
+2
-2
@@ -801,7 +801,7 @@ const config = {
|
||||
"value": "prisma-client-js"
|
||||
},
|
||||
"output": {
|
||||
"value": "E:\\gold-bank\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client",
|
||||
"value": "E:\\tehran_taj\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client",
|
||||
"fromEnvVar": null
|
||||
},
|
||||
"config": {
|
||||
@@ -819,7 +819,7 @@ const config = {
|
||||
}
|
||||
],
|
||||
"previewFeatures": [],
|
||||
"sourceFilePath": "E:\\gold-bank\\apps\\api\\prisma\\schema.prisma"
|
||||
"sourceFilePath": "E:\\tehran_taj\\apps\\api\\prisma\\schema.prisma"
|
||||
},
|
||||
"relativeEnvPaths": {
|
||||
"rootEnvPath": null,
|
||||
|
||||
Reference in New Issue
Block a user