node-consul-service 1.0.38 → 1.0.39
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/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19458,8 +19458,8 @@ async function dataLink(data, schema) {
|
|
|
19458
19458
|
const result = sourceData.map((item) => ({ ...item }));
|
|
19459
19459
|
await Promise.all(schema.map(async ({ filed, service, path, headers, cacheGetter }) => {
|
|
19460
19460
|
var _a;
|
|
19461
|
-
|
|
19462
|
-
|
|
19461
|
+
// ✅ Safety check + trim path
|
|
19462
|
+
if (!path || !path.trim().startsWith("/")) {
|
|
19463
19463
|
throw new DataLinkError(service, path, new Error(`Invalid path: "${path}". Path must start with "/"`));
|
|
19464
19464
|
}
|
|
19465
19465
|
const uniqueIds = Array.from(new Set(sourceData.flatMap((item) => {
|
|
@@ -19498,8 +19498,8 @@ async function dataLink(data, schema) {
|
|
|
19498
19498
|
}
|
|
19499
19499
|
});
|
|
19500
19500
|
}
|
|
19501
|
+
// ✅ Fetch missing items from service
|
|
19501
19502
|
if (idsToFetch.length > 0) {
|
|
19502
|
-
// ✅ Fetch remaining from service
|
|
19503
19503
|
try {
|
|
19504
19504
|
const response = await callService(service, {
|
|
19505
19505
|
method: "POST",
|
package/dist/index.esm.js
CHANGED
|
@@ -19456,8 +19456,8 @@ async function dataLink(data, schema) {
|
|
|
19456
19456
|
const result = sourceData.map((item) => ({ ...item }));
|
|
19457
19457
|
await Promise.all(schema.map(async ({ filed, service, path, headers, cacheGetter }) => {
|
|
19458
19458
|
var _a;
|
|
19459
|
-
|
|
19460
|
-
|
|
19459
|
+
// ✅ Safety check + trim path
|
|
19460
|
+
if (!path || !path.trim().startsWith("/")) {
|
|
19461
19461
|
throw new DataLinkError(service, path, new Error(`Invalid path: "${path}". Path must start with "/"`));
|
|
19462
19462
|
}
|
|
19463
19463
|
const uniqueIds = Array.from(new Set(sourceData.flatMap((item) => {
|
|
@@ -19496,8 +19496,8 @@ async function dataLink(data, schema) {
|
|
|
19496
19496
|
}
|
|
19497
19497
|
});
|
|
19498
19498
|
}
|
|
19499
|
+
// ✅ Fetch missing items from service
|
|
19499
19500
|
if (idsToFetch.length > 0) {
|
|
19500
|
-
// ✅ Fetch remaining from service
|
|
19501
19501
|
try {
|
|
19502
19502
|
const response = await callService(service, {
|
|
19503
19503
|
method: "POST",
|