@open-mercato/core 0.6.6-develop.6296.1.5e8bdfee17 → 0.6.6-develop.6299.1.29224e2d86
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/AGENTS.md +8 -0
- package/dist/generated/entities/module_config/index.js +4 -0
- package/dist/generated/entities/module_config/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +2 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +1 -1
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/configs/data/entities.js +15 -1
- package/dist/modules/configs/data/entities.js.map +2 -2
- package/dist/modules/configs/lib/module-config-service.js +52 -19
- package/dist/modules/configs/lib/module-config-service.js.map +3 -3
- package/dist/modules/configs/migrations/Migration20260617150000.js +21 -0
- package/dist/modules/configs/migrations/Migration20260617150000.js.map +7 -0
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/generated/entities/module_config/index.ts +2 -0
- package/generated/entity-fields-registry.ts +2 -0
- package/package.json +7 -7
- package/src/modules/auth/lib/setup-app.ts +1 -1
- package/src/modules/configs/data/entities.ts +17 -1
- package/src/modules/configs/lib/module-config-service.ts +83 -24
- package/src/modules/configs/migrations/.snapshot-open-mercato.json +41 -4
- package/src/modules/configs/migrations/.snapshot-openmercato.json +41 -4
- package/src/modules/configs/migrations/Migration20260617150000.ts +21 -0
- package/src/modules/customers/api/activities/route.ts +6 -0
|
@@ -43,6 +43,24 @@
|
|
|
43
43
|
"nullable": true,
|
|
44
44
|
"mappedType": "json"
|
|
45
45
|
},
|
|
46
|
+
"organization_id": {
|
|
47
|
+
"name": "organization_id",
|
|
48
|
+
"type": "uuid",
|
|
49
|
+
"unsigned": false,
|
|
50
|
+
"autoincrement": false,
|
|
51
|
+
"primary": false,
|
|
52
|
+
"nullable": true,
|
|
53
|
+
"mappedType": "uuid"
|
|
54
|
+
},
|
|
55
|
+
"tenant_id": {
|
|
56
|
+
"name": "tenant_id",
|
|
57
|
+
"type": "uuid",
|
|
58
|
+
"unsigned": false,
|
|
59
|
+
"autoincrement": false,
|
|
60
|
+
"primary": false,
|
|
61
|
+
"nullable": true,
|
|
62
|
+
"mappedType": "uuid"
|
|
63
|
+
},
|
|
46
64
|
"created_at": {
|
|
47
65
|
"name": "created_at",
|
|
48
66
|
"type": "timestamptz",
|
|
@@ -68,15 +86,34 @@
|
|
|
68
86
|
"schema": "public",
|
|
69
87
|
"indexes": [
|
|
70
88
|
{
|
|
71
|
-
"keyName": "
|
|
89
|
+
"keyName": "module_configs_global_unique",
|
|
90
|
+
"columnNames": [],
|
|
91
|
+
"composite": false,
|
|
92
|
+
"constraint": false,
|
|
93
|
+
"primary": false,
|
|
94
|
+
"unique": false,
|
|
95
|
+
"expression": "create unique index \"module_configs_global_unique\" on \"module_configs\" (\"module_id\", \"name\") where \"tenant_id\" is null"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"keyName": "module_configs_scoped_unique",
|
|
99
|
+
"columnNames": [],
|
|
100
|
+
"composite": false,
|
|
101
|
+
"constraint": false,
|
|
102
|
+
"primary": false,
|
|
103
|
+
"unique": false,
|
|
104
|
+
"expression": "create unique index \"module_configs_scoped_unique\" on \"module_configs\" (\"module_id\", \"name\", \"tenant_id\") where \"tenant_id\" is not null"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"keyName": "module_configs_module_name_tenant_idx",
|
|
72
108
|
"columnNames": [
|
|
73
109
|
"module_id",
|
|
74
|
-
"name"
|
|
110
|
+
"name",
|
|
111
|
+
"tenant_id"
|
|
75
112
|
],
|
|
76
113
|
"composite": true,
|
|
77
|
-
"constraint":
|
|
114
|
+
"constraint": false,
|
|
78
115
|
"primary": false,
|
|
79
|
-
"unique":
|
|
116
|
+
"unique": false
|
|
80
117
|
},
|
|
81
118
|
{
|
|
82
119
|
"keyName": "module_configs_pkey",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Migration } from '@mikro-orm/migrations';
|
|
2
|
+
|
|
3
|
+
export class Migration20260617150000 extends Migration {
|
|
4
|
+
|
|
5
|
+
override async up(): Promise<void> {
|
|
6
|
+
this.addSql(`alter table "module_configs" add column "organization_id" uuid null, add column "tenant_id" uuid null;`);
|
|
7
|
+
this.addSql(`alter table "module_configs" drop constraint "module_configs_module_name_unique";`);
|
|
8
|
+
this.addSql(`create unique index "module_configs_global_unique" on "module_configs" ("module_id", "name") where "tenant_id" is null;`);
|
|
9
|
+
this.addSql(`create unique index "module_configs_scoped_unique" on "module_configs" ("module_id", "name", "tenant_id") where "tenant_id" is not null;`);
|
|
10
|
+
this.addSql(`create index "module_configs_module_name_tenant_idx" on "module_configs" ("module_id", "name", "tenant_id");`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override async down(): Promise<void> {
|
|
14
|
+
this.addSql(`drop index if exists "module_configs_module_name_tenant_idx";`);
|
|
15
|
+
this.addSql(`drop index if exists "module_configs_scoped_unique";`);
|
|
16
|
+
this.addSql(`drop index if exists "module_configs_global_unique";`);
|
|
17
|
+
this.addSql(`alter table "module_configs" add constraint "module_configs_module_name_unique" unique ("module_id", "name");`);
|
|
18
|
+
this.addSql(`alter table "module_configs" drop column "organization_id", drop column "tenant_id";`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -74,6 +74,12 @@ const ADAPTER_HEADERS = {
|
|
|
74
74
|
// canonical bridge) read path. Keeps memory bounded on tenants with large
|
|
75
75
|
// activity history; deep-pagination beyond this window is not supported here —
|
|
76
76
|
// use /api/customers/interactions instead.
|
|
77
|
+
//
|
|
78
|
+
// Audited for the #3386 rollout (P2): this merged path sorts only on
|
|
79
|
+
// non-encrypted system timestamps (createdAt/occurredAt, see
|
|
80
|
+
// resolveActivitySortValue), so the #3278 two-phase *encrypted*-sort migration
|
|
81
|
+
// is intentionally not applied here. Merge-order correctness across the page
|
|
82
|
+
// boundary is covered by __tests__/merged-pagination.test.ts.
|
|
77
83
|
const MERGED_ACTIVITY_FETCH_CAP = 2000
|
|
78
84
|
|
|
79
85
|
type ActivityItem = {
|