@open-mercato/shared 0.6.5-develop.5337.1.534b781eac → 0.6.5
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 +1 -1
- package/dist/lib/ai/llm-provider-registry.js.map +1 -1
- package/dist/lib/crud/custom-fields.js +23 -15
- package/dist/lib/crud/custom-fields.js.map +2 -2
- package/dist/lib/crud/factory.js.map +1 -1
- package/dist/lib/crud/optimistic-lock-command.js.map +1 -1
- package/dist/lib/crud/optimistic-lock-headers.js.map +1 -1
- package/dist/lib/crud/optimistic-lock-store.js.map +1 -1
- package/dist/lib/crud/optimistic-lock.js.map +1 -1
- package/dist/lib/data/engine.js +25 -1
- package/dist/lib/data/engine.js.map +2 -2
- package/dist/lib/db/buildIlikeTerm.js +17 -0
- package/dist/lib/db/buildIlikeTerm.js.map +7 -0
- package/dist/lib/db/mikro.js +38 -9
- package/dist/lib/db/mikro.js.map +2 -2
- package/dist/lib/di/container.js +1 -1
- package/dist/lib/di/container.js.map +1 -1
- package/dist/lib/encryption/kms.js +41 -6
- package/dist/lib/encryption/kms.js.map +2 -2
- package/dist/lib/query/advanced-filter-tree.js +5 -5
- package/dist/lib/query/advanced-filter-tree.js.map +2 -2
- package/dist/lib/query/advanced-filter.js +5 -5
- package/dist/lib/query/advanced-filter.js.map +2 -2
- package/dist/lib/query/engine.js +3 -1
- package/dist/lib/query/engine.js.map +2 -2
- package/dist/lib/query/types.js.map +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/lib/version.js.map +1 -1
- package/dist/modules/overrides.js +1 -1
- package/dist/modules/overrides.js.map +1 -1
- package/dist/modules/search.js.map +1 -1
- package/package.json +4 -5
- package/src/lib/ai/llm-provider-registry.ts +1 -1
- package/src/lib/ai/llm-provider.ts +1 -1
- package/src/lib/crud/__tests__/custom-fields.test.ts +91 -0
- package/src/lib/crud/custom-fields.ts +30 -17
- package/src/lib/crud/factory.ts +1 -1
- package/src/lib/crud/optimistic-lock-command.ts +1 -1
- package/src/lib/crud/optimistic-lock-headers.ts +1 -1
- package/src/lib/crud/optimistic-lock-store.ts +1 -1
- package/src/lib/crud/optimistic-lock.ts +1 -1
- package/src/lib/data/__tests__/engine.custom-entity-storage-guard.test.ts +78 -0
- package/src/lib/data/engine.ts +40 -0
- package/src/lib/db/__tests__/buildIlikeTerm.test.ts +40 -0
- package/src/lib/db/__tests__/escapeLikePattern.test.ts +123 -0
- package/src/lib/db/__tests__/mikro.test.ts +82 -0
- package/src/lib/db/buildIlikeTerm.ts +16 -0
- package/src/lib/db/mikro.ts +55 -16
- package/src/lib/di/container.ts +1 -1
- package/src/lib/encryption/__tests__/kms.test.ts +80 -0
- package/src/lib/encryption/kms.ts +55 -7
- package/src/lib/query/__tests__/engine.count-distinct.test.ts +229 -0
- package/src/lib/query/advanced-filter-tree.ts +5 -5
- package/src/lib/query/advanced-filter.ts +5 -5
- package/src/lib/query/engine.ts +13 -2
- package/src/lib/query/types.ts +10 -0
- package/src/modules/__tests__/overrides.test.ts +1 -1
- package/src/modules/__tests__/route-overrides.test.ts +1 -1
- package/src/modules/navigation/backendChrome.ts +9 -0
- package/src/modules/overrides.ts +3 -3
- package/src/modules/search.ts +1 -1
package/src/lib/query/types.ts
CHANGED
|
@@ -125,6 +125,16 @@ export type QueryOptions = {
|
|
|
125
125
|
// Used by the search indexing pipeline to prevent feedback loops where indexing triggers
|
|
126
126
|
// re-indexing indefinitely.
|
|
127
127
|
skipAutoReindex?: boolean
|
|
128
|
+
/**
|
|
129
|
+
* Force routing this query to custom-entity doc storage (`custom_entities_storage`)
|
|
130
|
+
* instead of classifying the entity automatically. Automatic classification routes
|
|
131
|
+
* ids backed by a registered ORM table to that base table, so surfaces that manage
|
|
132
|
+
* doc records for ids that are ALSO table-backed (e.g. the entities records browser
|
|
133
|
+
* reading a module-declared custom entity such as `example:todo`) must set this flag.
|
|
134
|
+
* Honored by the hybrid query engine only; `BasicQueryEngine` has no doc-storage
|
|
135
|
+
* reader and ignores it.
|
|
136
|
+
*/
|
|
137
|
+
forceCustomEntityStorage?: boolean
|
|
128
138
|
// Optional UMES query extensions context. When provided, the engine will
|
|
129
139
|
// emit sync lifecycle events and apply query-level enrichers.
|
|
130
140
|
extensions?: QueryExtensionsConfig
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* by shared's default appliers; custom/future domains still warn if no
|
|
7
7
|
* applier is registered.
|
|
8
8
|
*
|
|
9
|
-
* Spec: `.ai/specs/2026-05-04-modules-ts-unified-overrides.md`.
|
|
9
|
+
* Spec: `.ai/specs/implemented/2026-05-04-modules-ts-unified-overrides.md`.
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
applyModuleOverridesFromEnabledModules,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - `registerApiRouteManifests` consults the override composer.
|
|
13
13
|
* - Stale override keys emit a warning so operators notice.
|
|
14
14
|
*
|
|
15
|
-
* Spec: `.ai/specs/2026-05-04-modules-ts-unified-overrides.md`.
|
|
15
|
+
* Spec: `.ai/specs/implemented/2026-05-04-modules-ts-unified-overrides.md`.
|
|
16
16
|
*/
|
|
17
17
|
import {
|
|
18
18
|
applyApiOverridesToManifests,
|
|
@@ -39,6 +39,14 @@ export type BackendChromeSectionGroup = {
|
|
|
39
39
|
order?: number
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export type BackendChromeBrand = {
|
|
43
|
+
name?: string
|
|
44
|
+
logo?: {
|
|
45
|
+
src: string
|
|
46
|
+
alt?: string
|
|
47
|
+
} | null
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
export type BackendChromePayload = {
|
|
43
51
|
groups: BackendChromeNavGroup[]
|
|
44
52
|
settingsSections: BackendChromeSectionGroup[]
|
|
@@ -47,4 +55,5 @@ export type BackendChromePayload = {
|
|
|
47
55
|
profilePathPrefixes: string[]
|
|
48
56
|
grantedFeatures: string[]
|
|
49
57
|
roles: string[]
|
|
58
|
+
brand?: BackendChromeBrand | null
|
|
50
59
|
}
|
package/src/modules/overrides.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Unified `modules.ts` override surface — one place for downstream apps to
|
|
3
3
|
* replace or disable any contract a module presents.
|
|
4
4
|
*
|
|
5
|
-
* Spec: `.ai/specs/2026-05-04-modules-ts-unified-overrides.md`
|
|
5
|
+
* Spec: `.ai/specs/implemented/2026-05-04-modules-ts-unified-overrides.md`
|
|
6
6
|
*
|
|
7
7
|
* Each `ModuleEntry` in `apps/<app>/src/modules.ts` may carry an
|
|
8
8
|
* `overrides` field whose sub-keys address one domain at a time:
|
|
@@ -229,7 +229,7 @@ const DOMAIN_KEYS: ModuleOverrideDomain[] = [
|
|
|
229
229
|
]
|
|
230
230
|
|
|
231
231
|
const TRACKING_ISSUE_HINT =
|
|
232
|
-
'See `.ai/specs/2026-05-04-modules-ts-unified-overrides.md` and tracking issue https://github.com/open-mercato/open-mercato/issues/1787.'
|
|
232
|
+
'See `.ai/specs/implemented/2026-05-04-modules-ts-unified-overrides.md` and tracking issue https://github.com/open-mercato/open-mercato/issues/1787.'
|
|
233
233
|
|
|
234
234
|
/**
|
|
235
235
|
* Walk every `ModuleEntry` and dispatch its `overrides.<domain>` shape
|
|
@@ -312,7 +312,7 @@ export function applyModuleOverridesFromEnabledModules(
|
|
|
312
312
|
// runtime override scenarios call the dispatcher / programmatic API
|
|
313
313
|
// before `bootstrap.ts` triggers manifest registration.
|
|
314
314
|
//
|
|
315
|
-
// Spec: `.ai/specs/2026-05-04-modules-ts-unified-overrides.md` (Phases 2/3).
|
|
315
|
+
// Spec: `.ai/specs/implemented/2026-05-04-modules-ts-unified-overrides.md` (Phases 2/3).
|
|
316
316
|
|
|
317
317
|
// ApiRouteManifestEntry / ApiHandler / HttpMethod live in ./registry. The
|
|
318
318
|
// type-only import is erased at runtime, so there is no cycle even though
|
package/src/modules/search.ts
CHANGED
|
@@ -160,7 +160,7 @@ export interface SearchStrategy {
|
|
|
160
160
|
bulkIndex?(records: IndexableRecord[]): Promise<void>
|
|
161
161
|
|
|
162
162
|
/** Purge all records for an entity type (optional) */
|
|
163
|
-
purge?(entityId: EntityId, tenantId: string): Promise<void>
|
|
163
|
+
purge?(entityId: EntityId, tenantId: string, organizationId?: string | null): Promise<void>
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// =============================================================================
|