@dereekb/zoho 12.1.11 → 12.1.13
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 +266 -101
- package/index.esm.js +254 -103
- package/nestjs/CHANGELOG.md +8 -0
- package/nestjs/package.json +1 -1
- package/nestjs/src/lib/recruit/recruit.api.d.ts +12 -0
- package/nestjs/src/lib/recruit/recruit.api.js +21 -0
- package/nestjs/src/lib/recruit/recruit.api.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/recruit/index.d.ts +4 -0
- package/src/lib/recruit/recruit.api.d.ts +71 -30
- package/src/lib/recruit/recruit.api.notes.d.ts +34 -0
- package/src/lib/recruit/recruit.api.tags.d.ts +86 -0
- package/src/lib/recruit/recruit.d.ts +46 -51
- package/src/lib/recruit/recruit.notes.d.ts +48 -0
- package/src/lib/recruit/recruit.tags.d.ts +34 -0
- package/src/lib/zoho.error.api.d.ts +10 -2
package/index.cjs.js
CHANGED
|
@@ -1741,40 +1741,6 @@ $$2({ target: 'Iterator', proto: true, real: true }, {
|
|
|
1741
1741
|
}
|
|
1742
1742
|
});
|
|
1743
1743
|
|
|
1744
|
-
var call$2 = functionCall;
|
|
1745
|
-
var aCallable$1 = aCallable$7;
|
|
1746
|
-
var anObject$2 = anObject$e;
|
|
1747
|
-
var getIteratorDirect$2 = getIteratorDirect$5;
|
|
1748
|
-
var createIteratorProxy$1 = iteratorCreateProxy;
|
|
1749
|
-
var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
|
|
1750
|
-
|
|
1751
|
-
var IteratorProxy$1 = createIteratorProxy$1(function () {
|
|
1752
|
-
var iterator = this.iterator;
|
|
1753
|
-
var result = anObject$2(call$2(this.next, iterator));
|
|
1754
|
-
var done = this.done = !!result.done;
|
|
1755
|
-
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
|
|
1756
|
-
});
|
|
1757
|
-
|
|
1758
|
-
// `Iterator.prototype.map` method
|
|
1759
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1760
|
-
var iteratorMap = function map(mapper) {
|
|
1761
|
-
anObject$2(this);
|
|
1762
|
-
aCallable$1(mapper);
|
|
1763
|
-
return new IteratorProxy$1(getIteratorDirect$2(this), {
|
|
1764
|
-
mapper: mapper
|
|
1765
|
-
});
|
|
1766
|
-
};
|
|
1767
|
-
|
|
1768
|
-
var $$1 = _export;
|
|
1769
|
-
var map = iteratorMap;
|
|
1770
|
-
var IS_PURE$1 = isPure;
|
|
1771
|
-
|
|
1772
|
-
// `Iterator.prototype.map` method
|
|
1773
|
-
// https://github.com/tc39/proposal-iterator-helpers
|
|
1774
|
-
$$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
|
|
1775
|
-
map: map
|
|
1776
|
-
});
|
|
1777
|
-
|
|
1778
1744
|
/**
|
|
1779
1745
|
* Returns an empty ZohoPageResult that is typed to R and has no more records/results.
|
|
1780
1746
|
*/
|
|
@@ -1828,40 +1794,61 @@ function zohoRecruitConfigApiUrl(input) {
|
|
|
1828
1794
|
}
|
|
1829
1795
|
}
|
|
1830
1796
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1797
|
+
/**
|
|
1798
|
+
* Candidates module name
|
|
1799
|
+
*/
|
|
1800
|
+
const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
|
|
1801
|
+
/**
|
|
1802
|
+
* Job Openings module name
|
|
1803
|
+
*/
|
|
1804
|
+
const ZOHO_RECRUIT_JOB_OPENINGS_MODULE = 'Job_Openings';
|
|
1805
|
+
/**
|
|
1806
|
+
* Notes module name
|
|
1807
|
+
*/
|
|
1808
|
+
const ZOHO_RECRUIT_NOTES_MODULE = 'Notes';
|
|
1809
|
+
/**
|
|
1810
|
+
* Emails module name
|
|
1811
|
+
*/
|
|
1812
|
+
const ZOHO_RECRUIT_EMAILS_MODULE = 'Emails';
|
|
1813
|
+
/**
|
|
1814
|
+
* Returns true if it is a valid ZohoRecruitValidUrl.
|
|
1815
|
+
*/
|
|
1816
|
+
const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
|
|
1817
|
+
|
|
1818
|
+
var call$2 = functionCall;
|
|
1819
|
+
var anObject$2 = anObject$e;
|
|
1820
|
+
var getIteratorDirect$2 = getIteratorDirect$5;
|
|
1834
1821
|
var getIteratorMethod = getIteratorMethod$3;
|
|
1835
1822
|
|
|
1836
1823
|
var getIteratorFlattenable$1 = function (obj, stringHandling) {
|
|
1837
|
-
if (!stringHandling || typeof obj !== 'string') anObject$
|
|
1824
|
+
if (!stringHandling || typeof obj !== 'string') anObject$2(obj);
|
|
1838
1825
|
var method = getIteratorMethod(obj);
|
|
1839
|
-
return getIteratorDirect$
|
|
1826
|
+
return getIteratorDirect$2(anObject$2(method !== undefined ? call$2(method, obj) : obj));
|
|
1840
1827
|
};
|
|
1841
1828
|
|
|
1842
|
-
var
|
|
1843
|
-
var call = functionCall;
|
|
1844
|
-
var aCallable = aCallable$7;
|
|
1845
|
-
var anObject = anObject$e;
|
|
1846
|
-
var getIteratorDirect = getIteratorDirect$5;
|
|
1829
|
+
var $$1 = _export;
|
|
1830
|
+
var call$1 = functionCall;
|
|
1831
|
+
var aCallable$1 = aCallable$7;
|
|
1832
|
+
var anObject$1 = anObject$e;
|
|
1833
|
+
var getIteratorDirect$1 = getIteratorDirect$5;
|
|
1847
1834
|
var getIteratorFlattenable = getIteratorFlattenable$1;
|
|
1848
|
-
var createIteratorProxy = iteratorCreateProxy;
|
|
1835
|
+
var createIteratorProxy$1 = iteratorCreateProxy;
|
|
1849
1836
|
var iteratorClose = iteratorClose$4;
|
|
1850
|
-
var IS_PURE = isPure;
|
|
1837
|
+
var IS_PURE$1 = isPure;
|
|
1851
1838
|
|
|
1852
|
-
var IteratorProxy = createIteratorProxy(function () {
|
|
1839
|
+
var IteratorProxy$1 = createIteratorProxy$1(function () {
|
|
1853
1840
|
var iterator = this.iterator;
|
|
1854
1841
|
var mapper = this.mapper;
|
|
1855
1842
|
var result, inner;
|
|
1856
1843
|
|
|
1857
1844
|
while (true) {
|
|
1858
1845
|
if (inner = this.inner) try {
|
|
1859
|
-
result = anObject(call(inner.next, inner.iterator));
|
|
1846
|
+
result = anObject$1(call$1(inner.next, inner.iterator));
|
|
1860
1847
|
if (!result.done) return result.value;
|
|
1861
1848
|
this.inner = null;
|
|
1862
1849
|
} catch (error) { iteratorClose(iterator, 'throw', error); }
|
|
1863
1850
|
|
|
1864
|
-
result = anObject(call(this.next, iterator));
|
|
1851
|
+
result = anObject$1(call$1(this.next, iterator));
|
|
1865
1852
|
|
|
1866
1853
|
if (this.done = !!result.done) return;
|
|
1867
1854
|
|
|
@@ -1873,17 +1860,51 @@ var IteratorProxy = createIteratorProxy(function () {
|
|
|
1873
1860
|
|
|
1874
1861
|
// `Iterator.prototype.flatMap` method
|
|
1875
1862
|
// https://github.com/tc39/proposal-iterator-helpers
|
|
1876
|
-
|
|
1863
|
+
$$1({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
|
|
1877
1864
|
flatMap: function flatMap(mapper) {
|
|
1878
|
-
anObject(this);
|
|
1879
|
-
aCallable(mapper);
|
|
1880
|
-
return new IteratorProxy(getIteratorDirect(this), {
|
|
1865
|
+
anObject$1(this);
|
|
1866
|
+
aCallable$1(mapper);
|
|
1867
|
+
return new IteratorProxy$1(getIteratorDirect$1(this), {
|
|
1881
1868
|
mapper: mapper,
|
|
1882
1869
|
inner: null
|
|
1883
1870
|
});
|
|
1884
1871
|
}
|
|
1885
1872
|
});
|
|
1886
1873
|
|
|
1874
|
+
var call = functionCall;
|
|
1875
|
+
var aCallable = aCallable$7;
|
|
1876
|
+
var anObject = anObject$e;
|
|
1877
|
+
var getIteratorDirect = getIteratorDirect$5;
|
|
1878
|
+
var createIteratorProxy = iteratorCreateProxy;
|
|
1879
|
+
var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
|
|
1880
|
+
|
|
1881
|
+
var IteratorProxy = createIteratorProxy(function () {
|
|
1882
|
+
var iterator = this.iterator;
|
|
1883
|
+
var result = anObject(call(this.next, iterator));
|
|
1884
|
+
var done = this.done = !!result.done;
|
|
1885
|
+
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
|
|
1886
|
+
});
|
|
1887
|
+
|
|
1888
|
+
// `Iterator.prototype.map` method
|
|
1889
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
1890
|
+
var iteratorMap = function map(mapper) {
|
|
1891
|
+
anObject(this);
|
|
1892
|
+
aCallable(mapper);
|
|
1893
|
+
return new IteratorProxy(getIteratorDirect(this), {
|
|
1894
|
+
mapper: mapper
|
|
1895
|
+
});
|
|
1896
|
+
};
|
|
1897
|
+
|
|
1898
|
+
var $ = _export;
|
|
1899
|
+
var map = iteratorMap;
|
|
1900
|
+
var IS_PURE = isPure;
|
|
1901
|
+
|
|
1902
|
+
// `Iterator.prototype.map` method
|
|
1903
|
+
// https://github.com/tc39/proposal-iterator-helpers
|
|
1904
|
+
$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
|
1905
|
+
map: map
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1887
1908
|
/**
|
|
1888
1909
|
* Can search up to 10 criteria at a time.
|
|
1889
1910
|
*
|
|
@@ -1974,6 +1995,14 @@ function zohoRecruitSearchRecordsCriteriaEntryToCriteriaString(entry) {
|
|
|
1974
1995
|
* A code used in some cases to denote success.
|
|
1975
1996
|
*/
|
|
1976
1997
|
const ZOHO_SUCCESS_CODE = 'SUCCESS';
|
|
1998
|
+
/**
|
|
1999
|
+
* Lowercase status code
|
|
2000
|
+
*/
|
|
2001
|
+
const ZOHO_SUCCESS_STATUS = 'success';
|
|
2002
|
+
/**
|
|
2003
|
+
* Set in the status field
|
|
2004
|
+
*/
|
|
2005
|
+
const ZOHO_ERROR_STATUS = 'error';
|
|
1977
2006
|
function zohoServerErrorData(error) {
|
|
1978
2007
|
const errorType = typeof error;
|
|
1979
2008
|
let errorData;
|
|
@@ -2354,6 +2383,26 @@ function upsertRecord(context) {
|
|
|
2354
2383
|
function updateRecord(context) {
|
|
2355
2384
|
return updateRecordLikeFunction(context, '', 'PUT');
|
|
2356
2385
|
}
|
|
2386
|
+
/**
|
|
2387
|
+
* Deletes one or more records from the given module.
|
|
2388
|
+
*
|
|
2389
|
+
* https://www.zoho.com/recruit/developer-guide/apiv2/delete-records.html
|
|
2390
|
+
*
|
|
2391
|
+
* @param context
|
|
2392
|
+
* @returns ZohoRecruitDeleteRecordFunction
|
|
2393
|
+
*/
|
|
2394
|
+
function deleteRecord(context) {
|
|
2395
|
+
return ({
|
|
2396
|
+
ids,
|
|
2397
|
+
module,
|
|
2398
|
+
wf_trigger
|
|
2399
|
+
}) => {
|
|
2400
|
+
return context.fetchJson(`/v2/${module}?${fetch.makeUrlSearchParams({
|
|
2401
|
+
ids,
|
|
2402
|
+
wf_trigger
|
|
2403
|
+
})}`, zohoRecruitApiFetchJsonInput('DELETE')).then(zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs);
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2357
2406
|
/**
|
|
2358
2407
|
* Retrieves a specific record from the given module.
|
|
2359
2408
|
*
|
|
@@ -2410,43 +2459,30 @@ function searchRecords(context) {
|
|
|
2410
2459
|
function searchRecordsPageFactory(context) {
|
|
2411
2460
|
return zohoFetchPageFactory(searchRecords(context));
|
|
2412
2461
|
}
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2462
|
+
/**
|
|
2463
|
+
* Creates a ZohoRecruitGetRelatedRecordsFunctionFactory, which can be used to create ZohoRecruitGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
|
|
2464
|
+
*
|
|
2465
|
+
* https://www.zoho.com/recruit/developer-guide/apiv2/get-related-records.html
|
|
2466
|
+
*
|
|
2467
|
+
* @param context the ZohoRecruitContext to use
|
|
2468
|
+
* @returns a ZohoRecruitGetRelatedRecordsFunctionFactory
|
|
2469
|
+
*/
|
|
2470
|
+
function getRelatedRecordsFunctionFactory(context) {
|
|
2471
|
+
return config => {
|
|
2472
|
+
const {
|
|
2473
|
+
targetModule,
|
|
2474
|
+
returnEmptyRecordsInsteadOfNull = true
|
|
2475
|
+
} = config;
|
|
2476
|
+
return input => context.fetchJson(`/v2/${input.module}/${input.id}/${targetModule}?${zohoRecruitUrlSearchParamsMinusIdAndModule(input, input.filter).toString()}`, zohoRecruitApiFetchJsonInput('GET')).then(x => x ?? (returnEmptyRecordsInsteadOfNull !== false ? emptyZohoPageResult() : x));
|
|
2477
|
+
};
|
|
2419
2478
|
}
|
|
2420
|
-
function
|
|
2421
|
-
return
|
|
2422
|
-
|
|
2423
|
-
})}`, zohoRecruitApiFetchJsonInput('DELETE')).then(x => {
|
|
2424
|
-
return zohoRecruitMultiRecordResult(util.asArray(input.ids), x.data);
|
|
2479
|
+
function getEmailsForRecord(context) {
|
|
2480
|
+
return getRelatedRecordsFunctionFactory(context)({
|
|
2481
|
+
targetModule: ZOHO_RECRUIT_EMAILS_MODULE
|
|
2425
2482
|
});
|
|
2426
2483
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return
|
|
2429
|
-
}
|
|
2430
|
-
function getNotesForRecordPageFactory(context) {
|
|
2431
|
-
return zohoFetchPageFactory(getNotesForRecord(context));
|
|
2432
|
-
}
|
|
2433
|
-
function createNotesForRecord(context) {
|
|
2434
|
-
const createNotesInstance = createNotes(context);
|
|
2435
|
-
return input => {
|
|
2436
|
-
const {
|
|
2437
|
-
module: se_module,
|
|
2438
|
-
id: Parent_Id,
|
|
2439
|
-
notes
|
|
2440
|
-
} = input;
|
|
2441
|
-
const createNotesRequest = {
|
|
2442
|
-
data: util.asArray(notes).map(x => ({
|
|
2443
|
-
...x,
|
|
2444
|
-
se_module,
|
|
2445
|
-
Parent_Id
|
|
2446
|
-
}))
|
|
2447
|
-
};
|
|
2448
|
-
return createNotesInstance(createNotesRequest);
|
|
2449
|
-
};
|
|
2484
|
+
function getEmailsForRecordPageFactory(context) {
|
|
2485
|
+
return zohoFetchPageFactory(getEmailsForRecord(context));
|
|
2450
2486
|
}
|
|
2451
2487
|
class ZohoRecruitExecuteRestApiFunctionError extends makeError.BaseError {
|
|
2452
2488
|
constructor(error) {
|
|
@@ -2506,12 +2542,32 @@ function zohoRecruitApiFetchJsonInput(method, body) {
|
|
|
2506
2542
|
};
|
|
2507
2543
|
return result;
|
|
2508
2544
|
}
|
|
2545
|
+
function zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs(response) {
|
|
2546
|
+
const {
|
|
2547
|
+
data
|
|
2548
|
+
} = response;
|
|
2549
|
+
const successItems = [];
|
|
2550
|
+
const errorItems = [];
|
|
2551
|
+
data.forEach(x => {
|
|
2552
|
+
if (x.status === ZOHO_SUCCESS_STATUS) {
|
|
2553
|
+
successItems.push(x);
|
|
2554
|
+
} else {
|
|
2555
|
+
errorItems.push(x);
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
const result = {
|
|
2559
|
+
...response,
|
|
2560
|
+
successItems,
|
|
2561
|
+
errorItems
|
|
2562
|
+
};
|
|
2563
|
+
return result;
|
|
2564
|
+
}
|
|
2509
2565
|
function zohoRecruitMultiRecordResult(input, results) {
|
|
2510
2566
|
const successItems = [];
|
|
2511
2567
|
const errorItems = [];
|
|
2512
2568
|
input.forEach((x, i) => {
|
|
2513
2569
|
const result = results[i];
|
|
2514
|
-
if (result.status ===
|
|
2570
|
+
if (result.status === ZOHO_SUCCESS_STATUS) {
|
|
2515
2571
|
successItems.push({
|
|
2516
2572
|
input: x,
|
|
2517
2573
|
result: result
|
|
@@ -2530,19 +2586,6 @@ function zohoRecruitMultiRecordResult(input, results) {
|
|
|
2530
2586
|
return result;
|
|
2531
2587
|
}
|
|
2532
2588
|
|
|
2533
|
-
/**
|
|
2534
|
-
* Candidates module name
|
|
2535
|
-
*/
|
|
2536
|
-
const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
|
|
2537
|
-
/**
|
|
2538
|
-
* Job Openings module name
|
|
2539
|
-
*/
|
|
2540
|
-
const ZOHO_RECRUIT_JOB_OPENINGS_MODULE = 'Job_Openings';
|
|
2541
|
-
/**
|
|
2542
|
-
* Returns true if it is a valid ZohoRecruitValidUrl.
|
|
2543
|
-
*/
|
|
2544
|
-
const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
|
|
2545
|
-
|
|
2546
2589
|
/**
|
|
2547
2590
|
* Associates one or more candidates with one or more job openings.
|
|
2548
2591
|
*
|
|
@@ -2604,6 +2647,109 @@ function searchJobOpeningAssociatedCandidateRecordsPageFactory(context) {
|
|
|
2604
2647
|
return zohoFetchPageFactory(searchJobOpeningAssociatedCandidateRecords(context));
|
|
2605
2648
|
}
|
|
2606
2649
|
|
|
2650
|
+
function createNotes(context) {
|
|
2651
|
+
return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_NOTES_MODULE}`, zohoRecruitApiFetchJsonInput('POST', {
|
|
2652
|
+
data: input.data
|
|
2653
|
+
})).then(x => {
|
|
2654
|
+
return zohoRecruitMultiRecordResult(util.asArray(input.data), x.data);
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
function deleteNotes(context) {
|
|
2658
|
+
return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_NOTES_MODULE}?${fetch.makeUrlSearchParams({
|
|
2659
|
+
ids: input.ids
|
|
2660
|
+
})}`, zohoRecruitApiFetchJsonInput('DELETE')).then(x => {
|
|
2661
|
+
return zohoRecruitMultiRecordResult(util.asArray(input.ids), x.data);
|
|
2662
|
+
});
|
|
2663
|
+
}
|
|
2664
|
+
function getNotesForRecord(context) {
|
|
2665
|
+
return getRelatedRecordsFunctionFactory(context)({
|
|
2666
|
+
targetModule: ZOHO_RECRUIT_NOTES_MODULE
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2669
|
+
function getNotesForRecordPageFactory(context) {
|
|
2670
|
+
return zohoFetchPageFactory(getNotesForRecord(context));
|
|
2671
|
+
}
|
|
2672
|
+
function createNotesForRecord(context) {
|
|
2673
|
+
const createNotesInstance = createNotes(context);
|
|
2674
|
+
return input => {
|
|
2675
|
+
const {
|
|
2676
|
+
module: se_module,
|
|
2677
|
+
id: Parent_Id,
|
|
2678
|
+
notes
|
|
2679
|
+
} = input;
|
|
2680
|
+
const createNotesRequest = {
|
|
2681
|
+
data: util.asArray(notes).map(x => ({
|
|
2682
|
+
...x,
|
|
2683
|
+
se_module,
|
|
2684
|
+
Parent_Id
|
|
2685
|
+
}))
|
|
2686
|
+
};
|
|
2687
|
+
return createNotesInstance(createNotesRequest);
|
|
2688
|
+
};
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
function createTagsForModule(context) {
|
|
2692
|
+
return input => context.fetchJson(`/v2/settings/tags?${fetch.makeUrlSearchParams({
|
|
2693
|
+
module: input.module
|
|
2694
|
+
})}`, zohoRecruitApiFetchJsonInput('POST', {
|
|
2695
|
+
tags: util.asArray(input.tags)
|
|
2696
|
+
})).then(x => {
|
|
2697
|
+
const result = zohoRecruitMultiRecordResult(util.asArray(input.tags), x.tags);
|
|
2698
|
+
const {
|
|
2699
|
+
included: duplicateErrorItems,
|
|
2700
|
+
excluded: otherErrorItems
|
|
2701
|
+
} = util.separateValues(result.errorItems, x => {
|
|
2702
|
+
return x.result.code === ZOHO_DUPLICATE_DATA_ERROR_CODE;
|
|
2703
|
+
});
|
|
2704
|
+
return {
|
|
2705
|
+
...result,
|
|
2706
|
+
errorItems: otherErrorItems,
|
|
2707
|
+
duplicateErrorItems,
|
|
2708
|
+
allErrorItems: result.errorItems
|
|
2709
|
+
};
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* Returns the list of tags within a module.
|
|
2714
|
+
*
|
|
2715
|
+
* https://www.zoho.com/recruit/developer-guide/apiv2/get-tag-list.html
|
|
2716
|
+
*
|
|
2717
|
+
* @param context
|
|
2718
|
+
* @returns
|
|
2719
|
+
*/
|
|
2720
|
+
function getTagsForModule(context) {
|
|
2721
|
+
return input => context.fetchJson(`/v2/settings/tags?${fetch.makeUrlSearchParams({
|
|
2722
|
+
module: input.module,
|
|
2723
|
+
my_tags: input.my_tags
|
|
2724
|
+
})}`, zohoRecruitApiFetchJsonInput('GET')).then(x => {
|
|
2725
|
+
// NOTE: This doesn't follow the api documentation, and instead is a normal page result except it has "tags" instead of "data".
|
|
2726
|
+
return {
|
|
2727
|
+
...x,
|
|
2728
|
+
data: x.tags
|
|
2729
|
+
};
|
|
2730
|
+
});
|
|
2731
|
+
}
|
|
2732
|
+
function getTagsForModulePageFactory(context) {
|
|
2733
|
+
return zohoFetchPageFactory(getTagsForModule(context));
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Associates one or more candidates with one or more job openings.
|
|
2737
|
+
*
|
|
2738
|
+
* https://www.zoho.com/recruit/developer-guide/apiv2/associate-candidate.html
|
|
2739
|
+
*
|
|
2740
|
+
* @param context
|
|
2741
|
+
* @returns
|
|
2742
|
+
*/
|
|
2743
|
+
function addTagsToRecords(context) {
|
|
2744
|
+
return input => context.fetchJson(`/v2/${ZOHO_RECRUIT_CANDIDATES_MODULE}/actions/add_tags?${fetch.makeUrlSearchParams({
|
|
2745
|
+
tag_names: input.tag_names,
|
|
2746
|
+
ids: input.ids
|
|
2747
|
+
})}`, zohoRecruitApiFetchJsonInput('POST')).then(x => {
|
|
2748
|
+
const resultInputMap = x.data.map(() => input); // assign "input" to each value for now
|
|
2749
|
+
return zohoRecruitMultiRecordResult(resultInputMap, x.data);
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2607
2753
|
/**
|
|
2608
2754
|
* Creates a ZohoRecruitSearchRecordsCriteriaEntryArray from an array of emails.
|
|
2609
2755
|
*
|
|
@@ -2802,6 +2948,11 @@ function zohoRecruitFactory(factoryConfig) {
|
|
|
2802
2948
|
};
|
|
2803
2949
|
}
|
|
2804
2950
|
|
|
2951
|
+
/**
|
|
2952
|
+
* Maximum length of ZohoRecruitTagName
|
|
2953
|
+
*/
|
|
2954
|
+
const ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH = 25;
|
|
2955
|
+
|
|
2805
2956
|
/**
|
|
2806
2957
|
* Trades a refresh token for a new AccessToken
|
|
2807
2958
|
* @param context
|
|
@@ -2978,6 +3129,7 @@ exports.ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CLIENT_E
|
|
|
2978
3129
|
exports.ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE = ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE;
|
|
2979
3130
|
exports.ZOHO_ACCOUNTS_US_API_URL = ZOHO_ACCOUNTS_US_API_URL;
|
|
2980
3131
|
exports.ZOHO_DUPLICATE_DATA_ERROR_CODE = ZOHO_DUPLICATE_DATA_ERROR_CODE;
|
|
3132
|
+
exports.ZOHO_ERROR_STATUS = ZOHO_ERROR_STATUS;
|
|
2981
3133
|
exports.ZOHO_FAILURE_ERROR_CODE = ZOHO_FAILURE_ERROR_CODE;
|
|
2982
3134
|
exports.ZOHO_INTERNAL_ERROR_CODE = ZOHO_INTERNAL_ERROR_CODE;
|
|
2983
3135
|
exports.ZOHO_INVALID_AUTHORIZATION_ERROR_CODE = ZOHO_INVALID_AUTHORIZATION_ERROR_CODE;
|
|
@@ -2989,9 +3141,13 @@ exports.ZOHO_RATE_LIMIT_REMAINING_HEADER = ZOHO_RATE_LIMIT_REMAINING_HEADER;
|
|
|
2989
3141
|
exports.ZOHO_RATE_LIMIT_RESET_HEADER = ZOHO_RATE_LIMIT_RESET_HEADER;
|
|
2990
3142
|
exports.ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
|
|
2991
3143
|
exports.ZOHO_RECRUIT_CANDIDATES_MODULE = ZOHO_RECRUIT_CANDIDATES_MODULE;
|
|
3144
|
+
exports.ZOHO_RECRUIT_EMAILS_MODULE = ZOHO_RECRUIT_EMAILS_MODULE;
|
|
2992
3145
|
exports.ZOHO_RECRUIT_JOB_OPENINGS_MODULE = ZOHO_RECRUIT_JOB_OPENINGS_MODULE;
|
|
3146
|
+
exports.ZOHO_RECRUIT_NOTES_MODULE = ZOHO_RECRUIT_NOTES_MODULE;
|
|
2993
3147
|
exports.ZOHO_RECRUIT_SERVICE_NAME = ZOHO_RECRUIT_SERVICE_NAME;
|
|
3148
|
+
exports.ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH = ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH;
|
|
2994
3149
|
exports.ZOHO_SUCCESS_CODE = ZOHO_SUCCESS_CODE;
|
|
3150
|
+
exports.ZOHO_SUCCESS_STATUS = ZOHO_SUCCESS_STATUS;
|
|
2995
3151
|
exports.ZOHO_TOO_MANY_REQUESTS_ERROR_CODE = ZOHO_TOO_MANY_REQUESTS_ERROR_CODE;
|
|
2996
3152
|
exports.ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE;
|
|
2997
3153
|
exports.ZohoAccountsAccessTokenError = ZohoAccountsAccessTokenError;
|
|
@@ -3010,18 +3166,26 @@ exports.ZohoServerError = ZohoServerError;
|
|
|
3010
3166
|
exports.ZohoServerFetchResponseError = ZohoServerFetchResponseError;
|
|
3011
3167
|
exports.ZohoTooManyRequestsError = ZohoTooManyRequestsError;
|
|
3012
3168
|
exports.accessToken = accessToken;
|
|
3169
|
+
exports.addTagsToRecords = addTagsToRecords;
|
|
3013
3170
|
exports.assertRecordDataArrayResultHasContent = assertRecordDataArrayResultHasContent;
|
|
3014
3171
|
exports.associateCandidateRecordsWithJobOpenings = associateCandidateRecordsWithJobOpenings;
|
|
3015
3172
|
exports.createNotes = createNotes;
|
|
3016
3173
|
exports.createNotesForRecord = createNotesForRecord;
|
|
3174
|
+
exports.createTagsForModule = createTagsForModule;
|
|
3017
3175
|
exports.deleteNotes = deleteNotes;
|
|
3176
|
+
exports.deleteRecord = deleteRecord;
|
|
3018
3177
|
exports.emptyZohoPageResult = emptyZohoPageResult;
|
|
3019
3178
|
exports.escapeZohoFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
|
|
3020
3179
|
exports.executeRestApiFunction = executeRestApiFunction;
|
|
3180
|
+
exports.getEmailsForRecord = getEmailsForRecord;
|
|
3181
|
+
exports.getEmailsForRecordPageFactory = getEmailsForRecordPageFactory;
|
|
3021
3182
|
exports.getNotesForRecord = getNotesForRecord;
|
|
3022
3183
|
exports.getNotesForRecordPageFactory = getNotesForRecordPageFactory;
|
|
3023
3184
|
exports.getRecordById = getRecordById;
|
|
3024
3185
|
exports.getRecords = getRecords;
|
|
3186
|
+
exports.getRelatedRecordsFunctionFactory = getRelatedRecordsFunctionFactory;
|
|
3187
|
+
exports.getTagsForModule = getTagsForModule;
|
|
3188
|
+
exports.getTagsForModulePageFactory = getTagsForModulePageFactory;
|
|
3025
3189
|
exports.handleZohoAccountsErrorFetch = handleZohoAccountsErrorFetch;
|
|
3026
3190
|
exports.handleZohoErrorFetchFactory = handleZohoErrorFetchFactory;
|
|
3027
3191
|
exports.handleZohoRecruitErrorFetch = handleZohoRecruitErrorFetch;
|
|
@@ -3059,6 +3223,7 @@ exports.zohoFetchPageFactory = zohoFetchPageFactory;
|
|
|
3059
3223
|
exports.zohoRateLimitHeaderDetails = zohoRateLimitHeaderDetails;
|
|
3060
3224
|
exports.zohoRateLimitedFetchHandler = zohoRateLimitedFetchHandler;
|
|
3061
3225
|
exports.zohoRecruitApiFetchJsonInput = zohoRecruitApiFetchJsonInput;
|
|
3226
|
+
exports.zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs = zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs;
|
|
3062
3227
|
exports.zohoRecruitConfigApiUrl = zohoRecruitConfigApiUrl;
|
|
3063
3228
|
exports.zohoRecruitFactory = zohoRecruitFactory;
|
|
3064
3229
|
exports.zohoRecruitMultiRecordResult = zohoRecruitMultiRecordResult;
|