@dereekb/zoho 11.0.14 → 11.0.16
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 +70 -16
- package/index.esm.js +109 -18
- package/nestjs/CHANGELOG.md +8 -0
- package/nestjs/package.json +1 -1
- package/nestjs/src/lib/accounts/accounts.service.js +4 -1
- package/nestjs/src/lib/accounts/accounts.service.js.map +1 -1
- package/nestjs/src/lib/recruit/recruit.api.d.ts +1 -0
- package/nestjs/src/lib/recruit/recruit.api.js +3 -0
- package/nestjs/src/lib/recruit/recruit.api.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/recruit/recruit.api.d.ts +62 -3
- package/src/lib/recruit/recruit.d.ts +19 -1
- package/src/lib/zoho.type.d.ts +21 -1
package/index.cjs.js
CHANGED
|
@@ -1208,6 +1208,18 @@ function zohoFetchPageFactory(fetch$1, defaults) {
|
|
|
1208
1208
|
}));
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
+
const ZOHO_RECRUIT_SERVICE_NAME = 'recruit';
|
|
1212
|
+
function zohoRecruitConfigApiUrl(input) {
|
|
1213
|
+
switch (input) {
|
|
1214
|
+
case 'sandbox':
|
|
1215
|
+
return 'https://recruitsandbox.zoho.com/recruit';
|
|
1216
|
+
case 'production':
|
|
1217
|
+
return 'https://recruit.zoho.com/recruit';
|
|
1218
|
+
default:
|
|
1219
|
+
return input;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1211
1223
|
var classof$3 = classofRaw$2;
|
|
1212
1224
|
|
|
1213
1225
|
// `IsArray` abstract operation
|
|
@@ -3248,6 +3260,42 @@ function createNotesForRecord(context) {
|
|
|
3248
3260
|
return createNotesInstance(createNotesRequest);
|
|
3249
3261
|
};
|
|
3250
3262
|
}
|
|
3263
|
+
class ZohoRecruitExecuteRestApiFunctionError extends makeError.BaseError {
|
|
3264
|
+
constructor(error) {
|
|
3265
|
+
super(`An error occured during the execution of the function. Code: ${error.code}, Message: ${error.message}`);
|
|
3266
|
+
this.error = void 0;
|
|
3267
|
+
this.error = error;
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
/**
|
|
3271
|
+
* Creates a ZohoRecruitExecuteRestApiFunctionFunction
|
|
3272
|
+
*
|
|
3273
|
+
* OAuth Details:
|
|
3274
|
+
* - https://www.zoho.com/crm/developer/docs/functions/serverless-fn-oauth.html#OAuth2
|
|
3275
|
+
* - There is no documentation for ZohoRecruit specifically, but it seems to behave the same way
|
|
3276
|
+
* - You will need the following scopes: ZohoRecruit.functions.execute.READ,ZohoRecruit.functions.execute.CREATE
|
|
3277
|
+
*
|
|
3278
|
+
* @param context
|
|
3279
|
+
* @returns
|
|
3280
|
+
*/
|
|
3281
|
+
function executeRestApiFunction(context) {
|
|
3282
|
+
return input => {
|
|
3283
|
+
const inputSearchParams = fetch.makeUrlSearchParams(input.params);
|
|
3284
|
+
const inputSearchParamsString = inputSearchParams.toString();
|
|
3285
|
+
const isSpecificRequest = Boolean(input.apiKey);
|
|
3286
|
+
const urlParams = (isSpecificRequest ? `auth_type=apikey&zapikey=${input.apiKey}` : 'auth_type=oauth') + (inputSearchParamsString ? `&${inputSearchParamsString}` : '');
|
|
3287
|
+
const relativeUrl = `/v2/functions/${input.functionName}/actions/execute?${urlParams}`;
|
|
3288
|
+
const baseUrl = isSpecificRequest && input.apiUrl != null ? zohoRecruitConfigApiUrl(input.apiUrl) : '';
|
|
3289
|
+
const url = `${baseUrl}${relativeUrl}`;
|
|
3290
|
+
return context.fetchJson(url, zohoRecruitApiFetchJsonInput('POST')).then(x => {
|
|
3291
|
+
if (x.code === 'success') {
|
|
3292
|
+
return x.details;
|
|
3293
|
+
} else {
|
|
3294
|
+
throw new ZohoRecruitExecuteRestApiFunctionError(x);
|
|
3295
|
+
}
|
|
3296
|
+
});
|
|
3297
|
+
};
|
|
3298
|
+
}
|
|
3251
3299
|
// MARK: Util
|
|
3252
3300
|
function zohoRecruitUrlSearchParamsMinusModule(...input) {
|
|
3253
3301
|
return fetch.makeUrlSearchParams(input, {
|
|
@@ -3266,7 +3314,7 @@ const zohoRecruitUrlSearchParams = fetch.makeUrlSearchParams;
|
|
|
3266
3314
|
function zohoRecruitApiFetchJsonInput(method, body) {
|
|
3267
3315
|
const result = {
|
|
3268
3316
|
method,
|
|
3269
|
-
body
|
|
3317
|
+
body: body != null ? body : undefined
|
|
3270
3318
|
};
|
|
3271
3319
|
return result;
|
|
3272
3320
|
}
|
|
@@ -3294,18 +3342,6 @@ function zohoRecruitMultiRecordResult(input, results) {
|
|
|
3294
3342
|
return result;
|
|
3295
3343
|
}
|
|
3296
3344
|
|
|
3297
|
-
const ZOHO_RECRUIT_SERVICE_NAME = 'recruit';
|
|
3298
|
-
function zohoRecruitConfigApiUrl(input) {
|
|
3299
|
-
switch (input) {
|
|
3300
|
-
case 'sandbox':
|
|
3301
|
-
return 'https://recruitsandbox.zoho.com/recruit';
|
|
3302
|
-
case 'production':
|
|
3303
|
-
return 'https://recruit.zoho.com/recruit/';
|
|
3304
|
-
default:
|
|
3305
|
-
return input;
|
|
3306
|
-
}
|
|
3307
|
-
}
|
|
3308
|
-
|
|
3309
3345
|
/**
|
|
3310
3346
|
* Error in the following cases:
|
|
3311
3347
|
* - the refresh token string is invalid
|
|
@@ -3421,9 +3457,9 @@ function zohoRateLimitedFetchHandler(config) {
|
|
|
3421
3457
|
function configForLimit(limit, resetAt) {
|
|
3422
3458
|
return {
|
|
3423
3459
|
limit: defaultLimit,
|
|
3424
|
-
startLimitAt: Math.ceil(limit /
|
|
3425
|
-
cooldownRate: 1.
|
|
3426
|
-
exponentRate: 1.
|
|
3460
|
+
startLimitAt: Math.ceil(limit / 10),
|
|
3461
|
+
cooldownRate: 1.2 * (limit / (defaultResetPeriod / util.MS_IN_SECOND)),
|
|
3462
|
+
exponentRate: 1.08,
|
|
3427
3463
|
maxWaitTime: util.MS_IN_SECOND * 10,
|
|
3428
3464
|
resetPeriod: defaultResetPeriod,
|
|
3429
3465
|
resetAt
|
|
@@ -3766,6 +3802,20 @@ function zohoAccountsZohoAccessTokenFactory(config) {
|
|
|
3766
3802
|
});
|
|
3767
3803
|
}
|
|
3768
3804
|
|
|
3805
|
+
function safeZohoDateTimeString(date) {
|
|
3806
|
+
return date != null ? zohoDateTimeString(date) : date;
|
|
3807
|
+
}
|
|
3808
|
+
/**
|
|
3809
|
+
* Converts the input date to a Zoho date.
|
|
3810
|
+
*
|
|
3811
|
+
* @param date
|
|
3812
|
+
* @returns
|
|
3813
|
+
*/
|
|
3814
|
+
function zohoDateTimeString(date) {
|
|
3815
|
+
const isoDate = date.toISOString();
|
|
3816
|
+
return isoDate.substring(0, isoDate.length - 5) + 'Z';
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3769
3819
|
exports.DEFAULT_ZOHO_API_RATE_LIMIT = DEFAULT_ZOHO_API_RATE_LIMIT;
|
|
3770
3820
|
exports.DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD = DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD;
|
|
3771
3821
|
exports.DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION;
|
|
@@ -3791,6 +3841,7 @@ exports.ZohoAccountsAuthFailureError = ZohoAccountsAuthFailureError;
|
|
|
3791
3841
|
exports.ZohoInternalError = ZohoInternalError;
|
|
3792
3842
|
exports.ZohoInvalidAuthorizationError = ZohoInvalidAuthorizationError;
|
|
3793
3843
|
exports.ZohoInvalidQueryError = ZohoInvalidQueryError;
|
|
3844
|
+
exports.ZohoRecruitExecuteRestApiFunctionError = ZohoRecruitExecuteRestApiFunctionError;
|
|
3794
3845
|
exports.ZohoRecruitRecordCrudDuplicateDataError = ZohoRecruitRecordCrudDuplicateDataError;
|
|
3795
3846
|
exports.ZohoRecruitRecordCrudError = ZohoRecruitRecordCrudError;
|
|
3796
3847
|
exports.ZohoRecruitRecordCrudInvalidDataError = ZohoRecruitRecordCrudInvalidDataError;
|
|
@@ -3806,6 +3857,7 @@ exports.createNotes = createNotes;
|
|
|
3806
3857
|
exports.createNotesForRecord = createNotesForRecord;
|
|
3807
3858
|
exports.deleteNotes = deleteNotes;
|
|
3808
3859
|
exports.escapeZohoFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
|
|
3860
|
+
exports.executeRestApiFunction = executeRestApiFunction;
|
|
3809
3861
|
exports.getNotesForRecord = getNotesForRecord;
|
|
3810
3862
|
exports.getNotesForRecordPageFactory = getNotesForRecordPageFactory;
|
|
3811
3863
|
exports.getRecordById = getRecordById;
|
|
@@ -3826,6 +3878,7 @@ exports.parseZohoAccountsServerErrorResponseData = parseZohoAccountsServerErrorR
|
|
|
3826
3878
|
exports.parseZohoRecruitError = parseZohoRecruitError;
|
|
3827
3879
|
exports.parseZohoRecruitServerErrorResponseData = parseZohoRecruitServerErrorResponseData;
|
|
3828
3880
|
exports.parseZohoServerErrorResponseData = parseZohoServerErrorResponseData;
|
|
3881
|
+
exports.safeZohoDateTimeString = safeZohoDateTimeString;
|
|
3829
3882
|
exports.searchRecords = searchRecords;
|
|
3830
3883
|
exports.searchRecordsPageFactory = searchRecordsPageFactory;
|
|
3831
3884
|
exports.tryFindZohoServerErrorData = tryFindZohoServerErrorData;
|
|
@@ -3836,6 +3889,7 @@ exports.zohoAccountsApiFetchJsonInput = zohoAccountsApiFetchJsonInput;
|
|
|
3836
3889
|
exports.zohoAccountsConfigApiUrl = zohoAccountsConfigApiUrl;
|
|
3837
3890
|
exports.zohoAccountsFactory = zohoAccountsFactory;
|
|
3838
3891
|
exports.zohoAccountsZohoAccessTokenFactory = zohoAccountsZohoAccessTokenFactory;
|
|
3892
|
+
exports.zohoDateTimeString = zohoDateTimeString;
|
|
3839
3893
|
exports.zohoFetchPageFactory = zohoFetchPageFactory;
|
|
3840
3894
|
exports.zohoRateLimitHeaderDetails = zohoRateLimitHeaderDetails;
|
|
3841
3895
|
exports.zohoRateLimitedFetchHandler = zohoRateLimitedFetchHandler;
|
package/index.esm.js
CHANGED
|
@@ -1222,6 +1222,18 @@ function zohoFetchPageFactory(fetch, defaults) {
|
|
|
1222
1222
|
}));
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
|
+
const ZOHO_RECRUIT_SERVICE_NAME = 'recruit';
|
|
1226
|
+
function zohoRecruitConfigApiUrl(input) {
|
|
1227
|
+
switch (input) {
|
|
1228
|
+
case 'sandbox':
|
|
1229
|
+
return 'https://recruitsandbox.zoho.com/recruit';
|
|
1230
|
+
case 'production':
|
|
1231
|
+
return 'https://recruit.zoho.com/recruit';
|
|
1232
|
+
default:
|
|
1233
|
+
return input;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1225
1237
|
var classof$3 = classofRaw$2;
|
|
1226
1238
|
|
|
1227
1239
|
// `IsArray` abstract operation
|
|
@@ -1556,6 +1568,10 @@ const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
|
|
|
1556
1568
|
* Contains a reference to a module.
|
|
1557
1569
|
*/
|
|
1558
1570
|
|
|
1571
|
+
/**
|
|
1572
|
+
* The API name of a function that is accessible via the Recruit REST API
|
|
1573
|
+
*/
|
|
1574
|
+
|
|
1559
1575
|
/**
|
|
1560
1576
|
* An identifier in Zoho Recruit.
|
|
1561
1577
|
*/
|
|
@@ -1572,6 +1588,12 @@ const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
|
|
|
1572
1588
|
* Example "576214000000820595"
|
|
1573
1589
|
*/
|
|
1574
1590
|
|
|
1591
|
+
/**
|
|
1592
|
+
* Zoho Recruit user identifier.
|
|
1593
|
+
*
|
|
1594
|
+
* Users can be found in the Users and Controls section in settings.
|
|
1595
|
+
*/
|
|
1596
|
+
|
|
1575
1597
|
/**
|
|
1576
1598
|
* Zoho Recruit custom view id
|
|
1577
1599
|
*/
|
|
@@ -1588,6 +1610,10 @@ const ZOHO_RECRUIT_CANDIDATES_MODULE = 'Candidates';
|
|
|
1588
1610
|
* Comma separated list of field names
|
|
1589
1611
|
*/
|
|
1590
1612
|
|
|
1613
|
+
/**
|
|
1614
|
+
* Reference pair of a Zoho Recruit user name and id
|
|
1615
|
+
*/
|
|
1616
|
+
|
|
1591
1617
|
/**
|
|
1592
1618
|
* Zoho Recruit only allows URLs that can be resolved via the internet (I.E. uses a normal tdl)
|
|
1593
1619
|
*
|
|
@@ -3352,6 +3378,51 @@ function createNotesForRecord(context) {
|
|
|
3352
3378
|
};
|
|
3353
3379
|
}
|
|
3354
3380
|
|
|
3381
|
+
// MARK: Function
|
|
3382
|
+
|
|
3383
|
+
class ZohoRecruitExecuteRestApiFunctionError extends BaseError {
|
|
3384
|
+
constructor(error) {
|
|
3385
|
+
super(`An error occured during the execution of the function. Code: ${error.code}, Message: ${error.message}`);
|
|
3386
|
+
this.error = error;
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
/**
|
|
3391
|
+
* Executes the Zoho Recruit function based on the input.
|
|
3392
|
+
*
|
|
3393
|
+
* If the function fails execution a ZohoRecruitExecuteRestApiFunctionError will be thrown. Other API errors may still be thrown.
|
|
3394
|
+
*/
|
|
3395
|
+
|
|
3396
|
+
/**
|
|
3397
|
+
* Creates a ZohoRecruitExecuteRestApiFunctionFunction
|
|
3398
|
+
*
|
|
3399
|
+
* OAuth Details:
|
|
3400
|
+
* - https://www.zoho.com/crm/developer/docs/functions/serverless-fn-oauth.html#OAuth2
|
|
3401
|
+
* - There is no documentation for ZohoRecruit specifically, but it seems to behave the same way
|
|
3402
|
+
* - You will need the following scopes: ZohoRecruit.functions.execute.READ,ZohoRecruit.functions.execute.CREATE
|
|
3403
|
+
*
|
|
3404
|
+
* @param context
|
|
3405
|
+
* @returns
|
|
3406
|
+
*/
|
|
3407
|
+
function executeRestApiFunction(context) {
|
|
3408
|
+
return input => {
|
|
3409
|
+
const inputSearchParams = makeUrlSearchParams(input.params);
|
|
3410
|
+
const inputSearchParamsString = inputSearchParams.toString();
|
|
3411
|
+
const isSpecificRequest = Boolean(input.apiKey);
|
|
3412
|
+
const urlParams = (isSpecificRequest ? `auth_type=apikey&zapikey=${input.apiKey}` : 'auth_type=oauth') + (inputSearchParamsString ? `&${inputSearchParamsString}` : '');
|
|
3413
|
+
const relativeUrl = `/v2/functions/${input.functionName}/actions/execute?${urlParams}`;
|
|
3414
|
+
const baseUrl = isSpecificRequest && input.apiUrl != null ? zohoRecruitConfigApiUrl(input.apiUrl) : '';
|
|
3415
|
+
const url = `${baseUrl}${relativeUrl}`;
|
|
3416
|
+
return context.fetchJson(url, zohoRecruitApiFetchJsonInput('POST')).then(x => {
|
|
3417
|
+
if (x.code === 'success') {
|
|
3418
|
+
return x.details;
|
|
3419
|
+
} else {
|
|
3420
|
+
throw new ZohoRecruitExecuteRestApiFunctionError(x);
|
|
3421
|
+
}
|
|
3422
|
+
});
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3355
3426
|
// MARK: Util
|
|
3356
3427
|
function zohoRecruitUrlSearchParamsMinusModule(...input) {
|
|
3357
3428
|
return makeUrlSearchParams(input, {
|
|
@@ -3371,7 +3442,7 @@ const zohoRecruitUrlSearchParams = makeUrlSearchParams;
|
|
|
3371
3442
|
function zohoRecruitApiFetchJsonInput(method, body) {
|
|
3372
3443
|
const result = {
|
|
3373
3444
|
method,
|
|
3374
|
-
body
|
|
3445
|
+
body: body != null ? body : undefined
|
|
3375
3446
|
};
|
|
3376
3447
|
return result;
|
|
3377
3448
|
}
|
|
@@ -3417,18 +3488,6 @@ function zohoRecruitMultiRecordResult(input, results) {
|
|
|
3417
3488
|
* @deprecated use ZohoRecruitChangeObjectResponseErrorEntry instead.
|
|
3418
3489
|
*/
|
|
3419
3490
|
|
|
3420
|
-
const ZOHO_RECRUIT_SERVICE_NAME = 'recruit';
|
|
3421
|
-
function zohoRecruitConfigApiUrl(input) {
|
|
3422
|
-
switch (input) {
|
|
3423
|
-
case 'sandbox':
|
|
3424
|
-
return 'https://recruitsandbox.zoho.com/recruit';
|
|
3425
|
-
case 'production':
|
|
3426
|
-
return 'https://recruit.zoho.com/recruit/';
|
|
3427
|
-
default:
|
|
3428
|
-
return input;
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
|
|
3432
3491
|
/**
|
|
3433
3492
|
* Error in the following cases:
|
|
3434
3493
|
* - the refresh token string is invalid
|
|
@@ -3559,10 +3618,10 @@ function zohoRateLimitedFetchHandler(config) {
|
|
|
3559
3618
|
function configForLimit(limit, resetAt) {
|
|
3560
3619
|
return {
|
|
3561
3620
|
limit: defaultLimit,
|
|
3562
|
-
startLimitAt: Math.ceil(limit /
|
|
3563
|
-
// can do
|
|
3564
|
-
cooldownRate: 1.
|
|
3565
|
-
exponentRate: 1.
|
|
3621
|
+
startLimitAt: Math.ceil(limit / 10),
|
|
3622
|
+
// can do 10% of the requests of the limit before rate limiting begins
|
|
3623
|
+
cooldownRate: 1.2 * (limit / (defaultResetPeriod / MS_IN_SECOND)),
|
|
3624
|
+
exponentRate: 1.08,
|
|
3566
3625
|
maxWaitTime: MS_IN_SECOND * 10,
|
|
3567
3626
|
resetPeriod: defaultResetPeriod,
|
|
3568
3627
|
resetAt
|
|
@@ -3833,4 +3892,36 @@ function zohoAccountsZohoAccessTokenFactory(config) {
|
|
|
3833
3892
|
};
|
|
3834
3893
|
}
|
|
3835
3894
|
|
|
3836
|
-
|
|
3895
|
+
// MARK: V1
|
|
3896
|
+
/**
|
|
3897
|
+
* General Zoho API GET request response sent by the v1 API.
|
|
3898
|
+
*
|
|
3899
|
+
* @deprecated
|
|
3900
|
+
*/
|
|
3901
|
+
|
|
3902
|
+
/**
|
|
3903
|
+
* Similar to the ISO 8601 date-time format, but with milliseconds removed.
|
|
3904
|
+
*
|
|
3905
|
+
* yyyy-MM-ddTHH:mm:ss±HH:mm
|
|
3906
|
+
*
|
|
3907
|
+
* Examples:
|
|
3908
|
+
* 2019-05-02T11:17:33Z
|
|
3909
|
+
* 2019-05-02T11:17:33+00:00
|
|
3910
|
+
*/
|
|
3911
|
+
|
|
3912
|
+
function safeZohoDateTimeString(date) {
|
|
3913
|
+
return date != null ? zohoDateTimeString(date) : date;
|
|
3914
|
+
}
|
|
3915
|
+
|
|
3916
|
+
/**
|
|
3917
|
+
* Converts the input date to a Zoho date.
|
|
3918
|
+
*
|
|
3919
|
+
* @param date
|
|
3920
|
+
* @returns
|
|
3921
|
+
*/
|
|
3922
|
+
function zohoDateTimeString(date) {
|
|
3923
|
+
const isoDate = date.toISOString();
|
|
3924
|
+
return isoDate.substring(0, isoDate.length - 5) + 'Z';
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, 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, interceptZohoAccountsErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruitErrorResponse, 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, zohoRecruitSearchRecordsCriteriaEntryToCriteriaString, zohoRecruitSearchRecordsCriteriaString, zohoRecruitSearchRecordsCriteriaStringForTree, zohoRecruitUrlSearchParams, zohoRecruitUrlSearchParamsMinusIdAndModule, zohoRecruitUrlSearchParamsMinusModule, zohoServerErrorData };
|
package/nestjs/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [11.0.16](https://github.com/dereekb/dbx-components/compare/v11.0.15-dev...v11.0.16) (2024-12-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [11.0.15](https://github.com/dereekb/dbx-components/compare/v11.0.14-dev...v11.0.15) (2024-11-29)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## [11.0.14](https://github.com/dereekb/dbx-components/compare/v11.0.13-dev...v11.0.14) (2024-11-27)
|
|
6
14
|
|
|
7
15
|
|
package/nestjs/package.json
CHANGED
|
@@ -40,7 +40,10 @@ function mergeZohoAccountsAccessTokenCacheServices(inputServicesToMerge, logErro
|
|
|
40
40
|
loadZohoAccessTokenCache: function (service) {
|
|
41
41
|
const accessCachesForServices = services.map((x) => x.loadZohoAccessTokenCache(service));
|
|
42
42
|
const loadCachedTokenFromFirstService = (0, util_1.tryWithPromiseFactoriesFunction)({
|
|
43
|
-
promiseFactories: accessCachesForServices.map((x) => () => x
|
|
43
|
+
promiseFactories: accessCachesForServices.map((x) => () => x
|
|
44
|
+
.loadCachedToken()
|
|
45
|
+
.catch(() => null)
|
|
46
|
+
.then((x) => {
|
|
44
47
|
let result = undefined;
|
|
45
48
|
if (x && !(0, util_1.isPast)(x.expiresAt)) {
|
|
46
49
|
result = x; // only return from cache if it is not expired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.service.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/accounts/accounts.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,wCAAiI;AACjI,+BAA+B;AAC/B,2BAAwD;AAIxD;;GAEG;AAEI,IAAe,mCAAmC,iDAAlD,MAAe,mCAAmC;CAOxD,CAAA;8CAPqB,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;AALD,4HAKC;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;QACzB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;KACvF;IAED,MAAM,OAAO,GAAwC;QACnD,wBAAwB,EAAE,UAAU,OAAe;YACjD,MAAM,uBAAuB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;YACzF,MAAM,+BAA+B,GAAG,IAAA,sCAA+B,EAAwB;gBAC7F,gBAAgB,EAAE,uBAAuB,CAAC,GAAG,CAC3C,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CACV,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"accounts.service.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/accounts/accounts.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAE5C,wCAAiI;AACjI,+BAA+B;AAC/B,2BAAwD;AAIxD;;GAEG;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|
|
19
19
|
get deleteNotes(): (input: import("@dereekb/zoho").ZohoRecruitDeleteNotesRequest) => Promise<import("@dereekb/zoho").ZohoRecruitMultiRecordResult<string, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoRecruitChangeObjectDetails>, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseErrorEntry>>;
|
|
20
20
|
get createNotesForRecord(): import("@dereekb/zoho").ZohoRecruitCreateNotesForRecordFunction;
|
|
21
21
|
get getNotesForRecord(): import("@dereekb/zoho").ZohoRecruitGetNotesForRecordFunction;
|
|
22
|
+
get executeRestApiFunction(): import("@dereekb/zoho").ZohoRecruitExecuteRestApiFunctionFunction;
|
|
22
23
|
}
|
|
@@ -58,6 +58,9 @@ let ZohoRecruitApi = exports.ZohoRecruitApi = class ZohoRecruitApi {
|
|
|
58
58
|
get getNotesForRecord() {
|
|
59
59
|
return (0, zoho_1.getNotesForRecord)(this.recruitContext);
|
|
60
60
|
}
|
|
61
|
+
get executeRestApiFunction() {
|
|
62
|
+
return (0, zoho_1.executeRestApiFunction)(this.recruitContext);
|
|
63
|
+
}
|
|
61
64
|
};
|
|
62
65
|
exports.ZohoRecruitApi = ZohoRecruitApi = tslib_1.__decorate([
|
|
63
66
|
(0, common_1.Injectable)(),
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"recruit.api.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/recruit/recruit.api.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,wCAA6R;AAC7R,qDAA4D;AAC5D,2DAA2D;AAGpD,IAAM,cAAc,4BAApB,MAAM,cAAc;IAW8B;IAAoE;IAVlH,WAAW,CAAc;IAElC,IAAI,cAAc;QAChB,O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AAC;IAC1C,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAA,2BAAoB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAA,wBAAiB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,sBAAsB;QACxB,OAAO,IAAA,6BAAsB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;CACF,CAAA;yBAlEY,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAYE,mBAAA,IAAA,eAAM,EAAC,yCAAwB,CAAC,CAAA;IAA6C,mBAAA,IAAA,eAAM,EAAC,8BAAe,CAAC,CAAA;6CAAlD,yCAAwB,EAAqD,8BAAe;GAXhJ,cAAc,CAkE1B"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ZohoDataArrayResultRef, ZohoPageFilter, ZohoPageResult } from './../zoho.api.page';
|
|
2
2
|
import { FetchJsonBody, FetchJsonInput, FetchPage, FetchPageFactory, FetchPageFactoryOptions, makeUrlSearchParams } from '@dereekb/util/fetch';
|
|
3
|
-
import { ZohoRecruitContext } from './recruit.config';
|
|
4
|
-
import { NewZohoRecruitNoteData, ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitRecordNote, ZohoRecruitSearchRecordsCriteriaTreeElement, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitNoteId } from './recruit';
|
|
3
|
+
import { ZohoRecruitConfigApiUrlInput, ZohoRecruitContext } from './recruit.config';
|
|
4
|
+
import { NewZohoRecruitNoteData, ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitRecordNote, ZohoRecruitSearchRecordsCriteriaTreeElement, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitNoteId, ZohoRecruitRestFunctionApiName, ZohoRecruitUserId } from './recruit';
|
|
5
5
|
import { ArrayOrValue, EmailAddress, Maybe, PhoneNumber, SortingOrder, UniqueModelWithId } from '@dereekb/util';
|
|
6
6
|
import { ZohoServerErrorDataWithDetails, ZohoServerErrorStatus, ZohoServerSuccessCode, ZohoServerSuccessStatus } from '../zoho.error.api';
|
|
7
|
+
import { ZohoDateTimeString } from '../zoho.type';
|
|
8
|
+
import { BaseError } from 'make-error';
|
|
7
9
|
export type ZohoRecruitUpdateRecordResult<T> = ZohoRecruitMultiRecordResult<T, ZohoRecruitChangeObjectResponseSuccessEntry, ZohoRecruitChangeObjectResponseErrorEntry>;
|
|
8
10
|
export type ZohoRecruitUpdateRecordResponse = ZohoRecruitChangeObjectResponse;
|
|
9
11
|
export type ZohoRecruitCreateRecordData<T> = Omit<T, 'id'>;
|
|
@@ -166,13 +168,70 @@ export interface ZohoRecruitCreateNotesForRecordRequest extends ZohoRecruitModul
|
|
|
166
168
|
}
|
|
167
169
|
export type ZohoRecruitCreateNotesForRecordFunction = (input: ZohoRecruitCreateNotesForRecordRequest) => Promise<ZohoRecruitCreateNotesResult>;
|
|
168
170
|
export declare function createNotesForRecord(context: ZohoRecruitContext): ZohoRecruitCreateNotesForRecordFunction;
|
|
171
|
+
export type ZohoRecruitExecuteRestApiFunctionRequest = ZohoRecruitExecuteRestApiFunctionNormalRequest | ZohoRecruitExecuteRestApiFunctionApiSpecificRequest;
|
|
172
|
+
export interface ZohoRecruitExecuteRestApiFunctionNormalRequest {
|
|
173
|
+
readonly functionName: ZohoRecruitRestFunctionApiName;
|
|
174
|
+
readonly params?: Maybe<ZohoRecruitExecuteRestApiFunctionParams>;
|
|
175
|
+
}
|
|
176
|
+
export interface ZohoRecruitExecuteRestApiFunctionApiSpecificRequest extends ZohoRecruitExecuteRestApiFunctionNormalRequest {
|
|
177
|
+
/**
|
|
178
|
+
* If provided the function will use the API key provided instead of the internal oauth
|
|
179
|
+
*/
|
|
180
|
+
readonly apiKey: Maybe<ZohoRecruitRestFunctionApiKey>;
|
|
181
|
+
/**
|
|
182
|
+
* If provided, the function will target the given API and not the default. Only used when apiKey is provided.
|
|
183
|
+
*
|
|
184
|
+
* Careful when using this, as it might indicate that the target is not environment specific/aware.
|
|
185
|
+
*/
|
|
186
|
+
readonly apiUrl?: ZohoRecruitConfigApiUrlInput;
|
|
187
|
+
}
|
|
188
|
+
export type ZohoRecruitRestFunctionApiKey = string;
|
|
189
|
+
export type ZohoRecruitExecuteRestApiFunctionParams = Record<string, string | number | boolean | ZohoDateTimeString>;
|
|
190
|
+
export type ZohoRecruitExecuteRestApiFunctionResponse = ZohoRecruitExecuteRestApiFunctionSuccessResponse | ZohoRecruitExecuteRestApiFunctionErrorResponse;
|
|
191
|
+
export interface ZohoRecruitExecuteRestApiFunctionSuccessResponse {
|
|
192
|
+
readonly code: 'success';
|
|
193
|
+
readonly details: ZohoRecruitExecuteRestApiFunctionSuccessDetails;
|
|
194
|
+
readonly message: string;
|
|
195
|
+
}
|
|
196
|
+
export interface ZohoRecruitExecuteRestApiFunctionSuccessDetails {
|
|
197
|
+
readonly userMessage: string[];
|
|
198
|
+
readonly output_type: string;
|
|
199
|
+
readonly id: ZohoRecruitUserId;
|
|
200
|
+
}
|
|
201
|
+
export interface ZohoRecruitExecuteRestApiFunctionErrorResponse {
|
|
202
|
+
readonly code: string;
|
|
203
|
+
readonly details: unknown;
|
|
204
|
+
readonly message: string;
|
|
205
|
+
}
|
|
206
|
+
export declare class ZohoRecruitExecuteRestApiFunctionError extends BaseError {
|
|
207
|
+
readonly error: ZohoRecruitExecuteRestApiFunctionErrorResponse;
|
|
208
|
+
constructor(error: ZohoRecruitExecuteRestApiFunctionErrorResponse);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Executes the Zoho Recruit function based on the input.
|
|
212
|
+
*
|
|
213
|
+
* If the function fails execution a ZohoRecruitExecuteRestApiFunctionError will be thrown. Other API errors may still be thrown.
|
|
214
|
+
*/
|
|
215
|
+
export type ZohoRecruitExecuteRestApiFunctionFunction = (input: ZohoRecruitExecuteRestApiFunctionRequest) => Promise<ZohoRecruitExecuteRestApiFunctionSuccessDetails>;
|
|
216
|
+
/**
|
|
217
|
+
* Creates a ZohoRecruitExecuteRestApiFunctionFunction
|
|
218
|
+
*
|
|
219
|
+
* OAuth Details:
|
|
220
|
+
* - https://www.zoho.com/crm/developer/docs/functions/serverless-fn-oauth.html#OAuth2
|
|
221
|
+
* - There is no documentation for ZohoRecruit specifically, but it seems to behave the same way
|
|
222
|
+
* - You will need the following scopes: ZohoRecruit.functions.execute.READ,ZohoRecruit.functions.execute.CREATE
|
|
223
|
+
*
|
|
224
|
+
* @param context
|
|
225
|
+
* @returns
|
|
226
|
+
*/
|
|
227
|
+
export declare function executeRestApiFunction(context: ZohoRecruitContext): ZohoRecruitExecuteRestApiFunctionFunction;
|
|
169
228
|
export declare function zohoRecruitUrlSearchParamsMinusModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
|
|
170
229
|
export declare function zohoRecruitUrlSearchParamsMinusIdAndModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
|
|
171
230
|
/**
|
|
172
231
|
* @deprecated use makeUrlSearchParams instead.
|
|
173
232
|
*/
|
|
174
233
|
export declare const zohoRecruitUrlSearchParams: typeof makeUrlSearchParams;
|
|
175
|
-
export declare function zohoRecruitApiFetchJsonInput(method: string, body?: FetchJsonBody): FetchJsonInput;
|
|
234
|
+
export declare function zohoRecruitApiFetchJsonInput(method: string, body?: Maybe<FetchJsonBody>): FetchJsonInput;
|
|
176
235
|
export type ZohoRecruitChangeObjectResponse<T extends ZohoRecruitChangeObjectResponseEntry = ZohoRecruitChangeObjectResponseEntry> = ZohoDataArrayResultRef<T>;
|
|
177
236
|
export type ZohoRecruitChangeObjectResponseEntry<E extends ZohoRecruitChangeObjectResponseSuccessEntry = ZohoRecruitChangeObjectResponseSuccessEntry> = E | ZohoRecruitChangeObjectResponseErrorEntry;
|
|
178
237
|
export interface ZohoRecruitChangeObjectResponseSuccessEntry<D extends ZohoRecruitChangeObjectDetails = ZohoRecruitChangeObjectDetails> {
|
|
@@ -15,6 +15,10 @@ export declare const ZOHO_RECRUIT_CANDIDATES_MODULE = "Candidates";
|
|
|
15
15
|
export interface ZohoRecruitModuleNameRef {
|
|
16
16
|
readonly module: ZohoRecruitModuleName;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The API name of a function that is accessible via the Recruit REST API
|
|
20
|
+
*/
|
|
21
|
+
export type ZohoRecruitRestFunctionApiName = string;
|
|
18
22
|
/**
|
|
19
23
|
* An identifier in Zoho Recruit.
|
|
20
24
|
*/
|
|
@@ -31,6 +35,12 @@ export type ZohoRecruitRecordId = string;
|
|
|
31
35
|
* Example "576214000000820595"
|
|
32
36
|
*/
|
|
33
37
|
export type ZohoRecruitTypeId = string;
|
|
38
|
+
/**
|
|
39
|
+
* Zoho Recruit user identifier.
|
|
40
|
+
*
|
|
41
|
+
* Users can be found in the Users and Controls section in settings.
|
|
42
|
+
*/
|
|
43
|
+
export type ZohoRecruitUserId = string;
|
|
34
44
|
/**
|
|
35
45
|
* Zoho Recruit custom view id
|
|
36
46
|
*/
|
|
@@ -53,9 +63,17 @@ export interface ZohoRecruitReferenceData {
|
|
|
53
63
|
name: string;
|
|
54
64
|
id: ZohoRecruitId;
|
|
55
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Reference pair of a Zoho Recruit user name and id
|
|
68
|
+
*/
|
|
69
|
+
export interface ZohoRecruitUserReferenceData {
|
|
70
|
+
name: string;
|
|
71
|
+
id: ZohoRecruitUserId;
|
|
72
|
+
}
|
|
56
73
|
export interface ZohoRecruitReferenceDataWithModule extends ZohoRecruitReferenceData, ZohoRecruitModuleNameRef {
|
|
57
74
|
}
|
|
58
|
-
export type ZohoRecruitCreatedByData =
|
|
75
|
+
export type ZohoRecruitCreatedByData = ZohoRecruitUserReferenceData;
|
|
76
|
+
export type ZohoRecruitCandidateOwner = ZohoRecruitUserReferenceData;
|
|
59
77
|
export interface ZohoRecruitModifiedByData extends ZohoRecruitReferenceData {
|
|
60
78
|
zuid: ZohoRecruitId;
|
|
61
79
|
}
|
package/src/lib/zoho.type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WebsitePath } from '@dereekb/util';
|
|
1
|
+
import { Maybe, MaybeNot, WebsitePath } from '@dereekb/util';
|
|
2
2
|
export interface ZohoModel {
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
@@ -18,3 +18,23 @@ export interface ZohoGetApiV1Result<T> {
|
|
|
18
18
|
readonly url: WebsitePath;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Similar to the ISO 8601 date-time format, but with milliseconds removed.
|
|
23
|
+
*
|
|
24
|
+
* yyyy-MM-ddTHH:mm:ss±HH:mm
|
|
25
|
+
*
|
|
26
|
+
* Examples:
|
|
27
|
+
* 2019-05-02T11:17:33Z
|
|
28
|
+
* 2019-05-02T11:17:33+00:00
|
|
29
|
+
*/
|
|
30
|
+
export type ZohoDateTimeString = string;
|
|
31
|
+
export declare function safeZohoDateTimeString(date: Date): ZohoDateTimeString;
|
|
32
|
+
export declare function safeZohoDateTimeString(date: MaybeNot): MaybeNot;
|
|
33
|
+
export declare function safeZohoDateTimeString(date: Maybe<Date>): Maybe<ZohoDateTimeString>;
|
|
34
|
+
/**
|
|
35
|
+
* Converts the input date to a Zoho date.
|
|
36
|
+
*
|
|
37
|
+
* @param date
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare function zohoDateTimeString(date: Date): ZohoDateTimeString;
|