@dereekb/zoho 12.1.10 → 12.1.12

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
@@ -1775,6 +1775,21 @@ $$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
1775
1775
  map: map
1776
1776
  });
1777
1777
 
1778
+ /**
1779
+ * Returns an empty ZohoPageResult that is typed to R and has no more records/results.
1780
+ */
1781
+ function emptyZohoPageResult() {
1782
+ return {
1783
+ data: [],
1784
+ info: {
1785
+ page: 1,
1786
+ per_page: 100,
1787
+ // default value
1788
+ count: 0,
1789
+ more_records: false
1790
+ }
1791
+ };
1792
+ }
1778
1793
  /**
1779
1794
  * Creates a FetchPageFactory using the input ZohoFetchPageFetchFunction.
1780
1795
  *
@@ -1959,6 +1974,14 @@ function zohoRecruitSearchRecordsCriteriaEntryToCriteriaString(entry) {
1959
1974
  * A code used in some cases to denote success.
1960
1975
  */
1961
1976
  const ZOHO_SUCCESS_CODE = 'SUCCESS';
1977
+ /**
1978
+ * Lowercase status code
1979
+ */
1980
+ const ZOHO_SUCCESS_STATUS = 'success';
1981
+ /**
1982
+ * Set in the status field
1983
+ */
1984
+ const ZOHO_ERROR_STATUS = 'error';
1962
1985
  function zohoServerErrorData(error) {
1963
1986
  const errorType = typeof error;
1964
1987
  let errorData;
@@ -2069,6 +2092,10 @@ function interceptZohoErrorResponseFactory(parseZohoServerErrorResponseData) {
2069
2092
  * - An extra parameter is provided
2070
2093
  */
2071
2094
  const ZOHO_INTERNAL_ERROR_CODE = 'INTERNAL_ERROR';
2095
+ /**
2096
+ * Error code for when a failure occured for the given action
2097
+ */
2098
+ const ZOHO_FAILURE_ERROR_CODE = 'FAILURE';
2072
2099
  /**
2073
2100
  * Error when the Zoho API returns an internal error
2074
2101
  */
@@ -2188,6 +2215,12 @@ function tryFindZohoServerErrorData(errorResponseData, responseError) {
2188
2215
  return error;
2189
2216
  }
2190
2217
 
2218
+ /**
2219
+ * Error code for when two records are already associated with each other.
2220
+ *
2221
+ * Example being a candidate and a job opening are already associated.
2222
+ */
2223
+ const ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = 'ALREADY_ASSOCIATED';
2191
2224
  /**
2192
2225
  * Thrown when a record with the given id has no content. Typically also means it does not exist.
2193
2226
  */
@@ -2329,6 +2362,26 @@ function upsertRecord(context) {
2329
2362
  function updateRecord(context) {
2330
2363
  return updateRecordLikeFunction(context, '', 'PUT');
2331
2364
  }
2365
+ /**
2366
+ * Deletes one or more records from the given module.
2367
+ *
2368
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-records.html
2369
+ *
2370
+ * @param context
2371
+ * @returns ZohoRecruitDeleteRecordFunction
2372
+ */
2373
+ function deleteRecord(context) {
2374
+ return ({
2375
+ ids,
2376
+ module,
2377
+ wf_trigger
2378
+ }) => {
2379
+ return context.fetchJson(`/v2/${module}?${fetch.makeUrlSearchParams({
2380
+ ids,
2381
+ wf_trigger
2382
+ })}`, zohoRecruitApiFetchJsonInput('DELETE')).then(zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs);
2383
+ };
2384
+ }
2332
2385
  /**
2333
2386
  * Retrieves a specific record from the given module.
2334
2387
  *
@@ -2385,6 +2438,22 @@ function searchRecords(context) {
2385
2438
  function searchRecordsPageFactory(context) {
2386
2439
  return zohoFetchPageFactory(searchRecords(context));
2387
2440
  }
2441
+ /**
2442
+ * Creates a ZohoRecruitGetRelatedRecordsFunctionFactory, which can be used to create ZohoRecruitGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
2443
+ *
2444
+ * https://www.zoho.com/recruit/developer-guide/apiv2/get-related-records.html
2445
+ *
2446
+ * @param context the ZohoRecruitContext to use
2447
+ * @returns a ZohoRecruitGetRelatedRecordsFunctionFactory
2448
+ */
2449
+ function getRelatedRecordsFunctionFactory(context) {
2450
+ return config => {
2451
+ const {
2452
+ targetModule
2453
+ } = config;
2454
+ return input => context.fetchJson(`/v2/${input.module}/${input.id}/${targetModule}?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET'));
2455
+ };
2456
+ }
2388
2457
  function createNotes(context) {
2389
2458
  return input => context.fetchJson(`/v2/Notes`, zohoRecruitApiFetchJsonInput('POST', {
2390
2459
  data: input.data
@@ -2400,7 +2469,9 @@ function deleteNotes(context) {
2400
2469
  });
2401
2470
  }
2402
2471
  function getNotesForRecord(context) {
2403
- return input => context.fetchJson(`/v2/${input.module}/${input.id}/Notes?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET'));
2472
+ return getRelatedRecordsFunctionFactory(context)({
2473
+ targetModule: 'Notes'
2474
+ });
2404
2475
  }
2405
2476
  function getNotesForRecordPageFactory(context) {
2406
2477
  return zohoFetchPageFactory(getNotesForRecord(context));
@@ -2481,12 +2552,32 @@ function zohoRecruitApiFetchJsonInput(method, body) {
2481
2552
  };
2482
2553
  return result;
2483
2554
  }
2555
+ function zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs(response) {
2556
+ const {
2557
+ data
2558
+ } = response;
2559
+ const successItems = [];
2560
+ const errorItems = [];
2561
+ data.forEach(x => {
2562
+ if (x.status === ZOHO_SUCCESS_STATUS) {
2563
+ successItems.push(x);
2564
+ } else {
2565
+ errorItems.push(x);
2566
+ }
2567
+ });
2568
+ const result = {
2569
+ ...response,
2570
+ successItems,
2571
+ errorItems
2572
+ };
2573
+ return result;
2574
+ }
2484
2575
  function zohoRecruitMultiRecordResult(input, results) {
2485
2576
  const successItems = [];
2486
2577
  const errorItems = [];
2487
2578
  input.forEach((x, i) => {
2488
2579
  const result = results[i];
2489
- if (result.status === 'success') {
2580
+ if (result.status === ZOHO_SUCCESS_STATUS) {
2490
2581
  successItems.push({
2491
2582
  input: x,
2492
2583
  result: result
@@ -2505,6 +2596,80 @@ function zohoRecruitMultiRecordResult(input, results) {
2505
2596
  return result;
2506
2597
  }
2507
2598
 
2599
+ /**
2600
+ * Candidates module name
2601
+ */
2602
+ const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
2603
+ /**
2604
+ * Job Openings module name
2605
+ */
2606
+ const ZOHO_RECRUIT_JOB_OPENINGS_MODULE = 'Job_Openings';
2607
+ /**
2608
+ * Returns true if it is a valid ZohoRecruitValidUrl.
2609
+ */
2610
+ const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
2611
+
2612
+ /**
2613
+ * Associates one or more candidates with one or more job openings.
2614
+ *
2615
+ * https://www.zoho.com/recruit/developer-guide/apiv2/associate-candidate.html
2616
+ *
2617
+ * @param context
2618
+ * @returns
2619
+ */
2620
+ function associateCandidateRecordsWithJobOpenings(context) {
2621
+ return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_CANDIDATES_MODULE}/actions/associate`, zohoRecruitApiFetchJsonInput('PUT', {
2622
+ data: util.asArray(input)
2623
+ })).then(x => {
2624
+ const resultInputMap = x.data.map(() => input); // assign "input" to each value for now
2625
+ const result = zohoRecruitMultiRecordResult(resultInputMap, x.data);
2626
+ const {
2627
+ included: alreadyAssociatedErrorItems,
2628
+ excluded: otherErrorItems
2629
+ } = util.separateValues(result.errorItems, x => {
2630
+ return x.result.code === ZOHO_FAILURE_ERROR_CODE && x.result.details.error[0].code === ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
2631
+ });
2632
+ return {
2633
+ ...result,
2634
+ errorItems: otherErrorItems,
2635
+ alreadyAssociatedErrorItems,
2636
+ allErrorItems: result.errorItems
2637
+ };
2638
+ });
2639
+ }
2640
+ function searchAssociatedRecords(context) {
2641
+ return input => {
2642
+ return context.fetchJson(`/v2/${input.module}/${input.id}/associate?${zohoRecruitUrlSearchParamsMinusIdAndModule(input).toString()}`, zohoRecruitApiFetchJsonInput('GET')).then(x => {
2643
+ const result = x ?? emptyZohoPageResult();
2644
+ return result;
2645
+ });
2646
+ };
2647
+ }
2648
+ function searchCandidateAssociatedJobOpeningRecords(context) {
2649
+ const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2650
+ return input => {
2651
+ return searchAssociatedRecordsFactory({
2652
+ ...input,
2653
+ module: ZOHO_RECRUIT_CANDIDATES_MODULE
2654
+ });
2655
+ };
2656
+ }
2657
+ function searchCandidateAssociatedJobOpeningRecordsPageFactory(context) {
2658
+ return zohoFetchPageFactory(searchCandidateAssociatedJobOpeningRecords(context));
2659
+ }
2660
+ function searchJobOpeningAssociatedCandidateRecords(context, jobOpeningModuleName = ZOHO_RECRUIT_JOB_OPENINGS_MODULE) {
2661
+ const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2662
+ return input => {
2663
+ return searchAssociatedRecordsFactory({
2664
+ ...input,
2665
+ module: jobOpeningModuleName
2666
+ });
2667
+ };
2668
+ }
2669
+ function searchJobOpeningAssociatedCandidateRecordsPageFactory(context) {
2670
+ return zohoFetchPageFactory(searchJobOpeningAssociatedCandidateRecords(context));
2671
+ }
2672
+
2508
2673
  /**
2509
2674
  * Creates a ZohoRecruitSearchRecordsCriteriaEntryArray from an array of emails.
2510
2675
  *
@@ -2703,15 +2868,6 @@ function zohoRecruitFactory(factoryConfig) {
2703
2868
  };
2704
2869
  }
2705
2870
 
2706
- /**
2707
- * Candidates module name
2708
- */
2709
- const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
2710
- /**
2711
- * Returns true if it is a valid ZohoRecruitValidUrl.
2712
- */
2713
- const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
2714
-
2715
2871
  /**
2716
2872
  * Trades a refresh token for a new AccessToken
2717
2873
  * @param context
@@ -2888,6 +3044,8 @@ exports.ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CLIENT_E
2888
3044
  exports.ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE;
2889
3045
  exports.ZOHO_ACCOUNTS_US_API_URL = ZOHO_ACCOUNTS_US_API_URL;
2890
3046
  exports.ZOHO_DUPLICATE_DATA_ERROR_CODE = ZOHO_DUPLICATE_DATA_ERROR_CODE;
3047
+ exports.ZOHO_ERROR_STATUS = ZOHO_ERROR_STATUS;
3048
+ exports.ZOHO_FAILURE_ERROR_CODE = ZOHO_FAILURE_ERROR_CODE;
2891
3049
  exports.ZOHO_INTERNAL_ERROR_CODE = ZOHO_INTERNAL_ERROR_CODE;
2892
3050
  exports.ZOHO_INVALID_AUTHORIZATION_ERROR_CODE = ZOHO_INVALID_AUTHORIZATION_ERROR_CODE;
2893
3051
  exports.ZOHO_INVALID_DATA_ERROR_CODE = ZOHO_INVALID_DATA_ERROR_CODE;
@@ -2896,9 +3054,12 @@ exports.ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE = ZOHO_MANDATORY_NOT_FOUND_ERROR_COD
2896
3054
  exports.ZOHO_RATE_LIMIT_LIMIT_HEADER = ZOHO_RATE_LIMIT_LIMIT_HEADER;
2897
3055
  exports.ZOHO_RATE_LIMIT_REMAINING_HEADER = ZOHO_RATE_LIMIT_REMAINING_HEADER;
2898
3056
  exports.ZOHO_RATE_LIMIT_RESET_HEADER = ZOHO_RATE_LIMIT_RESET_HEADER;
3057
+ exports.ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
2899
3058
  exports.ZOHO_RECRUIT_CANDIDATES_MODULE = ZOHO_RECRUIT_CANDIDATES_MODULE;
3059
+ exports.ZOHO_RECRUIT_JOB_OPENINGS_MODULE = ZOHO_RECRUIT_JOB_OPENINGS_MODULE;
2900
3060
  exports.ZOHO_RECRUIT_SERVICE_NAME = ZOHO_RECRUIT_SERVICE_NAME;
2901
3061
  exports.ZOHO_SUCCESS_CODE = ZOHO_SUCCESS_CODE;
3062
+ exports.ZOHO_SUCCESS_STATUS = ZOHO_SUCCESS_STATUS;
2902
3063
  exports.ZOHO_TOO_MANY_REQUESTS_ERROR_CODE = ZOHO_TOO_MANY_REQUESTS_ERROR_CODE;
2903
3064
  exports.ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE;
2904
3065
  exports.ZohoAccountsAccessTokenError = ZohoAccountsAccessTokenError;
@@ -2918,15 +3079,19 @@ exports.ZohoServerFetchResponseError = ZohoServerFetchResponseError;
2918
3079
  exports.ZohoTooManyRequestsError = ZohoTooManyRequestsError;
2919
3080
  exports.accessToken = accessToken;
2920
3081
  exports.assertRecordDataArrayResultHasContent = assertRecordDataArrayResultHasContent;
3082
+ exports.associateCandidateRecordsWithJobOpenings = associateCandidateRecordsWithJobOpenings;
2921
3083
  exports.createNotes = createNotes;
2922
3084
  exports.createNotesForRecord = createNotesForRecord;
2923
3085
  exports.deleteNotes = deleteNotes;
3086
+ exports.deleteRecord = deleteRecord;
3087
+ exports.emptyZohoPageResult = emptyZohoPageResult;
2924
3088
  exports.escapeZohoFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
2925
3089
  exports.executeRestApiFunction = executeRestApiFunction;
2926
3090
  exports.getNotesForRecord = getNotesForRecord;
2927
3091
  exports.getNotesForRecordPageFactory = getNotesForRecordPageFactory;
2928
3092
  exports.getRecordById = getRecordById;
2929
3093
  exports.getRecords = getRecords;
3094
+ exports.getRelatedRecordsFunctionFactory = getRelatedRecordsFunctionFactory;
2930
3095
  exports.handleZohoAccountsErrorFetch = handleZohoAccountsErrorFetch;
2931
3096
  exports.handleZohoErrorFetchFactory = handleZohoErrorFetchFactory;
2932
3097
  exports.handleZohoRecruitErrorFetch = handleZohoRecruitErrorFetch;
@@ -2944,6 +3109,11 @@ exports.parseZohoRecruitError = parseZohoRecruitError;
2944
3109
  exports.parseZohoRecruitServerErrorResponseData = parseZohoRecruitServerErrorResponseData;
2945
3110
  exports.parseZohoServerErrorResponseData = parseZohoServerErrorResponseData;
2946
3111
  exports.safeZohoDateTimeString = safeZohoDateTimeString;
3112
+ exports.searchAssociatedRecords = searchAssociatedRecords;
3113
+ exports.searchCandidateAssociatedJobOpeningRecords = searchCandidateAssociatedJobOpeningRecords;
3114
+ exports.searchCandidateAssociatedJobOpeningRecordsPageFactory = searchCandidateAssociatedJobOpeningRecordsPageFactory;
3115
+ exports.searchJobOpeningAssociatedCandidateRecords = searchJobOpeningAssociatedCandidateRecords;
3116
+ exports.searchJobOpeningAssociatedCandidateRecordsPageFactory = searchJobOpeningAssociatedCandidateRecordsPageFactory;
2947
3117
  exports.searchRecords = searchRecords;
2948
3118
  exports.searchRecordsPageFactory = searchRecordsPageFactory;
2949
3119
  exports.tryFindZohoServerErrorData = tryFindZohoServerErrorData;
@@ -2959,6 +3129,7 @@ exports.zohoFetchPageFactory = zohoFetchPageFactory;
2959
3129
  exports.zohoRateLimitHeaderDetails = zohoRateLimitHeaderDetails;
2960
3130
  exports.zohoRateLimitedFetchHandler = zohoRateLimitedFetchHandler;
2961
3131
  exports.zohoRecruitApiFetchJsonInput = zohoRecruitApiFetchJsonInput;
3132
+ exports.zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs = zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs;
2962
3133
  exports.zohoRecruitConfigApiUrl = zohoRecruitConfigApiUrl;
2963
3134
  exports.zohoRecruitFactory = zohoRecruitFactory;
2964
3135
  exports.zohoRecruitMultiRecordResult = zohoRecruitMultiRecordResult;
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getNextPageNumber, escapeStringCharactersFunction, filterMaybeArrayValues, asArray, MS_IN_MINUTE, resetPeriodPromiseRateLimiter, MS_IN_SECOND, isStandardInternetAccessibleWebsiteUrl } from '@dereekb/util';
1
+ import { getNextPageNumber, escapeStringCharactersFunction, filterMaybeArrayValues, asArray, MS_IN_MINUTE, isStandardInternetAccessibleWebsiteUrl, separateValues, resetPeriodPromiseRateLimiter, MS_IN_SECOND } from '@dereekb/util';
2
2
  import { fetchPageFactory, FetchResponseError, makeUrlSearchParams, FetchRequestFactoryError, rateLimitedFetchHandler, fetchJsonFunction, returnNullHandleFetchJsonParseErrorFunction, fetchApiFetchService } from '@dereekb/util/fetch';
3
3
  import { BaseError } from 'make-error';
4
4
 
@@ -1773,6 +1773,21 @@ $$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
1773
1773
  map: map
1774
1774
  });
1775
1775
 
1776
+ /**
1777
+ * Returns an empty ZohoPageResult that is typed to R and has no more records/results.
1778
+ */
1779
+ function emptyZohoPageResult() {
1780
+ return {
1781
+ data: [],
1782
+ info: {
1783
+ page: 1,
1784
+ per_page: 100,
1785
+ // default value
1786
+ count: 0,
1787
+ more_records: false
1788
+ }
1789
+ };
1790
+ }
1776
1791
  /**
1777
1792
  * Creates a FetchPageFactory using the input ZohoFetchPageFetchFunction.
1778
1793
  *
@@ -1957,6 +1972,14 @@ function zohoRecruitSearchRecordsCriteriaEntryToCriteriaString(entry) {
1957
1972
  * A code used in some cases to denote success.
1958
1973
  */
1959
1974
  const ZOHO_SUCCESS_CODE = 'SUCCESS';
1975
+ /**
1976
+ * Lowercase status code
1977
+ */
1978
+ const ZOHO_SUCCESS_STATUS = 'success';
1979
+ /**
1980
+ * Set in the status field
1981
+ */
1982
+ const ZOHO_ERROR_STATUS = 'error';
1960
1983
  function zohoServerErrorData(error) {
1961
1984
  const errorType = typeof error;
1962
1985
  let errorData;
@@ -2067,6 +2090,10 @@ function interceptZohoErrorResponseFactory(parseZohoServerErrorResponseData) {
2067
2090
  * - An extra parameter is provided
2068
2091
  */
2069
2092
  const ZOHO_INTERNAL_ERROR_CODE = 'INTERNAL_ERROR';
2093
+ /**
2094
+ * Error code for when a failure occured for the given action
2095
+ */
2096
+ const ZOHO_FAILURE_ERROR_CODE = 'FAILURE';
2070
2097
  /**
2071
2098
  * Error when the Zoho API returns an internal error
2072
2099
  */
@@ -2186,6 +2213,12 @@ function tryFindZohoServerErrorData(errorResponseData, responseError) {
2186
2213
  return error;
2187
2214
  }
2188
2215
 
2216
+ /**
2217
+ * Error code for when two records are already associated with each other.
2218
+ *
2219
+ * Example being a candidate and a job opening are already associated.
2220
+ */
2221
+ const ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = 'ALREADY_ASSOCIATED';
2189
2222
  /**
2190
2223
  * Thrown when a record with the given id has no content. Typically also means it does not exist.
2191
2224
  */
@@ -2327,6 +2360,26 @@ function upsertRecord(context) {
2327
2360
  function updateRecord(context) {
2328
2361
  return updateRecordLikeFunction(context, '', 'PUT');
2329
2362
  }
2363
+ /**
2364
+ * Deletes one or more records from the given module.
2365
+ *
2366
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-records.html
2367
+ *
2368
+ * @param context
2369
+ * @returns ZohoRecruitDeleteRecordFunction
2370
+ */
2371
+ function deleteRecord(context) {
2372
+ return ({
2373
+ ids,
2374
+ module,
2375
+ wf_trigger
2376
+ }) => {
2377
+ return context.fetchJson(`/v2/${module}?${makeUrlSearchParams({
2378
+ ids,
2379
+ wf_trigger
2380
+ })}`, zohoRecruitApiFetchJsonInput('DELETE')).then(zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs);
2381
+ };
2382
+ }
2330
2383
  /**
2331
2384
  * Retrieves a specific record from the given module.
2332
2385
  *
@@ -2383,6 +2436,22 @@ function searchRecords(context) {
2383
2436
  function searchRecordsPageFactory(context) {
2384
2437
  return zohoFetchPageFactory(searchRecords(context));
2385
2438
  }
2439
+ /**
2440
+ * Creates a ZohoRecruitGetRelatedRecordsFunctionFactory, which can be used to create ZohoRecruitGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
2441
+ *
2442
+ * https://www.zoho.com/recruit/developer-guide/apiv2/get-related-records.html
2443
+ *
2444
+ * @param context the ZohoRecruitContext to use
2445
+ * @returns a ZohoRecruitGetRelatedRecordsFunctionFactory
2446
+ */
2447
+ function getRelatedRecordsFunctionFactory(context) {
2448
+ return config => {
2449
+ const {
2450
+ targetModule
2451
+ } = config;
2452
+ return input => context.fetchJson(`/v2/${input.module}/${input.id}/${targetModule}?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET'));
2453
+ };
2454
+ }
2386
2455
  function createNotes(context) {
2387
2456
  return input => context.fetchJson(`/v2/Notes`, zohoRecruitApiFetchJsonInput('POST', {
2388
2457
  data: input.data
@@ -2398,7 +2467,9 @@ function deleteNotes(context) {
2398
2467
  });
2399
2468
  }
2400
2469
  function getNotesForRecord(context) {
2401
- return input => context.fetchJson(`/v2/${input.module}/${input.id}/Notes?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET'));
2470
+ return getRelatedRecordsFunctionFactory(context)({
2471
+ targetModule: 'Notes'
2472
+ });
2402
2473
  }
2403
2474
  function getNotesForRecordPageFactory(context) {
2404
2475
  return zohoFetchPageFactory(getNotesForRecord(context));
@@ -2479,12 +2550,32 @@ function zohoRecruitApiFetchJsonInput(method, body) {
2479
2550
  };
2480
2551
  return result;
2481
2552
  }
2553
+ function zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs(response) {
2554
+ const {
2555
+ data
2556
+ } = response;
2557
+ const successItems = [];
2558
+ const errorItems = [];
2559
+ data.forEach(x => {
2560
+ if (x.status === ZOHO_SUCCESS_STATUS) {
2561
+ successItems.push(x);
2562
+ } else {
2563
+ errorItems.push(x);
2564
+ }
2565
+ });
2566
+ const result = {
2567
+ ...response,
2568
+ successItems,
2569
+ errorItems
2570
+ };
2571
+ return result;
2572
+ }
2482
2573
  function zohoRecruitMultiRecordResult(input, results) {
2483
2574
  const successItems = [];
2484
2575
  const errorItems = [];
2485
2576
  input.forEach((x, i) => {
2486
2577
  const result = results[i];
2487
- if (result.status === 'success') {
2578
+ if (result.status === ZOHO_SUCCESS_STATUS) {
2488
2579
  successItems.push({
2489
2580
  input: x,
2490
2581
  result: result
@@ -2503,6 +2594,80 @@ function zohoRecruitMultiRecordResult(input, results) {
2503
2594
  return result;
2504
2595
  }
2505
2596
 
2597
+ /**
2598
+ * Candidates module name
2599
+ */
2600
+ const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
2601
+ /**
2602
+ * Job Openings module name
2603
+ */
2604
+ const ZOHO_RECRUIT_JOB_OPENINGS_MODULE = 'Job_Openings';
2605
+ /**
2606
+ * Returns true if it is a valid ZohoRecruitValidUrl.
2607
+ */
2608
+ const isZohoRecruitValidUrl = isStandardInternetAccessibleWebsiteUrl;
2609
+
2610
+ /**
2611
+ * Associates one or more candidates with one or more job openings.
2612
+ *
2613
+ * https://www.zoho.com/recruit/developer-guide/apiv2/associate-candidate.html
2614
+ *
2615
+ * @param context
2616
+ * @returns
2617
+ */
2618
+ function associateCandidateRecordsWithJobOpenings(context) {
2619
+ return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_CANDIDATES_MODULE}/actions/associate`, zohoRecruitApiFetchJsonInput('PUT', {
2620
+ data: asArray(input)
2621
+ })).then(x => {
2622
+ const resultInputMap = x.data.map(() => input); // assign "input" to each value for now
2623
+ const result = zohoRecruitMultiRecordResult(resultInputMap, x.data);
2624
+ const {
2625
+ included: alreadyAssociatedErrorItems,
2626
+ excluded: otherErrorItems
2627
+ } = separateValues(result.errorItems, x => {
2628
+ return x.result.code === ZOHO_FAILURE_ERROR_CODE && x.result.details.error[0].code === ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
2629
+ });
2630
+ return {
2631
+ ...result,
2632
+ errorItems: otherErrorItems,
2633
+ alreadyAssociatedErrorItems,
2634
+ allErrorItems: result.errorItems
2635
+ };
2636
+ });
2637
+ }
2638
+ function searchAssociatedRecords(context) {
2639
+ return input => {
2640
+ return context.fetchJson(`/v2/${input.module}/${input.id}/associate?${zohoRecruitUrlSearchParamsMinusIdAndModule(input).toString()}`, zohoRecruitApiFetchJsonInput('GET')).then(x => {
2641
+ const result = x ?? emptyZohoPageResult();
2642
+ return result;
2643
+ });
2644
+ };
2645
+ }
2646
+ function searchCandidateAssociatedJobOpeningRecords(context) {
2647
+ const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2648
+ return input => {
2649
+ return searchAssociatedRecordsFactory({
2650
+ ...input,
2651
+ module: ZOHO_RECRUIT_CANDIDATES_MODULE
2652
+ });
2653
+ };
2654
+ }
2655
+ function searchCandidateAssociatedJobOpeningRecordsPageFactory(context) {
2656
+ return zohoFetchPageFactory(searchCandidateAssociatedJobOpeningRecords(context));
2657
+ }
2658
+ function searchJobOpeningAssociatedCandidateRecords(context, jobOpeningModuleName = ZOHO_RECRUIT_JOB_OPENINGS_MODULE) {
2659
+ const searchAssociatedRecordsFactory = searchAssociatedRecords(context);
2660
+ return input => {
2661
+ return searchAssociatedRecordsFactory({
2662
+ ...input,
2663
+ module: jobOpeningModuleName
2664
+ });
2665
+ };
2666
+ }
2667
+ function searchJobOpeningAssociatedCandidateRecordsPageFactory(context) {
2668
+ return zohoFetchPageFactory(searchJobOpeningAssociatedCandidateRecords(context));
2669
+ }
2670
+
2506
2671
  /**
2507
2672
  * Creates a ZohoRecruitSearchRecordsCriteriaEntryArray from an array of emails.
2508
2673
  *
@@ -2701,15 +2866,6 @@ function zohoRecruitFactory(factoryConfig) {
2701
2866
  };
2702
2867
  }
2703
2868
 
2704
- /**
2705
- * Candidates module name
2706
- */
2707
- const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
2708
- /**
2709
- * Returns true if it is a valid ZohoRecruitValidUrl.
2710
- */
2711
- const isZohoRecruitValidUrl = isStandardInternetAccessibleWebsiteUrl;
2712
-
2713
2869
  /**
2714
2870
  * Trades a refresh token for a new AccessToken
2715
2871
  * @param context
@@ -2878,4 +3034,4 @@ function zohoDateTimeString(date) {
2878
3034
  return isoDate.substring(0, isoDate.length - 5) + 'Z';
2879
3035
  }
2880
3036
 
2881
- export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA, ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE, ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE, ZOHO_ACCOUNTS_US_API_URL, ZOHO_DUPLICATE_DATA_ERROR_CODE, ZOHO_INTERNAL_ERROR_CODE, ZOHO_INVALID_AUTHORIZATION_ERROR_CODE, ZOHO_INVALID_DATA_ERROR_CODE, ZOHO_INVALID_QUERY_ERROR_CODE, ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE, ZOHO_RATE_LIMIT_LIMIT_HEADER, ZOHO_RATE_LIMIT_REMAINING_HEADER, ZOHO_RATE_LIMIT_RESET_HEADER, ZOHO_RECRUIT_CANDIDATES_MODULE, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_SUCCESS_CODE, ZOHO_TOO_MANY_REQUESTS_ERROR_CODE, ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZohoAccountsAccessTokenError, ZohoAccountsAuthFailureError, ZohoInternalError, ZohoInvalidAuthorizationError, ZohoInvalidQueryError, ZohoRecruitExecuteRestApiFunctionError, ZohoRecruitRecordCrudDuplicateDataError, ZohoRecruitRecordCrudError, ZohoRecruitRecordCrudInvalidDataError, ZohoRecruitRecordCrudMandatoryFieldNotFoundError, ZohoRecruitRecordCrudNoMatchingRecordError, ZohoRecruitRecordNoContentError, ZohoServerError, ZohoServerFetchResponseError, ZohoTooManyRequestsError, accessToken, assertRecordDataArrayResultHasContent, createNotes, createNotesForRecord, deleteNotes, escapeZohoFieldValueForCriteriaString, executeRestApiFunction, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, handleZohoAccountsErrorFetch, handleZohoErrorFetchFactory, handleZohoRecruitErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, isZohoRecruitValidUrl, logZohoAccountsErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, safeZohoDateTimeString, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsApiFetchJsonInput, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsZohoAccessTokenFactory, zohoDateTimeString, zohoFetchPageFactory, zohoRateLimitHeaderDetails, zohoRateLimitedFetchHandler, zohoRecruitApiFetchJsonInput, zohoRecruitConfigApiUrl, zohoRecruitFactory, zohoRecruitMultiRecordResult, zohoRecruitRecordCrudError, zohoRecruitSearchRecordsCriteriaEntriesForEmails, zohoRecruitSearchRecordsCriteriaEntryToCriteriaString, zohoRecruitSearchRecordsCriteriaString, zohoRecruitSearchRecordsCriteriaStringForTree, zohoRecruitUrlSearchParams, zohoRecruitUrlSearchParamsMinusIdAndModule, zohoRecruitUrlSearchParamsMinusModule, zohoServerErrorData };
3037
+ export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA, ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE, ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE, ZOHO_ACCOUNTS_US_API_URL, ZOHO_DUPLICATE_DATA_ERROR_CODE, ZOHO_ERROR_STATUS, ZOHO_FAILURE_ERROR_CODE, ZOHO_INTERNAL_ERROR_CODE, ZOHO_INVALID_AUTHORIZATION_ERROR_CODE, ZOHO_INVALID_DATA_ERROR_CODE, ZOHO_INVALID_QUERY_ERROR_CODE, ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE, ZOHO_RATE_LIMIT_LIMIT_HEADER, ZOHO_RATE_LIMIT_REMAINING_HEADER, ZOHO_RATE_LIMIT_RESET_HEADER, ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE, ZOHO_RECRUIT_CANDIDATES_MODULE, ZOHO_RECRUIT_JOB_OPENINGS_MODULE, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_SUCCESS_CODE, ZOHO_SUCCESS_STATUS, ZOHO_TOO_MANY_REQUESTS_ERROR_CODE, ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZohoAccountsAccessTokenError, ZohoAccountsAuthFailureError, ZohoInternalError, ZohoInvalidAuthorizationError, ZohoInvalidQueryError, ZohoRecruitExecuteRestApiFunctionError, ZohoRecruitRecordCrudDuplicateDataError, ZohoRecruitRecordCrudError, ZohoRecruitRecordCrudInvalidDataError, ZohoRecruitRecordCrudMandatoryFieldNotFoundError, ZohoRecruitRecordCrudNoMatchingRecordError, ZohoRecruitRecordNoContentError, ZohoServerError, ZohoServerFetchResponseError, ZohoTooManyRequestsError, accessToken, assertRecordDataArrayResultHasContent, associateCandidateRecordsWithJobOpenings, createNotes, createNotesForRecord, deleteNotes, deleteRecord, emptyZohoPageResult, escapeZohoFieldValueForCriteriaString, executeRestApiFunction, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, handleZohoAccountsErrorFetch, handleZohoErrorFetchFactory, handleZohoRecruitErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, isZohoRecruitValidUrl, logZohoAccountsErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, safeZohoDateTimeString, searchAssociatedRecords, searchCandidateAssociatedJobOpeningRecords, searchCandidateAssociatedJobOpeningRecordsPageFactory, searchJobOpeningAssociatedCandidateRecords, searchJobOpeningAssociatedCandidateRecordsPageFactory, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsApiFetchJsonInput, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsZohoAccessTokenFactory, zohoDateTimeString, zohoFetchPageFactory, zohoRateLimitHeaderDetails, zohoRateLimitedFetchHandler, zohoRecruitApiFetchJsonInput, zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs, zohoRecruitConfigApiUrl, zohoRecruitFactory, zohoRecruitMultiRecordResult, zohoRecruitRecordCrudError, zohoRecruitSearchRecordsCriteriaEntriesForEmails, zohoRecruitSearchRecordsCriteriaEntryToCriteriaString, zohoRecruitSearchRecordsCriteriaString, zohoRecruitSearchRecordsCriteriaStringForTree, zohoRecruitUrlSearchParams, zohoRecruitUrlSearchParamsMinusIdAndModule, zohoRecruitUrlSearchParamsMinusModule, zohoServerErrorData };
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [12.1.12](https://github.com/dereekb/dbx-components/compare/v12.1.11...v12.1.12) (2025-06-19)
6
+
7
+
8
+
9
+ ## [12.1.11](https://github.com/dereekb/dbx-components/compare/v12.1.10...v12.1.11) (2025-06-17)
10
+
11
+
12
+
5
13
  ## [12.1.10](https://github.com/dereekb/dbx-components/compare/v12.1.9...v12.1.10) (2025-06-13)
6
14
 
7
15
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho/nestjs",
3
- "version": "12.1.10",
3
+ "version": "12.1.12",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "main": "./src/index.js"
@@ -29,7 +29,7 @@ export declare function mergeZohoAccountsAccessTokenCacheServices(inputServicesT
29
29
  *
30
30
  * @returns
31
31
  */
32
- export declare function memoryZohoAccountsAccessTokenCacheService(existingCache?: ZohoAccountsAccessTokenCacheRecord): ZohoAccountsAccessTokenCacheService;
32
+ export declare function memoryZohoAccountsAccessTokenCacheService(existingCache?: ZohoAccountsAccessTokenCacheRecord, logAccessToConsole?: boolean): ZohoAccountsAccessTokenCacheService;
33
33
  export interface FileSystemZohoAccountsAccessTokenCacheService extends ZohoAccountsAccessTokenCacheService {
34
34
  readTokenFile(): Promise<Maybe<ZohoAccountsAccessTokenCacheRecord>>;
35
35
  writeTokenFile(tokens: ZohoAccountsAccessTokenCacheRecord): Promise<void>;
@@ -89,18 +89,22 @@ function mergeZohoAccountsAccessTokenCacheServices(inputServicesToMerge, logErro
89
89
  *
90
90
  * @returns
91
91
  */
92
- function memoryZohoAccountsAccessTokenCacheService(existingCache) {
92
+ function memoryZohoAccountsAccessTokenCacheService(existingCache, logAccessToConsole) {
93
93
  const tokens = existingCache ?? {};
94
94
  function loadZohoAccessTokenCache(service) {
95
95
  const accessTokenCache = {
96
96
  loadCachedToken: async function () {
97
97
  const token = tokens[service];
98
- console.log('retrieving access token from memory: ', { token, service });
98
+ if (logAccessToConsole) {
99
+ console.log('retrieving access token from memory: ', { token, service });
100
+ }
99
101
  return token;
100
102
  },
101
103
  updateCachedToken: async function (accessToken) {
102
104
  tokens[service] = accessToken;
103
- console.log('updating access token in memory: ', { accessToken, service });
105
+ if (logAccessToConsole) {
106
+ console.log('updating access token in memory: ', { accessToken, service });
107
+ }
104
108
  }
105
109
  };
106
110
  return accessTokenCache;
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.service.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/accounts/accounts.service.ts"],"names":[],"mappings":";;;AAuBA,4HAKC;AAWD,8FA+DC;AAQD,8FAsBC;AAkBD,0FAyGC;;AA/PD,2CAA4C;AAE5C,wCAAsI;AACtI,+BAA+B;AAC/B,2BAAwD;AAIxD;;GAEG;AAEI,IAAe,mCAAmC,GAAlD,MAAe,mCAAmC;CAOxD,C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,OAAO;QACL,wBAAwB;QACxB,aAAa;QACb,cAAc;QACd,eAAe;KAChB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"accounts.service.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/accounts/accounts.service.ts"],"names":[],"mappings":";;;AAuBA,4HAKC;AAWD,8FA+DC;AAQD,8FA0BC;AAkBD,0FAyGC;;AAnQD,2CAA4C;AAE5C,wCAAsI;AACtI,+BAA+B;AAC/B,2BAAwD;AAIxD;;GAEG;AAEI,IAAe,mCAAmC,GAAlD,MAAe,mCAAmC;CAOxD,CAAA;AAPqB,kFAAmC;8CAAnC,mCAAmC;IADxD,IAAA,mBAAU,GAAE;GACS,mCAAmC,CAOxD;AAID,SAAgB,wDAAwD,CAAC,aAA2D;IAClI,OAAO,CAAC,IAAI,CAAC,gEAAgE,aAAa,CAAC,MAAM,UAAU,CAAC,CAAC;IAC7G,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,yCAAyC,CAAC,oBAA2D,EAAE,QAAoF;IACzM,MAAM,QAAQ,GAAG,CAAC,GAAG,oBAAoB,CAAC,CAAC;IAC3C,MAAM,gBAAgB,GAAG,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/J,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,OAAO,GAAwC;QACnD,wBAAwB,E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,OAAO,KAAK,CAAC;YACf,CAAC;YACD,iBAAiB,EAAE,KAAK,WAAW,WAA4B;gBAC7D,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;gBAElC,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC;gBAChC,CAAC;gBAED,4EAA4E;gBAE5E,IAAI,CAAC;oBACH,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;SACF,CAAC;QAEF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,OAAO;QACL,wBAAwB;QACxB,aAAa;QACb,cAAc;QACd,eAAe;KAChB,CAAC;AACJ,CAAC"}
@@ -11,6 +11,7 @@ export declare class ZohoRecruitApi {
11
11
  get insertRecord(): import("@dereekb/zoho").ZohoRecruitCreateRecordLikeFunction;
12
12
  get upsertRecord(): import("@dereekb/zoho").ZohoRecruitUpsertRecordLikeFunction;
13
13
  get updateRecord(): import("@dereekb/zoho").ZohoRecruitUpdateRecordLikeFunction;
14
+ get deleteRecord(): import("@dereekb/zoho").ZohoRecruitDeleteRecordFunction;
14
15
  get getRecordById(): import("@dereekb/zoho").ZohoRecruitGetRecordByIdFunction;
15
16
  get getRecords(): import("@dereekb/zoho").ZohoRecruitGetRecordsFunction;
16
17
  get searchRecords(): import("@dereekb/zoho").ZohoRecruitSearchRecordsFunction;
@@ -21,4 +22,9 @@ export declare class ZohoRecruitApi {
21
22
  get getNotesForRecord(): import("@dereekb/zoho").ZohoRecruitGetNotesForRecordFunction;
22
23
  get getNotesForRecordPageFactory(): import("@dereekb/zoho").GetNotesForRecordPageFactory;
23
24
  get executeRestApiFunction(): import("@dereekb/zoho").ZohoRecruitExecuteRestApiFunctionFunction;
25
+ get associateCandidateRecordsWithJobOpenings(): import("@dereekb/zoho").ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction;
26
+ get searchCandidateAssociatedJobOpeningRecords(): import("@dereekb/zoho").ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<import("@dereekb/zoho").ZohoRecruitRecord>;
27
+ get searchCandidateAssociatedJobOpeningRecordsPageFactory(): import("dist/packages/util/fetch/src").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
28
+ get searchJobOpeningAssociatedCandidateRecords(): import("@dereekb/zoho").ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<import("@dereekb/zoho").ZohoRecruitRecord>;
29
+ get searchJobOpeningAssociatedCandidateRecordsPageFactory(): import("dist/packages/util/fetch/src").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
24
30
  }
@@ -34,6 +34,9 @@ let ZohoRecruitApi = class ZohoRecruitApi {
34
34
  get updateRecord() {
35
35
  return (0, zoho_1.updateRecord)(this.recruitContext);
36
36
  }
37
+ get deleteRecord() {
38
+ return (0, zoho_1.deleteRecord)(this.recruitContext);
39
+ }
37
40
  get getRecordById() {
38
41
  return (0, zoho_1.getRecordById)(this.recruitContext);
39
42
  }
@@ -64,6 +67,21 @@ let ZohoRecruitApi = class ZohoRecruitApi {
64
67
  get executeRestApiFunction() {
65
68
  return (0, zoho_1.executeRestApiFunction)(this.recruitContext);
66
69
  }
70
+ get associateCandidateRecordsWithJobOpenings() {
71
+ return (0, zoho_1.associateCandidateRecordsWithJobOpenings)(this.recruitContext);
72
+ }
73
+ get searchCandidateAssociatedJobOpeningRecords() {
74
+ return (0, zoho_1.searchCandidateAssociatedJobOpeningRecords)(this.recruitContext);
75
+ }
76
+ get searchCandidateAssociatedJobOpeningRecordsPageFactory() {
77
+ return (0, zoho_1.searchCandidateAssociatedJobOpeningRecordsPageFactory)(this.recruitContext);
78
+ }
79
+ get searchJobOpeningAssociatedCandidateRecords() {
80
+ return (0, zoho_1.searchJobOpeningAssociatedCandidateRecords)(this.recruitContext);
81
+ }
82
+ get searchJobOpeningAssociatedCandidateRecordsPageFactory() {
83
+ return (0, zoho_1.searchJobOpeningAssociatedCandidateRecordsPageFactory)(this.recruitContext);
84
+ }
67
85
  };
68
86
  exports.ZohoRecruitApi = ZohoRecruitApi;
69
87
  exports.ZohoRecruitApi = ZohoRecruitApi = tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"recruit.api.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/recruit/recruit.api.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,wCAA2T;AAC3T,qDAA4D;AAC5D,2DAA2D;AAGpD,IAAM,cAAc,GAApB,MAAM,cAAc;IAYoB;IACT;IAZ3B,WAAW,CAAc;IAElC,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IACzC,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,eAAe,CAAC;IACzD,CAAC;IAED,YAC6C,MAAgC,EACzC,eAAgC;QADvB,WAAM,GAAN,MAAM,CAA0B;QACzC,oBAAe,GAAf,eAAe,CAAiB;QAElE,IAAI,CAAC,WAAW,GAAG,IAAA,yBAAkB,EAAC;YACpC,GAAG,MAAM,CAAC,aAAa;YACvB,eAAe,EAAE,eAAe,CAAC,eAAe;SACjD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC;IAED,kBAAkB;IAClB,IAAI,YAAY;QACd,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,Y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M,EAAC,8BAAe,CAAC,CAAA;6CAD2B,yCAAwB;QACxB,8BAAe;GAbzD,cAAc,CAyE1B"}
1
+ {"version":3,"file":"recruit.api.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/recruit/recruit.api.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,wCAuBuB;AACvB,qDAA4D;AAC5D,2DAA2D;AAGpD,IAAM,cAAc,GAApB,MAAM,cAAc;IAYoB;IACT;IAZ3B,WAAW,CAAc;IAElC,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IACzC,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,eAAe,CAAC;IACzD,CAAC;IAED,YAC6C,MAAgC,EACzC,eAAgC;QADvB,WAAM,GAAN,MAAM,CAA0B;QACzC,oBAAe,GAAf,eAAe,CAAiB;QAElE,IAAI,CAAC,WAAW,GAAG,IAAA,yBAAkB,EAAC;YACpC,GAAG,MAAM,CAAC,aAAa;YACvB,eAAe,EAAE,eAAe,CAAC,eAAe;SACjD,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC;IAED,kBAAkB;IAClB,IAAI,YAAY;QACd,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAA,mBAAY,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAA,oBAAa,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI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O,IAAA,4DAAqD,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACpF,CAAC;CACF,CAAA;AAjGY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAaR,mBAAA,IAAA,eAAM,EAAC,yCAAwB,CAAC,CAAA;IAChC,mBAAA,IAAA,eAAM,EAAC,8BAAe,CAAC,CAAA;6CAD2B,yCAAwB;QACxB,8BAAe;GAbzD,cAAc,CAiG1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho",
3
- "version": "12.1.10",
3
+ "version": "12.1.12",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  export * from './recruit.api';
2
+ export * from './recruit.api.candidates';
2
3
  export * from './recruit.config';
3
4
  export * from './recruit.criteria';
4
5
  export * from './recruit.criteria.util';
@@ -0,0 +1,69 @@
1
+ import { ZohoRecruitContext } from './recruit.config';
2
+ import { ArrayOrValue } from '@dereekb/util';
3
+ import { ZohoRecruitJobOpeningId, ZohoRecruitCandidateId, ZohoRecruitCandidateStatus, ZohoRecruitJobOpeningPostingTitle, ZohoRecruitModuleNameRef, ZohoRecruitRecord } from './recruit';
4
+ import { ZohoRecruitChangeObjectLikeResponse, ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta, ZohoRecruitChangeObjectResponseErrorEntry, ZohoRecruitGetRecordsPageFilter, ZohoRecruitMultiRecordResult, ZohoRecruitMultiRecordResultEntry, ZohoRecruitSearchRecordsResponse } from './recruit.api';
5
+ import { ZohoServerErrorDataWithDetails } from '../zoho.error.api';
6
+ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInput = ArrayOrValue<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInputData>;
7
+ export interface ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInputData {
8
+ readonly jobids: ZohoRecruitJobOpeningId[];
9
+ readonly ids: ZohoRecruitCandidateId[];
10
+ }
11
+ export interface ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResultDetails {
12
+ /**
13
+ * Job Opening id that was updated
14
+ */
15
+ readonly jobid: ZohoRecruitJobOpeningId;
16
+ /**
17
+ * Candidate ids that were associated with the job opening
18
+ */
19
+ readonly ids: ZohoRecruitCandidateId[];
20
+ }
21
+ export interface ZohoRecruitAssociateCandidateRecordsWithJobOpeningsSuccessEntry extends ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta {
22
+ readonly details: ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResultDetails;
23
+ }
24
+ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResponse = ZohoRecruitChangeObjectLikeResponse<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsSuccessEntry>;
25
+ export interface ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntryDetails extends ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResultDetails {
26
+ readonly error: ZohoServerErrorDataWithDetails[];
27
+ }
28
+ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntry = ZohoRecruitChangeObjectResponseErrorEntry & {
29
+ readonly details: ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntryDetails;
30
+ };
31
+ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResult = ZohoRecruitMultiRecordResult<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInput, ZohoRecruitAssociateCandidateRecordsWithJobOpeningsSuccessEntry, ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntry> & {
32
+ /**
33
+ * List of items that are already associated with the job opening
34
+ */
35
+ readonly alreadyAssociatedErrorItems: ZohoRecruitMultiRecordResultEntry<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInput, ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntry>[];
36
+ readonly allErrorItems: ZohoRecruitMultiRecordResultEntry<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInput, ZohoRecruitAssociateCandidateRecordsWithJobOpeningsErrorEntry>[];
37
+ };
38
+ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction = (input: ZohoRecruitAssociateCandidateRecordsWithJobOpeningsInput) => Promise<ZohoRecruitAssociateCandidateRecordsWithJobOpeningsResult>;
39
+ /**
40
+ * Associates one or more candidates with one or more job openings.
41
+ *
42
+ * https://www.zoho.com/recruit/developer-guide/apiv2/associate-candidate.html
43
+ *
44
+ * @param context
45
+ * @returns
46
+ */
47
+ export declare function associateCandidateRecordsWithJobOpenings(context: ZohoRecruitContext): ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction;
48
+ export interface ZohoRecruitSearchAssociatedRecordsInput extends ZohoRecruitModuleNameRef, ZohoRecruitGetRecordsPageFilter {
49
+ readonly id: ZohoRecruitCandidateId | ZohoRecruitJobOpeningId;
50
+ /**
51
+ * Posting title to filter associated Job Openings by
52
+ */
53
+ readonly posting_title?: ZohoRecruitJobOpeningPostingTitle;
54
+ /**
55
+ * Candidate statuses to filter associated Candidates by
56
+ */
57
+ readonly candidate_statuses?: ZohoRecruitCandidateStatus;
58
+ }
59
+ export type ZohoRecruitSearchAssociatedRecordsResponse<T = ZohoRecruitRecord> = ZohoRecruitSearchRecordsResponse<T>;
60
+ export type ZohoRecruitSearchAssociatedRecordsFunction<R extends ZohoRecruitSearchAssociatedRecordsResponse> = (input: ZohoRecruitSearchAssociatedRecordsInput) => Promise<R>;
61
+ export declare function searchAssociatedRecords<R extends ZohoRecruitSearchAssociatedRecordsResponse>(context: ZohoRecruitContext): ZohoRecruitSearchAssociatedRecordsFunction<R>;
62
+ export type ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput = Omit<ZohoRecruitSearchAssociatedRecordsInput, 'module' | 'candidate_statuses'>;
63
+ export type ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<T extends ZohoRecruitRecord> = (input: ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput) => Promise<ZohoRecruitSearchAssociatedRecordsResponse<T>>;
64
+ export declare function searchCandidateAssociatedJobOpeningRecords<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<T>;
65
+ export declare function searchCandidateAssociatedJobOpeningRecordsPageFactory<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): import("dist/packages/util/fetch/src").FetchPageFactory<ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput, ZohoRecruitSearchAssociatedRecordsResponse<T>>;
66
+ export type ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput = Omit<ZohoRecruitSearchAssociatedRecordsInput, 'module' | 'posting_title'>;
67
+ export type ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<T extends ZohoRecruitRecord> = (input: ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput) => Promise<ZohoRecruitSearchAssociatedRecordsResponse<T>>;
68
+ export declare function searchJobOpeningAssociatedCandidateRecords<T extends ZohoRecruitRecord>(context: ZohoRecruitContext, jobOpeningModuleName?: string): ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<T>;
69
+ export declare function searchJobOpeningAssociatedCandidateRecordsPageFactory<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): import("dist/packages/util/fetch/src").FetchPageFactory<ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput, ZohoRecruitSearchAssociatedRecordsResponse<T>>;
@@ -1,7 +1,7 @@
1
1
  import { ZohoDataArrayResultRef, ZohoPageFilter, ZohoPageResult } from './../zoho.api.page';
2
2
  import { FetchJsonBody, FetchJsonInput, FetchPage, FetchPageFactory, FetchPageFactoryOptions, makeUrlSearchParams } from '@dereekb/util/fetch';
3
3
  import { ZohoRecruitConfigApiUrlInput, ZohoRecruitContext } from './recruit.config';
4
- import { NewZohoRecruitNoteData, ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitRecordNote, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitNoteId, ZohoRecruitRestFunctionApiName, ZohoRecruitUserId } from './recruit';
4
+ import { NewZohoRecruitNoteData, ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitRecordNote, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitNoteId, ZohoRecruitRestFunctionApiName, ZohoRecruitUserId, ZohoRecruitModuleName } from './recruit';
5
5
  import { ZohoRecruitSearchRecordsCriteriaTreeElement } from './recruit.criteria';
6
6
  import { ArrayOrValue, EmailAddress, Maybe, PhoneNumber, SortingOrder, UniqueModelWithId } from '@dereekb/util';
7
7
  import { ZohoServerErrorDataWithDetails, ZohoServerErrorStatus, ZohoServerSuccessCode, ZohoServerSuccessStatus } from '../zoho.error.api';
@@ -73,6 +73,30 @@ export type ZohoRecruitUpdateRecordFunction = ZohoRecruitUpdateRecordLikeFunctio
73
73
  * @returns
74
74
  */
75
75
  export declare function updateRecord(context: ZohoRecruitContext): ZohoRecruitUpdateRecordFunction;
76
+ export type ZohoRecruitDeleteRecordFunction = (input: ZohoRecruitDeleteRecordInput) => Promise<ZohoRecruitDeleteRecordResponse>;
77
+ export interface ZohoRecruitDeleteRecordInput extends ZohoRecruitModuleNameRef {
78
+ /**
79
+ * Id or array of ids to delete.
80
+ */
81
+ readonly ids: ArrayOrValue<ZohoRecruitRecordId>;
82
+ readonly wf_trigger?: boolean;
83
+ }
84
+ export interface ZohoRecruitDeleteRecordResponseSuccessEntry extends ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta {
85
+ readonly details: {
86
+ readonly id: ZohoRecruitRecordId;
87
+ };
88
+ }
89
+ export type ZohoRecruitDeleteRecordResponse = ZohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs<ZohoRecruitDeleteRecordResponseSuccessEntry>;
90
+ export type ZohoRecruitDeleteRecordResult = ZohoRecruitChangeObjectResponseSuccessEntry[];
91
+ /**
92
+ * Deletes one or more records from the given module.
93
+ *
94
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-records.html
95
+ *
96
+ * @param context
97
+ * @returns ZohoRecruitDeleteRecordFunction
98
+ */
99
+ export declare function deleteRecord(context: ZohoRecruitContext): ZohoRecruitDeleteRecordFunction;
76
100
  export interface ZohoRecruitGetRecordByIdInput extends ZohoRecruitModuleNameRef {
77
101
  readonly id: ZohoRecruitRecordId;
78
102
  }
@@ -139,6 +163,34 @@ export type ZohoRecruitSearchRecordsFunction = <T = ZohoRecruitRecord>(input: Zo
139
163
  export declare function searchRecords(context: ZohoRecruitContext): ZohoRecruitSearchRecordsFunction;
140
164
  export type SearchRecordsPageFactory = <T = ZohoRecruitRecord>(input: ZohoRecruitSearchRecordsInput<T>, options?: Maybe<FetchPageFactoryOptions<ZohoRecruitSearchRecordsInput<T>, ZohoRecruitSearchRecordsResponse<T>>>) => FetchPage<ZohoRecruitSearchRecordsInput<T>, ZohoRecruitSearchRecordsResponse<T>>;
141
165
  export declare function searchRecordsPageFactory(context: ZohoRecruitContext): SearchRecordsPageFactory;
166
+ export interface ZohoRecruitGetRelatedRecordsFunctionConfig {
167
+ readonly targetModule: ZohoRecruitModuleName;
168
+ }
169
+ export type ZohoRecruitGetRelatedRecordsFunctionFactory = <T extends ZohoRecruitRecord>(input: ZohoRecruitGetRelatedRecordsFunctionConfig) => ZohoRecruitGetRelatedRecordsFunction<T>;
170
+ export type ZohoRecruitGetRelatedRecordsPageFilter = ZohoPageFilter;
171
+ export interface ZohoRecruitGetRelatedRecordsRequest extends ZohoRecruitGetRecordByIdInput, ZohoRecruitGetRelatedRecordsPageFilter {
172
+ /**
173
+ * Optional, Use to filter the related records of the primary/target record with said ids.
174
+ *
175
+ * For example, providing this value will return the Notes with these ids when searching on related Notes for the primary/target record.
176
+ */
177
+ readonly ids?: Maybe<ArrayOrValue<ZohoRecruitRecordId>>;
178
+ /**
179
+ * @deprecated set variables on request object directly instead of using this filter.
180
+ */
181
+ readonly filter?: Maybe<ZohoRecruitGetRelatedRecordsPageFilter>;
182
+ }
183
+ export type ZohoRecruitGetRelatedRecordsResponse<T = ZohoRecruitRecord> = ZohoPageResult<T>;
184
+ export type ZohoRecruitGetRelatedRecordsFunction<T = ZohoRecruitRecord> = (input: ZohoRecruitGetRelatedRecordsRequest) => Promise<ZohoRecruitGetRelatedRecordsResponse<T>>;
185
+ /**
186
+ * Creates a ZohoRecruitGetRelatedRecordsFunctionFactory, which can be used to create ZohoRecruitGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
187
+ *
188
+ * https://www.zoho.com/recruit/developer-guide/apiv2/get-related-records.html
189
+ *
190
+ * @param context the ZohoRecruitContext to use
191
+ * @returns a ZohoRecruitGetRelatedRecordsFunctionFactory
192
+ */
193
+ export declare function getRelatedRecordsFunctionFactory(context: ZohoRecruitContext): ZohoRecruitGetRelatedRecordsFunctionFactory;
142
194
  export interface ZohoRecruitCreateNotesRequest {
143
195
  readonly data: ZohoRecruitCreateNotesRequestEntry[];
144
196
  }
@@ -154,13 +206,7 @@ export type ZohoRecruitDeleteNotesResult = ZohoRecruitMultiRecordResult<ZohoRecr
154
206
  export type ZohoRecruitDeleteNotesResponse = ZohoRecruitChangeObjectResponse;
155
207
  export type ZohoRecruitDeleteNotesFunction = (input: ZohoRecruitDeleteNotesRequest) => Promise<ZohoRecruitDeleteNotesResult>;
156
208
  export declare function deleteNotes(context: ZohoRecruitContext): (input: ZohoRecruitDeleteNotesRequest) => Promise<ZohoRecruitMultiRecordResult<string, ZohoRecruitChangeObjectResponseSuccessEntry<ZohoRecruitChangeObjectDetails>, ZohoRecruitChangeObjectResponseErrorEntry>>;
157
- export type ZohoRecruitGetNotesPageFilter = ZohoPageFilter;
158
- export interface ZohoRecruitGetNotesForRecordRequest extends ZohoRecruitGetRecordByIdInput, ZohoRecruitGetNotesPageFilter {
159
- /**
160
- * @deprecated use variables on request instead of this filter.
161
- */
162
- readonly filter?: Maybe<ZohoRecruitGetNotesPageFilter>;
163
- }
209
+ export type ZohoRecruitGetNotesForRecordRequest = ZohoRecruitGetRelatedRecordsRequest;
164
210
  export type ZohoRecruitGetNotesForRecordResponse = ZohoPageResult<ZohoRecruitRecordNote>;
165
211
  export type ZohoRecruitGetNotesForRecordFunction = (input: ZohoRecruitGetNotesForRecordRequest) => Promise<ZohoRecruitGetNotesForRecordResponse>;
166
212
  export declare function getNotesForRecord(context: ZohoRecruitContext): ZohoRecruitGetNotesForRecordFunction;
@@ -236,14 +282,24 @@ export declare function zohoRecruitUrlSearchParamsMinusIdAndModule(...input: May
236
282
  */
237
283
  export declare const zohoRecruitUrlSearchParams: typeof makeUrlSearchParams;
238
284
  export declare function zohoRecruitApiFetchJsonInput(method: string, body?: Maybe<FetchJsonBody>): FetchJsonInput;
239
- export type ZohoRecruitChangeObjectResponse<T extends ZohoRecruitChangeObjectResponseEntry = ZohoRecruitChangeObjectResponseEntry> = ZohoDataArrayResultRef<T>;
240
- export type ZohoRecruitChangeObjectResponseEntry<E extends ZohoRecruitChangeObjectResponseSuccessEntry = ZohoRecruitChangeObjectResponseSuccessEntry> = E | ZohoRecruitChangeObjectResponseErrorEntry;
241
- export interface ZohoRecruitChangeObjectResponseSuccessEntry<D extends ZohoRecruitChangeObjectDetails = ZohoRecruitChangeObjectDetails> {
285
+ export type ZohoRecruitChangeObjectLikeResponse<T extends ZohoRecruitChangeObjectLikeResponseEntry = ZohoRecruitChangeObjectLikeResponseEntry> = ZohoDataArrayResultRef<T>;
286
+ export type ZohoRecruitChangeObjectLikeResponseEntry<E extends ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta = ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta> = E | ZohoRecruitChangeObjectResponseErrorEntry;
287
+ export type ZohoRecruitChangeObjectLikeResponseSuccessEntryType<T extends ZohoRecruitChangeObjectLikeResponseEntry> = T extends ZohoRecruitChangeObjectLikeResponseEntry<infer E> ? E : never;
288
+ export interface ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta {
242
289
  readonly code: ZohoServerSuccessCode;
243
- readonly details: D;
244
290
  readonly status: ZohoServerSuccessStatus;
245
291
  readonly message: string;
246
292
  }
293
+ export type ZohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs<T extends ZohoRecruitChangeObjectLikeResponseEntry> = ZohoRecruitChangeObjectLikeResponse<T> & {
294
+ readonly successItems: ZohoRecruitChangeObjectLikeResponseSuccessEntryType<T>[];
295
+ readonly errorItems: ZohoRecruitChangeObjectResponseErrorEntry[];
296
+ };
297
+ export declare function zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs<T extends ZohoRecruitChangeObjectLikeResponseEntry>(response: ZohoRecruitChangeObjectLikeResponse<T>): ZohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs<T>;
298
+ export type ZohoRecruitChangeObjectResponse<T extends ZohoRecruitChangeObjectResponseEntry = ZohoRecruitChangeObjectResponseEntry> = ZohoRecruitChangeObjectLikeResponse<T>;
299
+ export type ZohoRecruitChangeObjectResponseEntry<E extends ZohoRecruitChangeObjectResponseSuccessEntry = ZohoRecruitChangeObjectResponseSuccessEntry> = ZohoRecruitChangeObjectLikeResponseEntry<E>;
300
+ export interface ZohoRecruitChangeObjectResponseSuccessEntry<D extends ZohoRecruitChangeObjectDetails = ZohoRecruitChangeObjectDetails> extends ZohoRecruitChangeObjectLikeResponseSuccessEntryMeta {
301
+ readonly details: D;
302
+ }
247
303
  export interface ZohoRecruitChangeObjectResponseErrorEntry extends ZohoServerErrorDataWithDetails {
248
304
  readonly status: ZohoServerErrorStatus;
249
305
  }
@@ -265,3 +321,7 @@ export interface ZohoRecruitMultiRecordResultEntry<I, O> {
265
321
  */
266
322
  readonly result: O;
267
323
  }
324
+ /**
325
+ * @deprecated use ZohoRecruitGetRelatedRecordsPageFilter instead.
326
+ */
327
+ export type ZohoRecruitGetNotesPageFilter = ZohoRecruitGetRelatedRecordsPageFilter;
@@ -9,6 +9,10 @@ export type ZohoRecruitModuleName = string;
9
9
  * Candidates module name
10
10
  */
11
11
  export declare const ZOHO_RECRUIT_CANDIDATES_MODULE = "Candidates";
12
+ /**
13
+ * Job Openings module name
14
+ */
15
+ export declare const ZOHO_RECRUIT_JOB_OPENINGS_MODULE = "Job_Openings";
12
16
  /**
13
17
  * Contains a reference to a module.
14
18
  */
@@ -23,6 +27,14 @@ export type ZohoRecruitRestFunctionApiName = string;
23
27
  * An identifier in Zoho Recruit.
24
28
  */
25
29
  export type ZohoRecruitId = string;
30
+ /**
31
+ * Identifier of a Candidate record in Zoho Recruit.
32
+ */
33
+ export type ZohoRecruitCandidateId = string;
34
+ /**
35
+ * Identifier of a Job Opening record in Zoho Recruit.
36
+ */
37
+ export type ZohoRecruitJobOpeningId = string;
26
38
  /**
27
39
  * Zoho Recruit record id
28
40
  *
@@ -170,6 +182,14 @@ export type ZohoRecruitNoteFileSize = number;
170
182
  export interface ZohoRecruitNote extends ZohoRecruitNoteData, UniqueModelWithId {
171
183
  }
172
184
  export type ZohoRecruitRecordNote = ZohoRecruitNote;
185
+ /**
186
+ * The posting title of a job opening.
187
+ */
188
+ export type ZohoRecruitJobOpeningPostingTitle = string;
189
+ /**
190
+ * The status of a candidate.
191
+ */
192
+ export type ZohoRecruitCandidateStatus = string;
173
193
  /**
174
194
  * @deprecated use NewZohoRecruitNewNoteData instead.
175
195
  */
@@ -3,6 +3,12 @@ import { BaseError } from 'make-error';
3
3
  import { ZohoServerErrorDataWithDetails, ZohoServerErrorResponseData, ZohoServerError, ParsedZohoServerError } from '../zoho.error.api';
4
4
  import { ZohoRecruitModuleName, ZohoRecruitRecordId } from './recruit';
5
5
  import { ZohoDataArrayResultRef } from '../zoho.api.page';
6
+ /**
7
+ * Error code for when two records are already associated with each other.
8
+ *
9
+ * Example being a candidate and a job opening are already associated.
10
+ */
11
+ export declare const ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = "ALREADY_ASSOCIATED";
6
12
  /**
7
13
  * Thrown when a record with the given id has no content. Typically also means it does not exist.
8
14
  */
@@ -22,6 +22,10 @@ export interface ZohoPageResult<T, I extends ZohoPageResultInfo = ZohoPageResult
22
22
  */
23
23
  readonly info: I;
24
24
  }
25
+ /**
26
+ * Returns an empty ZohoPageResult that is typed to R and has no more records/results.
27
+ */
28
+ export declare function emptyZohoPageResult<T = unknown>(): ZohoPageResult<T>;
25
29
  /**
26
30
  * Page information within a ZohoPageResult
27
31
  */
@@ -9,10 +9,18 @@ export interface ZohoServerErrorResponseData {
9
9
  * A code used in some cases to denote success.
10
10
  */
11
11
  export declare const ZOHO_SUCCESS_CODE = "SUCCESS";
12
+ /**
13
+ * Lowercase status code
14
+ */
15
+ export declare const ZOHO_SUCCESS_STATUS = "success";
16
+ /**
17
+ * Set in the status field
18
+ */
19
+ export declare const ZOHO_ERROR_STATUS = "error";
12
20
  export type ZohoServerSuccessCode = typeof ZOHO_SUCCESS_CODE;
13
- export type ZohoServerSuccessStatus = 'success';
21
+ export type ZohoServerSuccessStatus = typeof ZOHO_SUCCESS_STATUS;
14
22
  export type ZohoServerErrorCode = string;
15
- export type ZohoServerErrorStatus = 'error';
23
+ export type ZohoServerErrorStatus = typeof ZOHO_ERROR_STATUS;
16
24
  /**
17
25
  * Zoho Server Error Data
18
26
  *
@@ -82,6 +90,10 @@ export declare function interceptZohoErrorResponseFactory(parseZohoServerErrorRe
82
90
  * - An extra parameter is provided
83
91
  */
84
92
  export declare const ZOHO_INTERNAL_ERROR_CODE = "INTERNAL_ERROR";
93
+ /**
94
+ * Error code for when a failure occured for the given action
95
+ */
96
+ export declare const ZOHO_FAILURE_ERROR_CODE = "FAILURE";
85
97
  /**
86
98
  * Error when the Zoho API returns an internal error
87
99
  */