@resolveio/server-lib 22.3.85 → 22.3.86
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
|
@@ -725,6 +725,16 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
725
725
|
' try { return JSON.parse(fs.readFileSync(filePath, "utf8")); } catch (error) { return null; }',
|
|
726
726
|
'}',
|
|
727
727
|
'',
|
|
728
|
+
'function preserveExistingSeedResult(reason) {',
|
|
729
|
+
' const existing = readJsonIfExists(resultPath);',
|
|
730
|
+
' const status = String(existing && existing.status || "").toLowerCase();',
|
|
731
|
+
' if (["pass", "needs-data"].includes(status)) {',
|
|
732
|
+
' const preserved = { ...existing, reused_existing: true, reuse_reason: reason, checked_at: new Date().toISOString() };',
|
|
733
|
+
' console.log(JSON.stringify(preserved, null, 2));',
|
|
734
|
+
' process.exit(0);',
|
|
735
|
+
' }',
|
|
736
|
+
'}',
|
|
737
|
+
'',
|
|
728
738
|
'function resolveRuntimeSource() {',
|
|
729
739
|
' const envUri = process.env.RESOLVEIO_QA_LIVE_MONGO_URL || process.env.RESOLVEIO_SUPPORT_QA_LIVE_MONGO_URL || process.env.RESOLVEIO_RUNNER_QA_LIVE_MONGO_URL || "";',
|
|
730
740
|
' const envDb = process.env.RESOLVEIO_QA_LIVE_MONGO_DB || process.env.RESOLVEIO_SUPPORT_QA_LIVE_MONGO_DB || process.env.RESOLVEIO_RUNNER_QA_LIVE_MONGO_DB || "";',
|
|
@@ -1004,7 +1014,10 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1004
1014
|
' const { MongoClient } = requireMongo();',
|
|
1005
1015
|
' const source = resolveRuntimeSource();',
|
|
1006
1016
|
' const targetUri = process.env.RESOLVEIO_SUPPORT_QA_MONGO_URL || process.env.RESOLVEIO_RUNNER_QA_MONGO_URL || process.env.MONGO_URL || "mongodb://127.0.0.1:3001/resolveio?directConnection=true";',
|
|
1007
|
-
' if (!source.uri)
|
|
1017
|
+
' if (!source.uri) {',
|
|
1018
|
+
' preserveExistingSeedResult("missing_live_mongo_uri");',
|
|
1019
|
+
' writeResult({ status: isLiveDataRequired() ? "failed" : "skipped", reason: "missing_live_mongo_uri", required: isLiveDataRequired(), result_path: resultPath }, isLiveDataRequired() ? 5 : 0);',
|
|
1020
|
+
' }',
|
|
1008
1021
|
' if (!isLocalMongoUri(targetUri)) writeResult({ status: "failed", reason: "target_mongo_must_be_localhost", target_uri_redacted: redactUri(targetUri), result_path: resultPath }, 3);',
|
|
1009
1022
|
' if (String(source.uri) === String(targetUri)) writeResult({ status: "failed", reason: "source_and_target_mongo_match", result_path: resultPath }, 3);',
|
|
1010
1023
|
' const sourceClient = new MongoClient(source.uri, { readPreference: "secondaryPreferred", serverSelectionTimeoutMS: 15000 });',
|