@resolveio/server-lib 22.3.104 → 22.3.106

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "22.3.104",
3
+ "version": "22.3.106",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "package": "./build_package.sh",
@@ -2109,6 +2109,20 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
2109
2109
  'function delay(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }',
2110
2110
  'function writeJson(filePath, payload) { fs.mkdirSync(path.dirname(filePath), { recursive: true }); fs.writeFileSync(filePath, JSON.stringify(payload, null, 2)); }',
2111
2111
  'function readJson(filePath) { try { return JSON.parse(fs.readFileSync(filePath, "utf8")); } catch (error) { return null; } }',
2112
+ 'function readSeedHintText() {',
2113
+ ' const repoRoot = path.dirname(projectRoot);',
2114
+ ' const chunks = [process.env.RESOLVEIO_QA_SEED_HINTS || "", process.env.RESOLVEIO_SUPPORT_QA_SEED_HINTS || "", process.env.RESOLVEIO_RUNNER_QA_SEED_HINTS || ""];',
2115
+ ' const candidates = [',
2116
+ ' path.join(repoRoot, ".resolveio-support-context", "manual-ticket.request.txt"),',
2117
+ ' path.join(projectRoot, ".resolveio-support-context", "manual-ticket.request.txt"),',
2118
+ ' path.join(repoRoot, ".resolveio-context", "manual-ticket.request.txt"),',
2119
+ ' path.join(projectRoot, ".resolveio-context", "manual-ticket.request.txt")',
2120
+ ' ];',
2121
+ ' for (const candidate of candidates) {',
2122
+ ' try { chunks.push(fs.readFileSync(candidate, "utf8")); } catch (error) {}',
2123
+ ' }',
2124
+ ' return chunks.filter(Boolean).join("\\n");',
2125
+ '}',
2112
2126
  'function normalizeRoute(candidate) {',
2113
2127
  ' const value = String(candidate || "").trim();',
2114
2128
  ' if (!value) return "";',
@@ -2118,8 +2132,8 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
2118
2132
  ' return value.startsWith("/") ? value : `/${value}`;',
2119
2133
  '}',
2120
2134
  'function resolveTargetRoute(explicitRoute) {',
2121
- ' const explicit = normalizeRoute(explicitRoute);',
2122
- ' if (explicit) return explicit;',
2135
+ ' const hintText = readSeedHintText();',
2136
+ ' const preferInterchangeables = /\\b(interchangeable|interchangeables|mass\\s+update|update\\s+interchangeables|from\\s+chemical|to\\s+chemical|treatment\\s+plan|treatment\\s+plans|production\\s+location)\\b/i.test(hintText);',
2123
2137
  ' const seedCandidates = [',
2124
2138
  ' path.join(artifactDir, "qa-live-data-seed-result.json"),',
2125
2139
  ' path.join(artifactDir, "candidate", "qa-live-data-seed-result.json")',
@@ -2128,11 +2142,14 @@ function buildResolveIORunnerQaWorkflowProbeScript() {
2128
2142
  ' const seed = readJson(seedPath);',
2129
2143
  ' const interchangeablesRoutes = (seed && seed.selected && seed.selected.qa_production_interchangeables_context && seed.selected.qa_production_interchangeables_context.browser_routes) || (seed && seed.qa_production_interchangeables_context && seed.qa_production_interchangeables_context.browser_routes);',
2130
2144
  ' const interchangeablesRoute = normalizeRoute(interchangeablesRoutes && (interchangeablesRoutes.update_interchangeables || interchangeablesRoutes.detail || interchangeablesRoutes.list));',
2131
- ' if (interchangeablesRoute) return interchangeablesRoute;',
2145
+ ' if (preferInterchangeables && interchangeablesRoute) return interchangeablesRoute;',
2132
2146
  ' const routes = seed && seed.selected && seed.selected.truck_treating_bol_context && seed.selected.truck_treating_bol_context.browser_routes;',
2133
2147
  ' const route = normalizeRoute(routes && (routes.delivery || routes.detail || routes.list));',
2134
- ' if (route) return route;',
2148
+ ' if (!preferInterchangeables && route) return route;',
2135
2149
  ' }',
2150
+ ' if (preferInterchangeables) return "/production-location/update-interchangeables";',
2151
+ ' const explicit = normalizeRoute(explicitRoute);',
2152
+ ' if (explicit) return explicit;',
2136
2153
  ' return "/";',
2137
2154
  '}',
2138
2155
  'function requestReady(url) {',