@dereekb/zoho 12.3.6 → 12.3.8

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
@@ -1810,10 +1810,15 @@ const ZOHO_RECRUIT_NOTES_MODULE = 'Notes';
1810
1810
  * Emails module name
1811
1811
  */
1812
1812
  const ZOHO_RECRUIT_EMAILS_MODULE = 'Emails';
1813
+ /**
1814
+ * Attachments module name
1815
+ */
1816
+ const ZOHO_RECRUIT_ATTACHMENTS_MODULE = 'Attachments';
1813
1817
  /**
1814
1818
  * Returns true if it is a valid ZohoRecruitValidUrl.
1815
1819
  */
1816
1820
  const isZohoRecruitValidUrl = util.isStandardInternetAccessibleWebsiteUrl;
1821
+ const ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = 'Resume';
1817
1822
 
1818
1823
  var call$2 = functionCall;
1819
1824
  var anObject$2 = anObject$e;
@@ -2484,6 +2489,109 @@ function getEmailsForRecord(context) {
2484
2489
  function getEmailsForRecordPageFactory(context) {
2485
2490
  return zohoFetchPageFactory(getEmailsForRecord(context));
2486
2491
  }
2492
+ function getAttachmentsForRecord(context) {
2493
+ return getRelatedRecordsFunctionFactory(context)({
2494
+ targetModule: ZOHO_RECRUIT_ATTACHMENTS_MODULE
2495
+ });
2496
+ }
2497
+ function getAttachmentsForRecordPageFactory(context) {
2498
+ return zohoFetchPageFactory(getAttachmentsForRecord(context));
2499
+ }
2500
+ /**
2501
+ * Maximum attachment size allowed by Zoho Recruit.
2502
+ *
2503
+ * 20MB
2504
+ */
2505
+ const ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE = 20 * 1024 * 1024;
2506
+ /**
2507
+ * Uploads an attachment to a record.
2508
+ *
2509
+ * https://www.zoho.com/recruit/developer-guide/apiv2/upload-attachment.html
2510
+ *
2511
+ * @param context
2512
+ * @returns
2513
+ */
2514
+ function uploadAttachmentForRecord(context) {
2515
+ return input => {
2516
+ const {
2517
+ attachmentCategoryId,
2518
+ attachmentCategoryName,
2519
+ formData
2520
+ } = input;
2521
+ const urlParams = {
2522
+ attachments_category_id: util.joinStringsWithCommas(attachmentCategoryId),
2523
+ attachments_category: util.joinStringsWithCommas(attachmentCategoryName),
2524
+ attachment_url: input.attachmentUrl
2525
+ };
2526
+ if (!urlParams.attachments_category_id?.length && !urlParams.attachments_category?.length) {
2527
+ throw new Error('attachmentCategoryId or attachmentCategoryName must be provided and not empty.');
2528
+ }
2529
+ if (formData != null) {
2530
+ delete urlParams.attachment_url;
2531
+ }
2532
+ const url = `https://recruitsandbox.zoho.com/recruit/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}?${fetch.makeUrlSearchParams(urlParams).toString()}`;
2533
+ let response;
2534
+ if (urlParams.attachment_url) {
2535
+ response = context.fetch(url, {
2536
+ method: 'POST'
2537
+ });
2538
+ } else if (formData != null) {
2539
+ throw new Error('unsupported currently. Use the attachmentUrl parameter instead.');
2540
+ // There is something weird going on with sending requests this way and zoho's server is rejecting it.
2541
+ /*
2542
+ response = context.fetch(url, {
2543
+ method: 'POST',
2544
+ headers: {
2545
+ 'Content-Type': 'multipart/form-data',
2546
+ 'content-length': '210'
2547
+ },
2548
+ body: formData
2549
+ });
2550
+ */
2551
+ /*
2552
+ const fullUrl = (context.config.apiUrl as string) + url;
2553
+ const accessToken = await context.accessTokenStringFactory();
2554
+ response = fetch(fullUrl, {
2555
+ headers: {
2556
+ Authorization: `Bearer ${accessToken}`
2557
+ },
2558
+ body: formData,
2559
+ method: 'POST'
2560
+ });
2561
+ console.log({ response });
2562
+ */
2563
+ } else {
2564
+ throw new Error('body or attachmentUrl must be provided.');
2565
+ }
2566
+ return response;
2567
+ };
2568
+ }
2569
+ /**
2570
+ * Downloads an attachment from a record.
2571
+ *
2572
+ * https://www.zoho.com/recruit/developer-guide/apiv2/download-attachments.html
2573
+ *
2574
+ * @param context
2575
+ * @returns
2576
+ */
2577
+ function downloadAttachmentForRecord(context) {
2578
+ return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2579
+ method: 'GET'
2580
+ }).then(fetch.parseFetchFileResponse);
2581
+ }
2582
+ /**
2583
+ * Deletes an attachment from a record.
2584
+ *
2585
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-attachments.html
2586
+ *
2587
+ * @param context
2588
+ * @returns
2589
+ */
2590
+ function deleteAttachmentFromRecord(context) {
2591
+ return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2592
+ method: 'DELETE'
2593
+ });
2594
+ }
2487
2595
  class ZohoRecruitExecuteRestApiFunctionError extends makeError.BaseError {
2488
2596
  constructor(error) {
2489
2597
  super(`An error occured during the execution of the function. Code: ${error.code}, Message: ${error.message}`);
@@ -2935,6 +3043,7 @@ function zohoRecruitFactory(factoryConfig) {
2935
3043
  const recruitContext = {
2936
3044
  fetch: fetch$1,
2937
3045
  fetchJson,
3046
+ accessTokenStringFactory,
2938
3047
  config: {
2939
3048
  ...config,
2940
3049
  apiUrl
@@ -3140,10 +3249,13 @@ exports.ZOHO_RATE_LIMIT_LIMIT_HEADER = ZOHO_RATE_LIMIT_LIMIT_HEADER;
3140
3249
  exports.ZOHO_RATE_LIMIT_REMAINING_HEADER = ZOHO_RATE_LIMIT_REMAINING_HEADER;
3141
3250
  exports.ZOHO_RATE_LIMIT_RESET_HEADER = ZOHO_RATE_LIMIT_RESET_HEADER;
3142
3251
  exports.ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE = ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE;
3252
+ exports.ZOHO_RECRUIT_ATTACHMENTS_MODULE = ZOHO_RECRUIT_ATTACHMENTS_MODULE;
3253
+ exports.ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE = ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE;
3143
3254
  exports.ZOHO_RECRUIT_CANDIDATES_MODULE = ZOHO_RECRUIT_CANDIDATES_MODULE;
3144
3255
  exports.ZOHO_RECRUIT_EMAILS_MODULE = ZOHO_RECRUIT_EMAILS_MODULE;
3145
3256
  exports.ZOHO_RECRUIT_JOB_OPENINGS_MODULE = ZOHO_RECRUIT_JOB_OPENINGS_MODULE;
3146
3257
  exports.ZOHO_RECRUIT_NOTES_MODULE = ZOHO_RECRUIT_NOTES_MODULE;
3258
+ exports.ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME;
3147
3259
  exports.ZOHO_RECRUIT_SERVICE_NAME = ZOHO_RECRUIT_SERVICE_NAME;
3148
3260
  exports.ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH = ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH;
3149
3261
  exports.ZOHO_SUCCESS_CODE = ZOHO_SUCCESS_CODE;
@@ -3172,11 +3284,15 @@ exports.associateCandidateRecordsWithJobOpenings = associateCandidateRecordsWith
3172
3284
  exports.createNotes = createNotes;
3173
3285
  exports.createNotesForRecord = createNotesForRecord;
3174
3286
  exports.createTagsForModule = createTagsForModule;
3287
+ exports.deleteAttachmentFromRecord = deleteAttachmentFromRecord;
3175
3288
  exports.deleteNotes = deleteNotes;
3176
3289
  exports.deleteRecord = deleteRecord;
3290
+ exports.downloadAttachmentForRecord = downloadAttachmentForRecord;
3177
3291
  exports.emptyZohoPageResult = emptyZohoPageResult;
3178
3292
  exports.escapeZohoFieldValueForCriteriaString = escapeZohoFieldValueForCriteriaString;
3179
3293
  exports.executeRestApiFunction = executeRestApiFunction;
3294
+ exports.getAttachmentsForRecord = getAttachmentsForRecord;
3295
+ exports.getAttachmentsForRecordPageFactory = getAttachmentsForRecordPageFactory;
3180
3296
  exports.getEmailsForRecord = getEmailsForRecord;
3181
3297
  exports.getEmailsForRecordPageFactory = getEmailsForRecordPageFactory;
3182
3298
  exports.getNotesForRecord = getNotesForRecord;
@@ -3212,6 +3328,7 @@ exports.searchRecords = searchRecords;
3212
3328
  exports.searchRecordsPageFactory = searchRecordsPageFactory;
3213
3329
  exports.tryFindZohoServerErrorData = tryFindZohoServerErrorData;
3214
3330
  exports.updateRecord = updateRecord;
3331
+ exports.uploadAttachmentForRecord = uploadAttachmentForRecord;
3215
3332
  exports.upsertRecord = upsertRecord;
3216
3333
  exports.zohoAccessTokenStringFactory = zohoAccessTokenStringFactory;
3217
3334
  exports.zohoAccountsApiFetchJsonInput = zohoAccountsApiFetchJsonInput;
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { getNextPageNumber, isStandardInternetAccessibleWebsiteUrl, escapeStringCharactersFunction, filterMaybeArrayValues, asArray, MS_IN_MINUTE, separateValues, resetPeriodPromiseRateLimiter, MS_IN_SECOND } from '@dereekb/util';
2
- import { fetchPageFactory, FetchResponseError, makeUrlSearchParams, FetchRequestFactoryError, rateLimitedFetchHandler, fetchJsonFunction, returnNullHandleFetchJsonParseErrorFunction, fetchApiFetchService } from '@dereekb/util/fetch';
1
+ import { getNextPageNumber, isStandardInternetAccessibleWebsiteUrl, escapeStringCharactersFunction, filterMaybeArrayValues, asArray, MS_IN_MINUTE, joinStringsWithCommas, separateValues, resetPeriodPromiseRateLimiter, MS_IN_SECOND } from '@dereekb/util';
2
+ import { fetchPageFactory, FetchResponseError, makeUrlSearchParams, parseFetchFileResponse, FetchRequestFactoryError, rateLimitedFetchHandler, fetchJsonFunction, returnNullHandleFetchJsonParseErrorFunction, fetchApiFetchService } from '@dereekb/util/fetch';
3
3
  import { BaseError } from 'make-error';
4
4
 
5
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -1808,10 +1808,15 @@ const ZOHO_RECRUIT_NOTES_MODULE = 'Notes';
1808
1808
  * Emails module name
1809
1809
  */
1810
1810
  const ZOHO_RECRUIT_EMAILS_MODULE = 'Emails';
1811
+ /**
1812
+ * Attachments module name
1813
+ */
1814
+ const ZOHO_RECRUIT_ATTACHMENTS_MODULE = 'Attachments';
1811
1815
  /**
1812
1816
  * Returns true if it is a valid ZohoRecruitValidUrl.
1813
1817
  */
1814
1818
  const isZohoRecruitValidUrl = isStandardInternetAccessibleWebsiteUrl;
1819
+ const ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = 'Resume';
1815
1820
 
1816
1821
  var call$2 = functionCall;
1817
1822
  var anObject$2 = anObject$e;
@@ -2482,6 +2487,109 @@ function getEmailsForRecord(context) {
2482
2487
  function getEmailsForRecordPageFactory(context) {
2483
2488
  return zohoFetchPageFactory(getEmailsForRecord(context));
2484
2489
  }
2490
+ function getAttachmentsForRecord(context) {
2491
+ return getRelatedRecordsFunctionFactory(context)({
2492
+ targetModule: ZOHO_RECRUIT_ATTACHMENTS_MODULE
2493
+ });
2494
+ }
2495
+ function getAttachmentsForRecordPageFactory(context) {
2496
+ return zohoFetchPageFactory(getAttachmentsForRecord(context));
2497
+ }
2498
+ /**
2499
+ * Maximum attachment size allowed by Zoho Recruit.
2500
+ *
2501
+ * 20MB
2502
+ */
2503
+ const ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE = 20 * 1024 * 1024;
2504
+ /**
2505
+ * Uploads an attachment to a record.
2506
+ *
2507
+ * https://www.zoho.com/recruit/developer-guide/apiv2/upload-attachment.html
2508
+ *
2509
+ * @param context
2510
+ * @returns
2511
+ */
2512
+ function uploadAttachmentForRecord(context) {
2513
+ return input => {
2514
+ const {
2515
+ attachmentCategoryId,
2516
+ attachmentCategoryName,
2517
+ formData
2518
+ } = input;
2519
+ const urlParams = {
2520
+ attachments_category_id: joinStringsWithCommas(attachmentCategoryId),
2521
+ attachments_category: joinStringsWithCommas(attachmentCategoryName),
2522
+ attachment_url: input.attachmentUrl
2523
+ };
2524
+ if (!urlParams.attachments_category_id?.length && !urlParams.attachments_category?.length) {
2525
+ throw new Error('attachmentCategoryId or attachmentCategoryName must be provided and not empty.');
2526
+ }
2527
+ if (formData != null) {
2528
+ delete urlParams.attachment_url;
2529
+ }
2530
+ const url = `https://recruitsandbox.zoho.com/recruit/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}?${makeUrlSearchParams(urlParams).toString()}`;
2531
+ let response;
2532
+ if (urlParams.attachment_url) {
2533
+ response = context.fetch(url, {
2534
+ method: 'POST'
2535
+ });
2536
+ } else if (formData != null) {
2537
+ throw new Error('unsupported currently. Use the attachmentUrl parameter instead.');
2538
+ // There is something weird going on with sending requests this way and zoho's server is rejecting it.
2539
+ /*
2540
+ response = context.fetch(url, {
2541
+ method: 'POST',
2542
+ headers: {
2543
+ 'Content-Type': 'multipart/form-data',
2544
+ 'content-length': '210'
2545
+ },
2546
+ body: formData
2547
+ });
2548
+ */
2549
+ /*
2550
+ const fullUrl = (context.config.apiUrl as string) + url;
2551
+ const accessToken = await context.accessTokenStringFactory();
2552
+ response = fetch(fullUrl, {
2553
+ headers: {
2554
+ Authorization: `Bearer ${accessToken}`
2555
+ },
2556
+ body: formData,
2557
+ method: 'POST'
2558
+ });
2559
+ console.log({ response });
2560
+ */
2561
+ } else {
2562
+ throw new Error('body or attachmentUrl must be provided.');
2563
+ }
2564
+ return response;
2565
+ };
2566
+ }
2567
+ /**
2568
+ * Downloads an attachment from a record.
2569
+ *
2570
+ * https://www.zoho.com/recruit/developer-guide/apiv2/download-attachments.html
2571
+ *
2572
+ * @param context
2573
+ * @returns
2574
+ */
2575
+ function downloadAttachmentForRecord(context) {
2576
+ return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2577
+ method: 'GET'
2578
+ }).then(parseFetchFileResponse);
2579
+ }
2580
+ /**
2581
+ * Deletes an attachment from a record.
2582
+ *
2583
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-attachments.html
2584
+ *
2585
+ * @param context
2586
+ * @returns
2587
+ */
2588
+ function deleteAttachmentFromRecord(context) {
2589
+ return input => context.fetch(`/v2/${input.module}/${input.id}/${ZOHO_RECRUIT_ATTACHMENTS_MODULE}/${input.attachment_id}`, {
2590
+ method: 'DELETE'
2591
+ });
2592
+ }
2485
2593
  class ZohoRecruitExecuteRestApiFunctionError extends BaseError {
2486
2594
  constructor(error) {
2487
2595
  super(`An error occured during the execution of the function. Code: ${error.code}, Message: ${error.message}`);
@@ -2933,6 +3041,7 @@ function zohoRecruitFactory(factoryConfig) {
2933
3041
  const recruitContext = {
2934
3042
  fetch,
2935
3043
  fetchJson,
3044
+ accessTokenStringFactory,
2936
3045
  config: {
2937
3046
  ...config,
2938
3047
  apiUrl
@@ -3119,4 +3228,4 @@ function zohoDateTimeString(date) {
3119
3228
  return isoDate.substring(0, isoDate.length - 5) + 'Z';
3120
3229
  }
3121
3230
 
3122
- 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_EMAILS_MODULE, ZOHO_RECRUIT_JOB_OPENINGS_MODULE, ZOHO_RECRUIT_NOTES_MODULE, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH, 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, addTagsToRecords, assertRecordDataArrayResultHasContent, associateCandidateRecordsWithJobOpenings, createNotes, createNotesForRecord, createTagsForModule, deleteNotes, deleteRecord, emptyZohoPageResult, escapeZohoFieldValueForCriteriaString, executeRestApiFunction, getEmailsForRecord, getEmailsForRecordPageFactory, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, getTagsForModule, getTagsForModulePageFactory, 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 };
3231
+ 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_ATTACHMENTS_MODULE, ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE, ZOHO_RECRUIT_CANDIDATES_MODULE, ZOHO_RECRUIT_EMAILS_MODULE, ZOHO_RECRUIT_JOB_OPENINGS_MODULE, ZOHO_RECRUIT_NOTES_MODULE, ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH, 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, addTagsToRecords, assertRecordDataArrayResultHasContent, associateCandidateRecordsWithJobOpenings, createNotes, createNotesForRecord, createTagsForModule, deleteAttachmentFromRecord, deleteNotes, deleteRecord, downloadAttachmentForRecord, emptyZohoPageResult, escapeZohoFieldValueForCriteriaString, executeRestApiFunction, getAttachmentsForRecord, getAttachmentsForRecordPageFactory, getEmailsForRecord, getEmailsForRecordPageFactory, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, getTagsForModule, getTagsForModulePageFactory, 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, uploadAttachmentForRecord, 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.3.8](https://github.com/dereekb/dbx-components/compare/v12.3.7-dev...v12.3.8) (2025-08-14)
6
+
7
+
8
+
9
+ ## [12.3.7](https://github.com/dereekb/dbx-components/compare/v12.3.6-dev...v12.3.7) (2025-08-14)
10
+
11
+
12
+
5
13
  ## [12.3.6](https://github.com/dereekb/dbx-components/compare/v12.3.5-dev...v12.3.6) (2025-08-13)
6
14
 
7
15
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho/nestjs",
3
- "version": "12.3.6",
3
+ "version": "12.3.8",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "main": "./src/index.js"
@@ -19,6 +19,11 @@ export declare class ZohoRecruitApi {
19
19
  get getRelatedRecordsFunctionFactory(): import("@dereekb/zoho").ZohoRecruitGetRelatedRecordsFunctionFactory;
20
20
  get getEmailsForRecord(): import("@dereekb/zoho").ZohoRecruitGetEmailsForRecordFunction;
21
21
  get getEmailsForRecordPageFactory(): import("@dereekb/zoho").GetEmailsForRecordPageFactory;
22
+ get getAttachmentsForRecord(): import("@dereekb/zoho").ZohoRecruitGetAttachmentsForRecordFunction;
23
+ get getAttachmentsForRecordPageFactory(): import("@dereekb/zoho").GetAttachmentsForRecordPageFactory;
24
+ get uploadAttachmentForRecord(): import("@dereekb/zoho").ZohoRecruitUploadAttachmentForRecordFunction;
25
+ get downloadAttachmentForRecord(): import("@dereekb/zoho").ZohoRecruitDownloadAttachmentForRecordFunction;
26
+ get deleteAttachmentFromRecord(): import("@dereekb/zoho").ZohoRecruitDeleteAttachmentFromRecordFunction;
22
27
  get createNotes(): (input: import("@dereekb/zoho").ZohoRecruitCreateNotesRequest) => Promise<import("@dereekb/zoho").ZohoRecruitMultiRecordResult<import("@dereekb/zoho").NewZohoRecruitNoteData, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoRecruitChangeObjectDetails>, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseErrorEntry>>;
23
28
  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>>;
24
29
  get createNotesForRecord(): import("@dereekb/zoho").ZohoRecruitCreateNotesForRecordFunction;
@@ -58,6 +58,21 @@ let ZohoRecruitApi = class ZohoRecruitApi {
58
58
  get getEmailsForRecordPageFactory() {
59
59
  return (0, zoho_1.getEmailsForRecordPageFactory)(this.recruitContext);
60
60
  }
61
+ get getAttachmentsForRecord() {
62
+ return (0, zoho_1.getAttachmentsForRecord)(this.recruitContext);
63
+ }
64
+ get getAttachmentsForRecordPageFactory() {
65
+ return (0, zoho_1.getAttachmentsForRecordPageFactory)(this.recruitContext);
66
+ }
67
+ get uploadAttachmentForRecord() {
68
+ return (0, zoho_1.uploadAttachmentForRecord)(this.recruitContext);
69
+ }
70
+ get downloadAttachmentForRecord() {
71
+ return (0, zoho_1.downloadAttachmentForRecord)(this.recruitContext);
72
+ }
73
+ get deleteAttachmentFromRecord() {
74
+ return (0, zoho_1.deleteAttachmentFromRecord)(this.recruitContext);
75
+ }
61
76
  get createNotes() {
62
77
  return (0, zoho_1.createNotes)(this.recruitContext);
63
78
  }
@@ -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,wCA6BuB;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;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I,gBAAgB;QAClB,OAAO,IAAA,uBAAgB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAzHY,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,CAyH1B"}
1
+ {"version":3,"file":"recruit.api.js","sourceRoot":"","sources":["../../../../../../../packages/zoho/nestjs/src/lib/recruit/recruit.api.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,wCAkCuB;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,C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,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAA,uBAAgB,EAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AA7IY,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,CA6I1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho",
3
- "version": "12.3.6",
3
+ "version": "12.3.8",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -1,9 +1,9 @@
1
1
  import { ZohoDataArrayResultRef, ZohoPageFilter, ZohoPageResult } from './../zoho.api.page';
2
- import { FetchJsonBody, FetchJsonInput, FetchPage, FetchPageFactory, FetchPageFactoryOptions, makeUrlSearchParams } from '@dereekb/util/fetch';
2
+ import { FetchFileResponse, FetchJsonBody, FetchJsonInput, FetchPage, FetchPageFactory, FetchPageFactoryOptions, makeUrlSearchParams } from '@dereekb/util/fetch';
3
3
  import { ZohoRecruitConfigApiUrlInput, ZohoRecruitContext } from './recruit.config';
4
- import { ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitRestFunctionApiName, ZohoRecruitUserId, ZohoRecruitModuleName, ZohoRecruitRecordEmailMetadata } from './recruit';
4
+ import { ZohoRecruitCommaSeparateFieldNames, ZohoRecruitCustomViewId, ZohoRecruitDraftOrSaveState, ZohoRecruitFieldName, ZohoRecruitModuleNameRef, ZohoRecruitChangeObjectDetails, ZohoRecruitRecord, ZohoRecruitRecordId, ZohoRecruitTerritoryId, ZohoRecruitTrueFalseBoth, ZohoRecruitRestFunctionApiName, ZohoRecruitUserId, ZohoRecruitModuleName, ZohoRecruitRecordEmailMetadata, ZohoRecruitRecordAttachmentMetadata, ZohoRecruitAttachmentRecordId, ZohoRecruitAttachmentCategoryId, KnownZohoRecruitAttachmentCategoryName } from './recruit';
5
5
  import { ZohoRecruitSearchRecordsCriteriaTreeElement } from './recruit.criteria';
6
- import { ArrayOrValue, EmailAddress, Maybe, PhoneNumber, SortingOrder, UniqueModelWithId } from '@dereekb/util';
6
+ import { ArrayOrValue, EmailAddress, Maybe, PhoneNumber, SortingOrder, UniqueModelWithId, WebsiteUrlWithPrefix } from '@dereekb/util';
7
7
  import { ZohoServerErrorDataWithDetails, ZohoServerErrorStatus, ZohoServerSuccessCode, ZohoServerSuccessStatus } from '../zoho.error.api';
8
8
  import { ZohoDateTimeString } from '../zoho.type';
9
9
  import { BaseError } from 'make-error';
@@ -203,6 +203,87 @@ export type ZohoRecruitGetEmailsForRecordFunction = (input: ZohoRecruitGetEmails
203
203
  export declare function getEmailsForRecord(context: ZohoRecruitContext): ZohoRecruitGetEmailsForRecordFunction;
204
204
  export type GetEmailsForRecordPageFactory = FetchPageFactory<ZohoRecruitGetEmailsForRecordRequest, ZohoRecruitGetEmailsForRecordResponse>;
205
205
  export declare function getEmailsForRecordPageFactory(context: ZohoRecruitContext): GetEmailsForRecordPageFactory;
206
+ export type ZohoRecruitGetAttachmentsForRecordRequest = ZohoRecruitGetRelatedRecordsRequest;
207
+ export type ZohoRecruitGetAttachmentsForRecordResponse = ZohoPageResult<ZohoRecruitRecordAttachmentMetadata>;
208
+ export type ZohoRecruitGetAttachmentsForRecordFunction = (input: ZohoRecruitGetAttachmentsForRecordRequest) => Promise<ZohoRecruitGetAttachmentsForRecordResponse>;
209
+ export declare function getAttachmentsForRecord(context: ZohoRecruitContext): ZohoRecruitGetAttachmentsForRecordFunction;
210
+ export type GetAttachmentsForRecordPageFactory = FetchPageFactory<ZohoRecruitGetAttachmentsForRecordRequest, ZohoRecruitGetAttachmentsForRecordResponse>;
211
+ export declare function getAttachmentsForRecordPageFactory(context: ZohoRecruitContext): GetAttachmentsForRecordPageFactory;
212
+ /**
213
+ * Maximum attachment size allowed by Zoho Recruit.
214
+ *
215
+ * 20MB
216
+ */
217
+ export declare const ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE: number;
218
+ export interface ZohoRecruitUploadAttachmentForRecordRequest extends ZohoRecruitGetRecordByIdInput {
219
+ /**
220
+ * Requires the use of a FormData object.
221
+ *
222
+ * Max of 20MB are allowed
223
+ *
224
+ * @deprecated Use attachmentUrl instead for now.
225
+ */
226
+ readonly formData?: FormData;
227
+ /**
228
+ * File url to pull the file from.
229
+ *
230
+ * Either this or formData must be provided.
231
+ */
232
+ readonly attachmentUrl?: WebsiteUrlWithPrefix;
233
+ /**
234
+ * The category id(s) of the attachment.
235
+ *
236
+ * Either this or attachments_category must be provided.
237
+ */
238
+ readonly attachmentCategoryId?: ArrayOrValue<ZohoRecruitAttachmentCategoryId>;
239
+ /**
240
+ * The category name(s) of the attachment.
241
+ *
242
+ * Either this or attachments_category_id must be provided.
243
+ *
244
+ * Example: "Resume"
245
+ */
246
+ readonly attachmentCategoryName?: ArrayOrValue<KnownZohoRecruitAttachmentCategoryName>;
247
+ }
248
+ export type ZohoRecruitUploadAttachmentForRecordResponse = Response;
249
+ export type ZohoRecruitUploadAttachmentForRecordFunction = (input: ZohoRecruitUploadAttachmentForRecordRequest) => Promise<ZohoRecruitUploadAttachmentForRecordResponse>;
250
+ /**
251
+ * Uploads an attachment to a record.
252
+ *
253
+ * https://www.zoho.com/recruit/developer-guide/apiv2/upload-attachment.html
254
+ *
255
+ * @param context
256
+ * @returns
257
+ */
258
+ export declare function uploadAttachmentForRecord(context: ZohoRecruitContext): ZohoRecruitUploadAttachmentForRecordFunction;
259
+ export interface ZohoRecruitDownloadAttachmentForRecordRequest extends ZohoRecruitGetRecordByIdInput {
260
+ readonly attachment_id: ZohoRecruitAttachmentRecordId;
261
+ }
262
+ export type ZohoRecruitDownloadAttachmentForRecordResponse = FetchFileResponse;
263
+ export type ZohoRecruitDownloadAttachmentForRecordFunction = (input: ZohoRecruitDownloadAttachmentForRecordRequest) => Promise<ZohoRecruitDownloadAttachmentForRecordResponse>;
264
+ /**
265
+ * Downloads an attachment from a record.
266
+ *
267
+ * https://www.zoho.com/recruit/developer-guide/apiv2/download-attachments.html
268
+ *
269
+ * @param context
270
+ * @returns
271
+ */
272
+ export declare function downloadAttachmentForRecord(context: ZohoRecruitContext): ZohoRecruitDownloadAttachmentForRecordFunction;
273
+ export interface ZohoRecruitDeleteAttachmentFromRecordRequest extends ZohoRecruitGetRecordByIdInput {
274
+ readonly attachment_id: ZohoRecruitAttachmentRecordId;
275
+ }
276
+ export type ZohoRecruitDeleteAttachmentFromRecordResponse = Response;
277
+ export type ZohoRecruitDeleteAttachmentFromRecordFunction = (input: ZohoRecruitDeleteAttachmentFromRecordRequest) => Promise<ZohoRecruitDeleteAttachmentFromRecordResponse>;
278
+ /**
279
+ * Deletes an attachment from a record.
280
+ *
281
+ * https://www.zoho.com/recruit/developer-guide/apiv2/delete-attachments.html
282
+ *
283
+ * @param context
284
+ * @returns
285
+ */
286
+ export declare function deleteAttachmentFromRecord(context: ZohoRecruitContext): ZohoRecruitDeleteAttachmentFromRecordFunction;
206
287
  export type ZohoRecruitExecuteRestApiFunctionRequest = ZohoRecruitExecuteRestApiFunctionNormalRequest | ZohoRecruitExecuteRestApiFunctionApiSpecificRequest;
207
288
  export interface ZohoRecruitExecuteRestApiFunctionNormalRequest {
208
289
  readonly functionName: ZohoRecruitRestFunctionApiName;
@@ -1,7 +1,7 @@
1
1
  import { FactoryWithRequiredInput } from '@dereekb/util';
2
2
  import { ConfiguredFetch, FetchJsonFunction } from '@dereekb/util/fetch';
3
3
  import { ZohoApiUrl, ZohoApiUrlKey, ZohoConfig, ZohoApiServiceName } from '../zoho.config';
4
- import { ZohoServiceAccessTokenKey } from '../accounts';
4
+ import { ZohoAccessTokenStringFactory, ZohoServiceAccessTokenKey } from '../accounts';
5
5
  import { ZohoRateLimiterRef } from '../zoho.limit';
6
6
  export declare const ZOHO_RECRUIT_SERVICE_NAME: ZohoApiServiceName | ZohoServiceAccessTokenKey;
7
7
  export type ZohoRecruitApiUrl = ZohoApiUrl;
@@ -16,6 +16,7 @@ export type ZohoRecruitFetchFactory = FactoryWithRequiredInput<ConfiguredFetch,
16
16
  export interface ZohoRecruitContext extends ZohoRateLimiterRef {
17
17
  readonly fetch: ConfiguredFetch;
18
18
  readonly fetchJson: FetchJsonFunction;
19
+ readonly accessTokenStringFactory: ZohoAccessTokenStringFactory;
19
20
  readonly config: ZohoRecruitConfig;
20
21
  }
21
22
  export interface ZohoRecruitContextRef {
@@ -21,6 +21,10 @@ export declare const ZOHO_RECRUIT_NOTES_MODULE = "Notes";
21
21
  * Emails module name
22
22
  */
23
23
  export declare const ZOHO_RECRUIT_EMAILS_MODULE = "Emails";
24
+ /**
25
+ * Attachments module name
26
+ */
27
+ export declare const ZOHO_RECRUIT_ATTACHMENTS_MODULE = "Attachments";
24
28
  /**
25
29
  * Contains a reference to a module.
26
30
  */
@@ -183,6 +187,109 @@ export type ZohoRecruitRecordEmailMetadataStatusType = 'sent' | string;
183
187
  export interface ZohoRecruitRecordEmailMetadataStatus {
184
188
  type: ZohoRecruitRecordEmailMetadataStatusType;
185
189
  }
190
+ export declare const ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = "Resume";
191
+ export interface ZohoRecruitRecordAttachmentMetadataAttachType extends ZohoRecruitReferenceData {
192
+ name: typeof ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME | string;
193
+ }
194
+ /**
195
+ * Record id for an attachment.
196
+ */
197
+ export type ZohoRecruitAttachmentRecordId = ZohoRecruitRecordId;
198
+ /**
199
+ * The size of the attachment in bytes, stored as a string.
200
+ */
201
+ export type ZohoRecruitRecordAttachmentMetadataSize = string;
202
+ /**
203
+ * Attachment category id
204
+ */
205
+ export type ZohoRecruitAttachmentCategoryId = string;
206
+ /**
207
+ * Known attachment category names
208
+ */
209
+ export type KnownZohoRecruitAttachmentCategoryName = 'Resume' | 'Offer' | 'Contracts' | 'Criminal records' | 'Mandatory reporter' | 'Teaching certification' | 'Health records' | 'Others' | 'Cover Letter' | 'Formatted Resume';
210
+ /**
211
+ * Attachment category name
212
+ *
213
+ * I.E. "Resume"
214
+ */
215
+ export type ZohoRecruitAttachmentCategoryName = KnownZohoRecruitAttachmentCategoryName | string;
216
+ /**
217
+ * Metadata for a record's attachment.
218
+ */
219
+ export interface ZohoRecruitRecordAttachmentMetadata {
220
+ /**
221
+ * The type of attachment
222
+ */
223
+ $attach_type: ZohoRecruitRecordAttachmentMetadataAttachType;
224
+ /**
225
+ * Last time the attachment was modified
226
+ */
227
+ Modified_Time: ISO8601DateString;
228
+ /**
229
+ * The category of the attachment
230
+ */
231
+ Category: ZohoRecruitRecordAttachmentMetadataAttachType;
232
+ /**
233
+ * The name of the attachment
234
+ */
235
+ File_Name: string;
236
+ /**
237
+ * The size of the attachment in bytes, stored as a string.
238
+ */
239
+ Size: ZohoRecruitRecordAttachmentMetadataSize;
240
+ /**
241
+ * The time the attachment was created
242
+ */
243
+ Created_Time: ISO8601DateString;
244
+ /**
245
+ * The parent record id for this attachment
246
+ */
247
+ Parent_Id: ZohoRecruitRecordId;
248
+ /**
249
+ * Owner of the attachment
250
+ */
251
+ Attachment_Owner: ZohoRecruitUserReferenceData;
252
+ /**
253
+ * Internal file identifier for the attachment
254
+ */
255
+ $file_id: string;
256
+ /**
257
+ * Type marker (e.g., "Attachment")
258
+ */
259
+ $type: 'Attachment' | string;
260
+ /**
261
+ * Direct URL to the attachment, when available
262
+ */
263
+ Attachment_URL: string | null;
264
+ /**
265
+ * User who last modified this attachment
266
+ */
267
+ Modified_By: ZohoRecruitUserReferenceData;
268
+ /**
269
+ * Attachment record id
270
+ */
271
+ id: ZohoRecruitAttachmentRecordId;
272
+ /**
273
+ * User who created this attachment
274
+ */
275
+ Created_By: ZohoRecruitUserReferenceData;
276
+ /**
277
+ * Whether the attachment is editable
278
+ */
279
+ $editable: boolean;
280
+ /**
281
+ * Module this attachment belongs to (e.g., Candidates)
282
+ */
283
+ $se_module: ZohoRecruitModuleName;
284
+ /**
285
+ * Link URL when the attachment is a link
286
+ */
287
+ $link_url?: string | null;
288
+ /**
289
+ * Number of linked documents
290
+ */
291
+ $link_docs: number;
292
+ }
186
293
  /**
187
294
  * Update details returned by the server for an updated record.
188
295
  *