@dereekb/zoho 13.7.0 → 13.8.0

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/index.cjs.js CHANGED
@@ -1457,16 +1457,17 @@ function _is_native_reflect_construct$3() {
1457
1457
  })).then(function(x) {
1458
1458
  var isInputMultipleItems = Array.isArray(data);
1459
1459
  var result = zohoRecruitMultiRecordResult(util.asArray(data), x.data);
1460
+ var finalResult;
1460
1461
  if (isInputMultipleItems) {
1461
- return result;
1462
+ finalResult = result;
1462
1463
  } else {
1463
1464
  var successItems = result.successItems, errorItems = result.errorItems;
1464
1465
  if (errorItems[0] != null) {
1465
1466
  throw zohoRecruitRecordCrudError(errorItems[0].result);
1466
- } else {
1467
- return successItems[0].result.details;
1468
1467
  }
1468
+ finalResult = successItems[0].result.details;
1469
1469
  }
1470
+ return finalResult;
1470
1471
  });
1471
1472
  };
1472
1473
  }
@@ -1965,11 +1966,12 @@ function _is_native_reflect_construct$3() {
1965
1966
  throw new Error('attachmentCategoryId or attachmentCategoryName must be provided and not empty.');
1966
1967
  }
1967
1968
  var url = "/v2/".concat(input.module, "/").concat(input.id, "/").concat(ZOHO_RECRUIT_ATTACHMENTS_MODULE, "?").concat(fetch.makeUrlSearchParams(urlParams).toString());
