@open-mercato/core 0.6.7-develop.6593.1.0ecf630f1e → 0.6.7-develop.6595.1.e93ecd3cfa
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.
- package/.turbo/turbo-build.log +1 -1
- package/dist/generated/entities/custom_entity/index.js +2 -0
- package/dist/generated/entities/custom_entity/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +1 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/auth/api/features.js +14 -0
- package/dist/modules/auth/api/features.js.map +2 -2
- package/dist/modules/entities/api/entities.js +20 -0
- package/dist/modules/entities/api/entities.js.map +2 -2
- package/dist/modules/entities/api/entity-settings.js +89 -0
- package/dist/modules/entities/api/entity-settings.js.map +7 -0
- package/dist/modules/entities/api/records.js +46 -25
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/page.js +13 -4
- package/dist/modules/entities/backend/entities/user/[entityId]/page.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/create/page.js +27 -2
- package/dist/modules/entities/backend/entities/user/create/page.js.map +2 -2
- package/dist/modules/entities/data/entities.js +4 -0
- package/dist/modules/entities/data/entities.js.map +2 -2
- package/dist/modules/entities/lib/entityAcl.js +17 -4
- package/dist/modules/entities/lib/entityAcl.js.map +3 -3
- package/dist/modules/entities/lib/install-from-ce.js +2 -0
- package/dist/modules/entities/lib/install-from-ce.js.map +2 -2
- package/dist/modules/entities/lib/recordFeatures.js +24 -0
- package/dist/modules/entities/lib/recordFeatures.js.map +7 -0
- package/dist/modules/entities/lib/register.js +3 -0
- package/dist/modules/entities/lib/register.js.map +2 -2
- package/dist/modules/entities/lib/restrictedEntityFeatures.js +62 -0
- package/dist/modules/entities/lib/restrictedEntityFeatures.js.map +7 -0
- package/dist/modules/entities/migrations/Migration20260716120000.js +13 -0
- package/dist/modules/entities/migrations/Migration20260716120000.js.map +7 -0
- package/generated/entities/custom_entity/index.ts +1 -0
- package/generated/entity-fields-registry.ts +1 -0
- package/package.json +7 -7
- package/src/modules/auth/api/features.ts +17 -0
- package/src/modules/customers/i18n/pl.json +484 -484
- package/src/modules/entities/api/entities.ts +28 -0
- package/src/modules/entities/api/entity-settings.ts +103 -0
- package/src/modules/entities/api/records.ts +70 -29
- package/src/modules/entities/backend/entities/user/[entityId]/page.tsx +12 -3
- package/src/modules/entities/backend/entities/user/create/page.tsx +33 -1
- package/src/modules/entities/data/entities.ts +6 -0
- package/src/modules/entities/i18n/de.json +3 -0
- package/src/modules/entities/i18n/en.json +3 -0
- package/src/modules/entities/i18n/es.json +3 -0
- package/src/modules/entities/i18n/pl.json +3 -0
- package/src/modules/entities/lib/entityAcl.ts +27 -5
- package/src/modules/entities/lib/install-from-ce.ts +2 -0
- package/src/modules/entities/lib/recordFeatures.ts +48 -0
- package/src/modules/entities/lib/register.ts +4 -0
- package/src/modules/entities/lib/restrictedEntityFeatures.ts +98 -0
- package/src/modules/entities/migrations/.snapshot-open-mercato.json +10 -0
- package/src/modules/entities/migrations/Migration20260716120000.ts +13 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/entities/migrations/Migration20260716120000.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260716120000 extends Migration {\n\n override async up(): Promise<void> {\n this.addSql(`alter table \"custom_entities\" add column \"access_restricted\" boolean not null default false;`);\n }\n\n override async down(): Promise<void> {\n this.addSql(`alter table \"custom_entities\" drop column \"access_restricted\";`);\n }\n\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,gCAAgC,UAAU;AAAA,EAErD,MAAe,KAAoB;AACjC,SAAK,OAAO,8FAA8F;AAAA,EAC5G;AAAA,EAEA,MAAe,OAAsB;AACnC,SAAK,OAAO,gEAAgE;AAAA,EAC9E;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -5,6 +5,7 @@ export const description = "description";
|
|
|
5
5
|
export const label_field = "label_field";
|
|
6
6
|
export const default_editor = "default_editor";
|
|
7
7
|
export const show_in_sidebar = "show_in_sidebar";
|
|
8
|
+
export const access_restricted = "access_restricted";
|
|
8
9
|
export const organization_id = "organization_id";
|
|
9
10
|
export const tenant_id = "tenant_id";
|
|
10
11
|
export const is_active = "is_active";
|
|
@@ -503,6 +503,7 @@ export const entityFieldsRegistry: Record<string, Record<string, string>> = {
|
|
|
503
503
|
"label_field": "label_field",
|
|
504
504
|
"default_editor": "default_editor",
|
|
505
505
|
"show_in_sidebar": "show_in_sidebar",
|
|
506
|
+
"access_restricted": "access_restricted",
|
|
506
507
|
"organization_id": "organization_id",
|
|
507
508
|
"tenant_id": "tenant_id",
|
|
508
509
|
"is_active": "is_active",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.6.7-develop.
|
|
3
|
+
"version": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -254,16 +254,16 @@
|
|
|
254
254
|
"zod": "^4.4.3"
|
|
255
255
|
},
|
|
256
256
|
"peerDependencies": {
|
|
257
|
-
"@open-mercato/ai-assistant": "0.6.7-develop.
|
|
258
|
-
"@open-mercato/shared": "0.6.7-develop.
|
|
259
|
-
"@open-mercato/ui": "0.6.7-develop.
|
|
257
|
+
"@open-mercato/ai-assistant": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
258
|
+
"@open-mercato/shared": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
259
|
+
"@open-mercato/ui": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
260
260
|
"react": "^19.0.0",
|
|
261
261
|
"react-dom": "^19.0.0"
|
|
262
262
|
},
|
|
263
263
|
"devDependencies": {
|
|
264
|
-
"@open-mercato/ai-assistant": "0.6.7-develop.
|
|
265
|
-
"@open-mercato/shared": "0.6.7-develop.
|
|
266
|
-
"@open-mercato/ui": "0.6.7-develop.
|
|
264
|
+
"@open-mercato/ai-assistant": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
265
|
+
"@open-mercato/shared": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
266
|
+
"@open-mercato/ui": "0.6.7-develop.6595.1.e93ecd3cfa",
|
|
267
267
|
"@testing-library/dom": "^10.4.1",
|
|
268
268
|
"@testing-library/jest-dom": "^6.9.1",
|
|
269
269
|
"@testing-library/react": "^16.3.1",
|
|
@@ -3,6 +3,8 @@ import { z } from 'zod'
|
|
|
3
3
|
import type { OpenApiMethodDoc, OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'
|
|
4
4
|
import { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'
|
|
5
5
|
import { getModules } from '@open-mercato/shared/lib/i18n/server'
|
|
6
|
+
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
7
|
+
import { synthesizeRestrictedEntityFeatures } from '@open-mercato/core/modules/entities/lib/restrictedEntityFeatures'
|
|
6
8
|
|
|
7
9
|
export const metadata = {
|
|
8
10
|
GET: { requireAuth: true, requireFeatures: ['auth.acl.manage'] },
|
|
@@ -44,6 +46,21 @@ export async function GET(req: Request) {
|
|
|
44
46
|
return base
|
|
45
47
|
})
|
|
46
48
|
)
|
|
49
|
+
// Append synthesized per-entity features for the tenant's restricted custom
|
|
50
|
+
// entities so they can be granted in the ACL editor. Tenant-scoped; never
|
|
51
|
+
// throws (falls back to the static catalog on any failure).
|
|
52
|
+
try {
|
|
53
|
+
const { resolve } = await createRequestContainer()
|
|
54
|
+
const em = resolve('em') as any
|
|
55
|
+
const synthesized = await synthesizeRestrictedEntityFeatures(em, auth.tenantId ?? null)
|
|
56
|
+
for (const item of synthesized) {
|
|
57
|
+
const deps = normalizeDependsOn(item.dependsOn)
|
|
58
|
+
const base: FeatureItem = { id: item.id, title: item.title, module: item.module }
|
|
59
|
+
if (deps) base.dependsOn = deps
|
|
60
|
+
items.push(base)
|
|
61
|
+
}
|
|
62
|
+
} catch {}
|
|
63
|
+
|
|
47
64
|
// Deduplicate by id (keep first occurrence)
|
|
48
65
|
const byId = new Map<string, FeatureItem>()
|
|
49
66
|
for (const it of items) if (!byId.has(it.id)) byId.set(it.id, it)
|