node-consul-service 1.0.53 → 1.0.54

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 CHANGED
@@ -19033,7 +19033,7 @@ const {
19033
19033
 
19034
19034
  async function callService(serviceName, options = {}) {
19035
19035
  var _a, _b;
19036
- const { method = 'GET', path = '/hello', data, headers, params, } = options;
19036
+ const { method = 'GET', path = '/', data, headers, params, } = options;
19037
19037
  try {
19038
19038
  const instance = await getRandomServiceInstance(serviceName);
19039
19039
  const url = `http://${instance.ServiceAddress}:${instance.ServicePort}${path}`;
@@ -19095,7 +19095,6 @@ async function dataLink(data, schema) {
19095
19095
  const sourceData = isArray ? data : [data];
19096
19096
  const result = sourceData.map((item) => ({ ...item }));
19097
19097
  await Promise.all(schema.map(async ({ filed, service, path, headers, cacheGetter }) => {
19098
- var _a;
19099
19098
  if (!path || !path.trim().startsWith("/")) {
19100
19099
  throw new DataLinkError(service, path, new Error(`Invalid path: "${path}". Path must start with "/"`));
19101
19100
  }
@@ -19147,8 +19146,8 @@ async function dataLink(data, schema) {
19147
19146
  headers,
19148
19147
  data: { ids: idsToFetch },
19149
19148
  });
19150
- if ((response === null || response === void 0 ? void 0 : response.success) && Array.isArray((_a = response.data) === null || _a === void 0 ? void 0 : _a.data)) {
19151
- for (const item of response.data.data) {
19149
+ if ((response === null || response === void 0 ? void 0 : response.success) && Array.isArray(response.data)) {
19150
+ for (const item of response.data) {
19152
19151
  if (item === null || item === void 0 ? void 0 : item._id) {
19153
19152
  cacheMap.set(normalizeId(item._id), item);
19154
19153
  }
package/dist/index.esm.js CHANGED
@@ -19031,7 +19031,7 @@ const {
19031
19031
 
19032
19032
  async function callService(serviceName, options = {}) {
19033
19033
  var _a, _b;
19034
- const { method = 'GET', path = '/hello', data, headers, params, } = options;
19034
+ const { method = 'GET', path = '/', data, headers, params, } = options;
19035
19035
  try {
19036
19036
  const instance = await getRandomServiceInstance(serviceName);
19037
19037
  const url = `http://${instance.ServiceAddress}:${instance.ServicePort}${path}`;
@@ -19093,7 +19093,6 @@ async function dataLink(data, schema) {
19093
19093
  const sourceData = isArray ? data : [data];
19094
19094
  const result = sourceData.map((item) => ({ ...item }));
19095
19095
  await Promise.all(schema.map(async ({ filed, service, path, headers, cacheGetter }) => {
19096
- var _a;
19097
19096
  if (!path || !path.trim().startsWith("/")) {
19098
19097
  throw new DataLinkError(service, path, new Error(`Invalid path: "${path}". Path must start with "/"`));
19099
19098
  }
@@ -19145,8 +19144,8 @@ async function dataLink(data, schema) {
19145
19144
  headers,
19146
19145
  data: { ids: idsToFetch },
19147
19146
  });
19148
- if ((response === null || response === void 0 ? void 0 : response.success) && Array.isArray((_a = response.data) === null || _a === void 0 ? void 0 : _a.data)) {
19149
- for (const item of response.data.data) {
19147
+ if ((response === null || response === void 0 ? void 0 : response.success) && Array.isArray(response.data)) {
19148
+ for (const item of response.data) {
19150
19149
  if (item === null || item === void 0 ? void 0 : item._id) {
19151
19150
  cacheMap.set(normalizeId(item._id), item);
19152
19151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-consul-service",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",