@dereekb/zoho 13.6.17 → 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
  }
@@ -3,11 +3,11 @@
3
3
  var common = require('@nestjs/common');
4
4
  var zoho = require('@dereekb/zoho');
5
5
  var util = require('@dereekb/util');
6
- var path = require('path');
7
- var fs = require('fs');
6
+ var node_path = require('node:path');
7
+ var node_fs = require('node:fs');
8
8
  var config = require('@nestjs/config');
9
9
  var nestjs = require('@dereekb/nestjs');
10
- var crypto = require('crypto');
10
+ var node_crypto = require('node:crypto');
11
11
 
12
12
  function _type_of(obj) {
13
13
  "@swc/helpers - typeof";
@@ -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
  });
@@ -635,10 +635,10 @@ var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-acce
635
635
  }
636
636
  function readTokenFile() {
637
637
  return new Promise(function(resolve) {
638
- fs.mkdirSync(path.dirname(filename), {
638
+ node_fs.mkdirSync(node_path.dirname(filename), {
639
639
  recursive: true
640
640
  }); // make the directory first
641
- fs.readFile(filename, {}, function(x, data) {
641
+ node_fs.readFile(filename, {}, function(x, data) {
642
642
  var result = undefined;
643
643
  if (!x) {
644
644
  try {
@@ -670,7 +670,7 @@ var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-acce
670
670
  return [
671
671
  2,
672
672
  new Promise(function(resolve, reject) {
673
- fs.writeFile(filename, JSON.stringify(tokens), {}, function(x) {
673
+ node_fs.writeFile(filename, JSON.stringify(tokens), {}, function(x) {
674
674
  if (!x) {
675
675
  resolve();
676
676
  } else {
@@ -688,7 +688,7 @@ var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-acce
688
688
  return [
689
689
  2,
690
690
  new Promise(function(resolve, reject) {
691
- fs.rm(filename, function(x) {
691
+ node_fs.rm(filename, function(x) {
692
692
  if (!x) {
693
693
  resolve();
694
694
  } else {
@@ -2857,14 +2857,14 @@ function _ts_generator$2(thisArg, body) {
2857
2857
  }
2858
2858
  payloadString = rawBody.toString('utf-8');
2859
2859
  // Compute HMAC-SHA256 and base64 encode
2860
- computedSignature = crypto.createHmac('sha256', secret).update(payloadString, 'utf-8').digest('base64');
2860
+ computedSignature = node_crypto.createHmac('sha256', secret).update(payloadString, 'utf-8').digest('base64');
2861
2861
  // Use timing-safe comparison
2862
2862
  valid = false;
2863
2863
  try {
2864
2864
  receivedBuffer = Buffer.from(receivedSignature, 'base64');
2865
2865
  computedBuffer = Buffer.from(computedSignature, 'base64');
2866
2866
  if (receivedBuffer.length === computedBuffer.length) {
2867
- valid = crypto.timingSafeEqual(receivedBuffer, computedBuffer);
2867
+ valid = node_crypto.timingSafeEqual(receivedBuffer, computedBuffer);
2868
2868
  }
2869
2869
  } catch (unused) {
2870
2870
  valid = false;
@@ -1,11 +1,11 @@
1
1
  import { Injectable, Inject, Logger, Post, Req, Controller, Module } from '@nestjs/common';
2
2
  import { zohoAccountsFactory, zohoAccountsAccessToken, zohoCrmFactory, zohoCrmInsertRecord, zohoCrmUpsertRecord, zohoCrmUpdateRecord, zohoCrmDeleteRecord, zohoCrmGetRecordById, zohoCrmGetRecords, zohoCrmSearchRecords, zohoCrmSearchRecordsPageFactory, zohoCrmGetRelatedRecordsFunctionFactory, zohoCrmGetEmailsForRecord, zohoCrmGetEmailsForRecordPageFactory, zohoCrmGetAttachmentsForRecord, zohoCrmGetAttachmentsForRecordPageFactory, zohoCrmUploadAttachmentForRecord, zohoCrmDownloadAttachmentForRecord, zohoCrmDeleteAttachmentFromRecord, zohoCrmCreateNotes, zohoCrmDeleteNotes, zohoCrmCreateNotesForRecord, zohoCrmGetNotesForRecord, zohoCrmGetNotesForRecordPageFactory, zohoCrmExecuteRestApiFunction, zohoCrmCreateTagsForModule, zohoCrmDeleteTag, zohoCrmGetTagsForModule, zohoCrmAddTagsToRecords, zohoCrmRemoveTagsFromRecords, ZOHO_CRM_SERVICE_NAME, zohoRecruitFactory, zohoRecruitInsertRecord, zohoRecruitUpsertRecord, zohoRecruitUpdateRecord, zohoRecruitDeleteRecord, zohoRecruitGetRecordById, zohoRecruitGetRecords, zohoRecruitSearchRecords, zohoRecruitSearchRecordsPageFactory, zohoRecruitGetRelatedRecordsFunctionFactory, zohoRecruitGetEmailsForRecord, zohoRecruitGetEmailsForRecordPageFactory, zohoRecruitGetAttachmentsForRecord, zohoRecruitGetAttachmentsForRecordPageFactory, zohoRecruitUploadAttachmentForRecord, zohoRecruitDownloadAttachmentForRecord, zohoRecruitDeleteAttachmentFromRecord, zohoRecruitCreateNotes, zohoRecruitDeleteNotes, zohoRecruitCreateNotesForRecord, zohoRecruitGetNotesForRecord, zohoRecruitGetNotesForRecordPageFactory, zohoRecruitExecuteRestApiFunction, zohoRecruitAssociateCandidateRecordsWithJobOpenings, zohoRecruitSearchCandidateAssociatedJobOpeningRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory, zohoRecruitSearchJobOpeningAssociatedCandidateRecords, zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory, zohoRecruitCreateTagsForModule, zohoRecruitGetTagsForModule, zohoRecruitAddTagsToRecords, zohoRecruitRemoveTagsFromRecords, ZOHO_RECRUIT_SERVICE_NAME, zohoSignFactory, zohoSignGetDocument, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignGetDocumentFormData, zohoSignRetrieveFieldTypes, zohoSignDownloadPdf, zohoSignDownloadCompletionCertificate, zohoSignCreateDocument, zohoSignUpdateDocument, zohoSignSendDocumentForSignature, zohoSignExtendDocument, zohoSignDeleteDocument, ZOHO_SIGN_SERVICE_NAME } from '@dereekb/zoho';
3
3
  import { forEachKeyValue, tryWithPromiseFactoriesFunction, isPast, filterMaybeArrayValues, handlerFactory, handlerConfigurerFactory, handlerMappedSetFunctionFactory } from '@dereekb/util';
4
- import { dirname } from 'path';
5
- import { mkdirSync, readFile, writeFile, rm } from 'fs';
4
+ import { dirname } from 'node:path';
5
+ import { mkdirSync, readFile, writeFile, rm } from 'node:fs';
6
6
  import { ConfigService, ConfigModule } from '@nestjs/config';
7
7
  import { RawBody } from '@dereekb/nestjs';
8
- import { createHmac, timingSafeEqual } from 'crypto';
8
+ import { createHmac, timingSafeEqual } from 'node:crypto';
9
9
 
10
10
  function _type_of(obj) {
11
11
  "@swc/helpers - typeof";
@@ -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.6.17",
3
+ "version": "13.8.0",
4
4
  "peerDependencies": {
5
- "@dereekb/nestjs": "13.6.17",
6
- "@dereekb/rxjs": "13.6.17",
7
- "@dereekb/util": "13.6.17",
8
- "@dereekb/zoho": "13.6.17",
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": {
@@ -2,7 +2,7 @@ import { type ZohoCrmConfig, type ZohoCrmFactoryConfig } from '@dereekb/zoho';
2
2
  /**
3
3
  * API configuration for connecting to the Zoho CRM service endpoint.
4
4
  */
5
- export type ZohoCrmServiceApiConfig = ZohoCrmConfig & {};
5
+ export type ZohoCrmServiceApiConfig = ZohoCrmConfig;
6
6
  /**
7
7
  * Abstract configuration class for the NestJS Zoho CRM service.
8
8
  *
@@ -2,7 +2,7 @@ import { type ZohoRecruitConfig, type ZohoRecruitFactoryConfig } from '@dereekb/
2
2
  /**
3
3
  * API configuration for connecting to the Zoho Recruit service endpoint.
4
4
  */
5
- export type ZohoRecruitServiceApiConfig = ZohoRecruitConfig & {};
5
+ export type ZohoRecruitServiceApiConfig = ZohoRecruitConfig;
6
6
  /**
7
7
  * Abstract configuration class for the NestJS Zoho Recruit service.
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import { type ZohoSignConfig, type ZohoSignFactoryConfig } from '@dereekb/zoho';
2
- export type ZohoSignServiceApiConfig = ZohoSignConfig & {};
2
+ export type ZohoSignServiceApiConfig = ZohoSignConfig;
3
3
  /**
4
4
  * Configuration for ZohoSignService
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho",
3
- "version": "13.6.17",
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.6.17",
21
- "@dereekb/rxjs": "13.6.17",
22
- "@dereekb/util": "13.6.17",
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
  },