1969
+ var result;
1968
1970
  if (file != null) {
1969
1971
  var body = new FormData();
1970
1972
  body.append('file', file);
1971
1973
  // Clear the base Content-Type header (empty string removes it via mergeRequestHeaders) so fetch auto-detects multipart/form-data with the correct boundary from the FormData body.
1972
- return context.fetch(url, {
1974
+ result = context.fetch(url, {
1973
1975
  method: 'POST',
1974
1976
  headers: {
1975
1977
  'Content-Type': ''
@@ -1980,12 +1982,13 @@ function _is_native_reflect_construct$3() {
1980
1982
  var urlWithAttachment = "".concat(url, "&").concat(fetch.makeUrlSearchParams({
1981
1983
  attachment_url: attachmentUrl
1982
1984
  }).toString());
1983
- return context.fetch(urlWithAttachment, {
1985
+ result = context.fetch(urlWithAttachment, {
1984
1986
  method: 'POST'
1985
1987
  });
1986
1988
  } else {
1987
1989
  throw new Error('file or attachmentUrl must be provided.');
1988
1990
  }
1991
+ return result;
1989
1992
  };
1990
1993
  }
1991
1994
  /**
@@ -2104,11 +2107,10 @@ function _is_native_reflect_construct$3() {
2104
2107
  var baseUrl = isSpecificRequest && input.apiUrl != null ? zohoRecruitConfigApiUrl(input.apiUrl) : '';
2105
2108
  var url = "".concat(baseUrl).concat(relativeUrl);
2106
2109
  return context.fetchJson(url, zohoRecruitApiFetchJsonInput('POST')).then(function(x) {
2107
- if (x.code === 'success') {
2108
- return x.details;
2109
- } else {
2110
+ if (x.code !== 'success') {
2110
2111
  throw new ZohoRecruitExecuteRestApiFunctionError(x);
2111
2112
  }
2113
+ return x.details;
2112
2114
  });
2113
2115
  };
2114
2116
  }
@@ -4282,16 +4284,17 @@ function _is_native_reflect_construct() {
4282
4284
  })).catch(zohoCrmCatchZohoCrmChangeObjectLikeResponseError).then(function(x) {
4283
4285
  var isInputMultipleItems = Array.isArray(data);
4284
4286
  var result = zohoCrmMultiRecordResult(util.asArray(data), x.data);
4287
+ var finalResult;
4285
4288
  if (isInputMultipleItems) {
4286
- return result;
4289
+ finalResult = result;
4287
4290
  } else {
4288
4291
  var successItems = result.successItems, errorItems = result.errorItems;
4289
4292
  if (errorItems[0] != null) {
4290
4293
  throw zohoCrmRecordCrudError(errorItems[0].result);
4291
- } else {
4292
- return successItems[0].result.details;
4293
4294
  }
4295
+ finalResult = successItems[0].result.details;
4294
4296
  }
4297
+ return finalResult;
4295
4298
  });
4296
4299
  };
4297
4300
  }
@@ -4914,11 +4917,10 @@ function _is_native_reflect_construct() {
4914
4917
  var baseUrl = isSpecificRequest && input.apiUrl != null ? zohoCrmConfigApiUrl(input.apiUrl) : '';
4915
4918
  var url = "".concat(baseUrl).concat(relativeUrl);
4916
4919
  return context.fetchJson(url, zohoCrmApiFetchJsonInput('POST')).then(function(x) {
4917
- if (x.code === 'success') {
4918
- return x.details;
4919
- } else {
4920
+ if (x.code !== 'success') {
4920
4921
  throw new ZohoCrmExecuteRestApiFunctionError(x);
4921
4922
  }
4923
+ return x.details;
4922
4924
  });
4923
4925
  };
4924
4926
  }
package/index.esm.js CHANGED
@@ -1455,16 +1455,17 @@ function _is_native_reflect_construct$3() {
1455
1455
  })).then(function(x) {
1456
1456
  var isInputMultipleItems = Array.isArray(data);
1457
1457
  var result = zohoRecruitMultiRecordResult(asArray(data), x.data);
1458
+ var finalResult;
1458
1459
  if (isInputMultipleItems) {
1459
- return result;
1460
+ finalResult = result;
1460
1461
  } else {
1461
1462
  var successItems = result.successItems, errorItems = result.errorItems;
1462
1463
  if (errorItems[0] != null) {
1463
1464
  throw zohoRecruitRecordCrudError(errorItems[0].result);
1464
- } else {
1465
- return successItems[0].result.details;
1466
1465
  }
1466
+ finalResult = successItems[0].result.details;
1467
1467
  }
1468
+ return finalResult;
1468
1469
  });
1469
1470
  };
1470
1471
  }
@@ -1963,11 +1964,12 @@ function _is_native_reflect_construct$3() {
1963
1964
  throw new Error('attachmentCategoryId or attachmentCategoryName must be provided and not empty.');
1964
1965
  }
1965
1966
  var url = "/v2/".concat(input.module, "/").concat(input.id, "/").concat(ZOHO_RECRUIT_ATTACHMENTS_MODULE, "?").concat(makeUrlSearchParams(urlParams).toString());
1967
+ var result;
1966
1968
  if (file != null) {
1967
1969
  var body = new FormData();
1968
1970
  body.append('file', file);
1969
1971
  // Clear the base Content-Type header (empty string removes it via mergeRequestHeaders) so fetch auto-detects multipart/form-data with the correct boundary from the FormData body.
1970
- return context.fetch(url, {
1972
+ result = context.fetch(url, {
1971
1973
  method: 'POST',
1972
1974
  headers: {
1973
1975
  'Content-Type': ''
@@ -1978,12 +1980,13 @@ function _is_native_reflect_construct$3() {
1978
1980
  var urlWithAttachment = "".concat(url, "&").concat(makeUrlSearchParams({
1979
1981
  attachment_url: attachmentUrl
1980
1982
  }).toString());
1981
- return context.fetch(urlWithAttachment, {
1983
+ result = context.fetch(urlWithAttachment, {
1982
1984
  method: 'POST'
1983
1985
  });
1984
1986
  } else {
1985
1987
  throw new Error('file or attachmentUrl must be provided.');
1986
1988
  }
1989
+ return result;
1987
1990
  };
1988
1991
  }
1989
1992
  /**
@@ -2102,11 +2105,10 @@ function _is_native_reflect_construct$3() {
2102
2105
  var baseUrl = isSpecificRequest && input.apiUrl != null ? zohoRecruitConfigApiUrl(input.apiUrl) : '';
2103
2106
  var url = "".concat(baseUrl).concat(relativeUrl);
2104
2107
  return context.fetchJson(url, zohoRecruitApiFetchJsonInput('POST')).then(function(x) {
2105
- if (x.code === 'success') {
2106
- return x.details;
2107
- } else {
2108
+ if (x.code !== 'success') {
2108
2109
  throw new ZohoRecruitExecuteRestApiFunctionError(x);
2109
2110
  }
2111
+ return x.details;
2110
2112
  });
2111
2113
  };
2112
2114
  }
@@ -4280,16 +4282,17 @@ function _is_native_reflect_construct() {
4280
4282
  })).catch(zohoCrmCatchZohoCrmChangeObjectLikeResponseError).then(function(x) {
4281
4283
  var isInputMultipleItems = Array.isArray(data);
4282
4284
  var result = zohoCrmMultiRecordResult(asArray(data), x.data);
4285
+ var finalResult;
4283
4286
  if (isInputMultipleItems) {
4284
- return result;
4287
+ finalResult = result;
4285
4288
  } else {
4286
4289
  var successItems = result.successItems, errorItems = result.errorItems;
4287
4290
  if (errorItems[0] != null) {
4288
4291
  throw zohoCrmRecordCrudError(errorItems[0].result);
4289
- } else {
4290
- return successItems[0].result.details;
4291
4292
  }
4293
+ finalResult = successItems[0].result.details;
4292
4294
  }
4295
+ return finalResult;
4293
4296
  });
4294
4297
  };
4295
4298
  }
@@ -4912,11 +4915,10 @@ function _is_native_reflect_construct() {
4912
4915
  var baseUrl = isSpecificRequest && input.apiUrl != null ? zohoCrmConfigApiUrl(input.apiUrl) : '';
4913
4916
  var url = "".concat(baseUrl).concat(relativeUrl);
4914
4917
  return context.fetchJson(url, zohoCrmApiFetchJsonInput('POST')).then(function(x) {
4915
- if (x.code === 'success') {
4916
- return x.details;
4917
- } else {
4918
+ if (x.code !== 'success') {
4918
4919
  throw new ZohoCrmExecuteRestApiFunctionError(x);
4919
4920
  }
4921
+ return x.details;
4920
4922
  });
4921
4923
  };
4922
4924
  }
@@ -603,31 +603,31 @@ var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-acce
603
603
  var loadedTokens = null;
604
604
  function loadTokens() {
605
605
  return _async_to_generator$3(function() {
606
- var _ref;
606
+ var _ref, _tmp;
607
607
  return _ts_generator$3(this, function(_state) {
608
608
  switch(_state.label){
609
609
  case 0:
610
- if (!!loadedTokens) return [
610
+ if (!loadedTokens) return [
611
611
  3,
612
- 2
612
+ 1
613
613
  ];
614
+ _tmp = loadedTokens;
614
615
  return [
615
- 4,
616
- readTokenFile()
616
+ 3,
617
+ 3
617
618
  ];
618
619
  case 1:
619
620
  return [
620
- 2,
621
- (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {}
621
+ 4,
622
+ readTokenFile()
622
623
  ];
623
624
  case 2:
624
- return [
625
- 2,
626
- loadedTokens
627
- ];
625
+ _tmp = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {};
626
+ _state.label = 3;
628
627
  case 3:
629
628
  return [
630
- 2
629
+ 2,
630
+ _tmp
631
631
  ];
632
632
  }
633
633
  });
@@ -601,31 +601,31 @@ var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-acce
601
601
  var loadedTokens = null;
602
602
  function loadTokens() {
603
603
  return _async_to_generator$3(function() {
604
- var _ref;
604
+ var _ref, _tmp;
605
605
  return _ts_generator$3(this, function(_state) {
606
606
  switch(_state.label){
607
607
  case 0:
608
- if (!!loadedTokens) return [
608
+ if (!loadedTokens) return [
609
609
  3,
610
- 2
610
+ 1
611
611
  ];
612
+ _tmp = loadedTokens;
612
613
  return [
613
- 4,
614
- readTokenFile()
614
+ 3,
615
+ 3
615
616
  ];
616
617
  case 1:
617
618
  return [
618
- 2,
619
- (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {}
619
+ 4,
620
+ readTokenFile()
620
621
  ];
621
622
  case 2:
622
- return [
623
- 2,
624
- loadedTokens
625
- ];
623
+ _tmp = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {};
624
+ _state.label = 3;
626
625
  case 3:
627
626
  return [
628
- 2
627
+ 2,
628
+ _tmp
629
629
  ];
630
630
  }
631
631
  });
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dereekb/zoho/nestjs",
3
- "version": "13.7.0",
3
+ "version": "13.8.0",
4
4
  "peerDependencies": {
5
- "@dereekb/nestjs": "13.7.0",
6
- "@dereekb/rxjs": "13.7.0",
7
- "@dereekb/util": "13.7.0",
8
- "@dereekb/zoho": "13.7.0",
5
+ "@dereekb/nestjs": "13.8.0",
6
+ "@dereekb/rxjs": "13.8.0",
7
+ "@dereekb/util": "13.8.0",
8
+ "@dereekb/zoho": "13.8.0",
9
9
  "@nestjs/common": "^11.1.17",
10
- "@nestjs/config": "^4.0.3",
10
+ "@nestjs/config": "^4.0.4",
11
11
  "express": "^5.0.0"
12
12
  },
13
13
  "devDependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho",
3
- "version": "13.7.0",
3
+ "version": "13.8.0",
4
4
  "exports": {
5
5
  "./nestjs": {
6
6
  "module": "./nestjs/index.esm.js",
@@ -17,11 +17,11 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@dereekb/nestjs": "13.7.0",
21
- "@dereekb/rxjs": "13.7.0",
22
- "@dereekb/util": "13.7.0",
20
+ "@dereekb/nestjs": "13.8.0",
21
+ "@dereekb/rxjs": "13.8.0",
22
+ "@dereekb/util": "13.8.0",
23
23
  "@nestjs/common": "^11.1.17",
24
- "@nestjs/config": "^4.0.3",
24
+ "@nestjs/config": "^4.0.4",
25
25
  "express": "^5.0.0",
26
26
  "make-error": "^1.3.0"
27
27
  },