@open-mercato/core 0.10.1-develop.7826.1.5e82b7c668 → 0.10.1-develop.7833.1.d6cbf0e3ab
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/helpers/integration/appRuntime.js +17 -0
- package/dist/helpers/integration/appRuntime.js.map +7 -0
- package/dist/modules/query_index/lib/engine.js +14 -3
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/warranty_claims/search.js +7 -6
- package/dist/modules/warranty_claims/search.js.map +2 -2
- package/package.json +7 -7
- package/src/helpers/integration/appRuntime.ts +26 -0
- package/src/modules/query_index/lib/engine.ts +13 -2
- package/src/modules/warranty_claims/i18n/de.json +1 -0
- package/src/modules/warranty_claims/i18n/en.json +1 -0
- package/src/modules/warranty_claims/i18n/es.json +1 -0
- package/src/modules/warranty_claims/i18n/ko.json +1 -0
- package/src/modules/warranty_claims/i18n/pl.json +1 -0
- package/src/modules/warranty_claims/search.ts +8 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
async function importFromAppRuntime(specifier) {
|
|
5
|
+
const resolvedPath = resolveAppRuntimeModulePath(specifier);
|
|
6
|
+
return await (resolvedPath ? import(pathToFileURL(resolvedPath).href) : import(specifier));
|
|
7
|
+
}
|
|
8
|
+
function resolveAppRuntimeModulePath(specifier, appRoot = process.env.OM_TEST_APP_ROOT) {
|
|
9
|
+
const standaloneRoot = appRoot?.trim();
|
|
10
|
+
if (!standaloneRoot) return null;
|
|
11
|
+
return createRequire(path.join(path.resolve(standaloneRoot), "package.json")).resolve(specifier);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
importFromAppRuntime,
|
|
15
|
+
resolveAppRuntimeModulePath
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=appRuntime.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/integration/appRuntime.ts"],
|
|
4
|
+
"sourcesContent": ["import { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { pathToFileURL } from 'node:url'\n\n/**\n * Imports a package module from the same copy the app under test runs on.\n *\n * A spec that bootstraps the app in-process (`bootstrapFromAppRoot`) and then calls into its\n * runtime \u2014 the command bus, `withAtomicFlush`, transaction lifetime \u2014 must load every one of those\n * modules from a single copy. Against a standalone app (`OM_TEST_APP_ROOT`) the app's generated\n * registries import `node_modules/@open-mercato/*` inside the app, while the spec's own static\n * imports resolve to the monorepo's packages, so module-local state such as the command registry\n * splits in two: handlers register in one copy and the bus resolves them in the other.\n *\n * Without `OM_TEST_APP_ROOT` this is a plain dynamic import, so the monorepo lane is unchanged.\n */\nexport async function importFromAppRuntime<TModule>(specifier: string): Promise<TModule> {\n const resolvedPath = resolveAppRuntimeModulePath(specifier)\n return (await import(resolvedPath ? pathToFileURL(resolvedPath).href : specifier)) as TModule\n}\n\nexport function resolveAppRuntimeModulePath(specifier: string, appRoot = process.env.OM_TEST_APP_ROOT): string | null {\n const standaloneRoot = appRoot?.trim()\n if (!standaloneRoot) return null\n return createRequire(path.join(path.resolve(standaloneRoot), 'package.json')).resolve(specifier)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAc9B,eAAsB,qBAA8B,WAAqC;AACvF,QAAM,eAAe,4BAA4B,SAAS;AAC1D,SAAQ,OAAa,eAAP,OAAsB,cAAc,YAAY,EAAE,QAAlD,OAAyD;AACzE;AAEO,SAAS,4BAA4B,WAAmB,UAAU,QAAQ,IAAI,kBAAiC;AACpH,QAAM,iBAAiB,SAAS,KAAK;AACrC,MAAI,CAAC,eAAgB,QAAO;AAC5B,SAAO,cAAc,KAAK,KAAK,KAAK,QAAQ,cAAc,GAAG,cAAc,CAAC,EAAE,QAAQ,SAAS;AACjG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -341,12 +341,17 @@ class HybridQueryEngine {
|
|
|
341
341
|
const applyAfterExtensions = async (queryResult) => {
|
|
342
342
|
if (!ext || !hybridExtCtx) return queryResult;
|
|
343
343
|
const diCtx = ext.resolve ? { resolve: ext.resolve } : noopDi;
|
|
344
|
-
|
|
344
|
+
const ciphertextSearchWarnings = queryResult.meta?.ciphertextSearchWarnings;
|
|
345
|
+
const result = await runAfterQueryPipeline(
|
|
345
346
|
queryResult,
|
|
346
347
|
opts,
|
|
347
348
|
hybridExtCtx,
|
|
348
349
|
diCtx
|
|
349
350
|
);
|
|
351
|
+
if (ciphertextSearchWarnings?.length) {
|
|
352
|
+
result.meta = { ...result.meta, ciphertextSearchWarnings };
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
350
355
|
};
|
|
351
356
|
try {
|
|
352
357
|
const debugEnabled = this.isDebugVerbosity();
|
|
@@ -558,6 +563,7 @@ class HybridQueryEngine {
|
|
|
558
563
|
searchRuntime.encryptedFields = null;
|
|
559
564
|
}
|
|
560
565
|
}
|
|
566
|
+
const ciphertextSearchWarnings = [];
|
|
561
567
|
if (searchFilters.length) {
|
|
562
568
|
this.logSearchDebug("search:init", {
|
|
563
569
|
entity,
|
|
@@ -594,7 +600,8 @@ class HybridQueryEngine {
|
|
|
594
600
|
// `searchEnabled` also folds in the missing-table case, which is
|
|
595
601
|
// "no usable tokens" rather than "the operator switched search off".
|
|
596
602
|
reason: searchRuntime.enabled ? "no-indexable-tokens" : searchConfig.enabled ? "no-search-tokens" : "search-disabled",
|
|
597
|
-
service: this.getEncryptionService()
|
|
603
|
+
service: this.getEncryptionService(),
|
|
604
|
+
onDiagnostic: (warning) => ciphertextSearchWarnings.push(warning)
|
|
598
605
|
});
|
|
599
606
|
}
|
|
600
607
|
}
|
|
@@ -611,7 +618,8 @@ class HybridQueryEngine {
|
|
|
611
618
|
fields: fallbackFields,
|
|
612
619
|
tenantId: opts.tenantId ?? null,
|
|
613
620
|
reason: hasJoinedTokens ? "no-indexable-tokens" : searchConfig.enabled ? "no-search-tokens" : "search-disabled",
|
|
614
|
-
service: this.getEncryptionService()
|
|
621
|
+
service: this.getEncryptionService(),
|
|
622
|
+
onDiagnostic: (warning) => ciphertextSearchWarnings.push(warning)
|
|
615
623
|
});
|
|
616
624
|
}
|
|
617
625
|
const hasNonBaseSearchSource = searchSources.some(
|
|
@@ -1292,6 +1300,9 @@ class HybridQueryEngine {
|
|
|
1292
1300
|
result.meta = meta;
|
|
1293
1301
|
}
|
|
1294
1302
|
result = await applyAfterExtensions(result);
|
|
1303
|
+
if (ciphertextSearchWarnings.length) {
|
|
1304
|
+
result.meta = { ...result.meta, ciphertextSearchWarnings };
|
|
1305
|
+
}
|
|
1295
1306
|
finishProfile({
|
|
1296
1307
|
result: "ok",
|
|
1297
1308
|
total,
|