@dereekb/zoho 13.3.1 → 13.4.1
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 +292 -95
- package/index.esm.js +292 -96
- package/nestjs/docs/zoho-sign-webhooks.md +202 -0
- package/nestjs/index.cjs.js +1379 -219
- package/nestjs/index.esm.js +1374 -222
- package/nestjs/package.json +6 -4
- package/nestjs/src/lib/accounts/accounts.service.d.ts +14 -2
- package/nestjs/src/lib/crm/crm.api.d.ts +142 -27
- package/nestjs/src/lib/crm/crm.config.d.ts +2 -0
- package/nestjs/src/lib/recruit/recruit.api.d.ts +162 -31
- package/nestjs/src/lib/recruit/recruit.config.d.ts +2 -0
- package/nestjs/src/lib/sign/index.d.ts +1 -0
- package/nestjs/src/lib/sign/sign.api.d.ts +67 -12
- package/nestjs/src/lib/sign/webhook/index.d.ts +6 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.config.d.ts +11 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.controller.d.ts +8 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.d.ts +127 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.module.d.ts +13 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.service.d.ts +16 -0
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.verify.d.ts +45 -0
- package/nestjs/src/lib/zoho.config.d.ts +26 -2
- package/package.json +4 -2
- package/src/lib/accounts/accounts.api.d.ts +9 -5
- package/src/lib/accounts/accounts.config.d.ts +12 -2
- package/src/lib/accounts/accounts.d.ts +6 -3
- package/src/lib/accounts/accounts.error.api.d.ts +13 -0
- package/src/lib/accounts/accounts.factory.d.ts +2 -2
- package/src/lib/crm/crm.api.d.ts +13 -0
- package/src/lib/crm/crm.api.notes.d.ts +15 -0
- package/src/lib/crm/crm.api.tags.d.ts +17 -8
- package/src/lib/crm/crm.config.d.ts +9 -2
- package/src/lib/crm/crm.d.ts +12 -12
- package/src/lib/crm/crm.error.api.d.ts +14 -0
- package/src/lib/crm/crm.factory.d.ts +3 -3
- package/src/lib/crm/crm.notes.d.ts +23 -23
- package/src/lib/crm/crm.tags.d.ts +3 -3
- package/src/lib/recruit/recruit.api.candidates.d.ts +19 -0
- package/src/lib/recruit/recruit.api.d.ts +10 -0
- package/src/lib/recruit/recruit.config.d.ts +9 -2
- package/src/lib/recruit/recruit.d.ts +12 -12
- package/src/lib/recruit/recruit.error.api.d.ts +14 -0
- package/src/lib/recruit/recruit.factory.d.ts +3 -3
- package/src/lib/sign/sign.config.d.ts +12 -2
- package/src/lib/sign/sign.d.ts +14 -14
- package/src/lib/sign/sign.error.api.d.ts +13 -0
- package/src/lib/sign/sign.factory.d.ts +3 -3
- package/src/lib/zoho.error.api.d.ts +25 -8
- package/src/lib/zoho.limit.d.ts +8 -1
package/src/lib/crm/crm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
1
|
+
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type Maybe, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* Zoho CRM module name.
|
|
4
4
|
*
|
|
@@ -108,15 +108,15 @@ export type ZohoCrmCommaSeparateFieldNames = CommaSeparatedString;
|
|
|
108
108
|
export type ZohoCrmDraftOrSaveState = 'draft' | 'save';
|
|
109
109
|
export type ZohoCrmTrueFalseBoth = 'true' | 'false' | 'both';
|
|
110
110
|
export interface ZohoCrmReferenceData {
|
|
111
|
-
name: string;
|
|
112
|
-
id: ZohoCrmId;
|
|
111
|
+
readonly name: string;
|
|
112
|
+
readonly id: ZohoCrmId;
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Reference pair of a Zoho Crm user name and id
|
|
116
116
|
*/
|
|
117
117
|
export interface ZohoCrmUserReferenceData {
|
|
118
|
-
name: string;
|
|
119
|
-
id: ZohoCrmUserId;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly id: ZohoCrmUserId;
|
|
120
120
|
}
|
|
121
121
|
export interface ZohoCrmReferenceDataWithModule extends ZohoCrmReferenceData, ZohoCrmModuleNameRef {
|
|
122
122
|
}
|
|
@@ -138,11 +138,11 @@ export type ZohoCrmValidUrl = WebsiteUrl;
|
|
|
138
138
|
* Update details returned by the server for a created/updated object.
|
|
139
139
|
*/
|
|
140
140
|
export interface ZohoCrmChangeObjectDetails {
|
|
141
|
-
id: ZohoCrmRecordId;
|
|
142
|
-
Modified_Time: ISO8601DateString;
|
|
143
|
-
Modified_By: ZohoCrmCreatedByData;
|
|
144
|
-
Created_Time: ISO8601DateString;
|
|
145
|
-
Created_By: ZohoCrmCreatedByData;
|
|
141
|
+
readonly id: ZohoCrmRecordId;
|
|
142
|
+
readonly Modified_Time: ISO8601DateString;
|
|
143
|
+
readonly Modified_By: ZohoCrmCreatedByData;
|
|
144
|
+
readonly Created_Time: ISO8601DateString;
|
|
145
|
+
readonly Created_By: ZohoCrmCreatedByData;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Base Zoho Crm field data type.
|
|
@@ -287,7 +287,7 @@ export interface ZohoCrmRecordAttachmentMetadata {
|
|
|
287
287
|
/**
|
|
288
288
|
* Direct URL to the attachment, when available
|
|
289
289
|
*/
|
|
290
|
-
Attachment_URL:
|
|
290
|
+
Attachment_URL: Maybe<WebsiteUrl>;
|
|
291
291
|
/**
|
|
292
292
|
* User who last modified this attachment
|
|
293
293
|
*/
|
|
@@ -311,7 +311,7 @@ export interface ZohoCrmRecordAttachmentMetadata {
|
|
|
311
311
|
/**
|
|
312
312
|
* Link URL when the attachment is a link
|
|
313
313
|
*/
|
|
314
|
-
$link_url?:
|
|
314
|
+
$link_url?: Maybe<WebsiteUrl>;
|
|
315
315
|
/**
|
|
316
316
|
* Number of linked documents
|
|
317
317
|
*/
|
|
@@ -66,10 +66,17 @@ export declare class ZohoCrmRecordCrudNoMatchingRecordError extends ZohoCrmRecor
|
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Maps a Zoho CRM server error to the appropriate typed {@link ZohoCrmRecordCrudError} subclass based on the error code and affected field.
|
|
69
|
+
*
|
|
70
|
+
* @param error - The server error data containing the error code and field details
|
|
71
|
+
* @returns The appropriate typed CRM CRUD error instance
|
|
69
72
|
*/
|
|
70
73
|
export declare function zohoCrmRecordCrudError(error: ZohoServerErrorDataWithDetails): ZohoCrmRecordCrudError;
|
|
71
74
|
/**
|
|
72
75
|
* Returns an assertion function that throws {@link ZohoCrmRecordNoContentError} when a data array result is empty or null, typically indicating a missing record.
|
|
76
|
+
*
|
|
77
|
+
* @param moduleName - Optional CRM module name for the error context
|
|
78
|
+
* @param recordId - Optional record ID for the error context
|
|
79
|
+
* @returns Assertion function that throws if the data array is empty
|
|
73
80
|
*/
|
|
74
81
|
export declare function assertZohoCrmRecordDataArrayResultHasContent<T>(moduleName?: ZohoCrmModuleName, recordId?: ZohoCrmRecordId): <R extends ZohoDataArrayResultRef<T>>(x: R) => R;
|
|
75
82
|
/**
|
|
@@ -78,10 +85,17 @@ export declare function assertZohoCrmRecordDataArrayResultHasContent<T>(moduleNa
|
|
|
78
85
|
export declare const logZohoCrmErrorToConsole: import("..").LogZohoServerErrorFunction;
|
|
79
86
|
/**
|
|
80
87
|
* Parses a fetch response error into a typed Zoho CRM server error by extracting and interpreting the JSON error body.
|
|
88
|
+
*
|
|
89
|
+
* @param responseError - The fetch response error to parse
|
|
90
|
+
* @returns The parsed Zoho server error, or undefined if the response could not be parsed
|
|
81
91
|
*/
|
|
82
92
|
export declare function parseZohoCrmError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
83
93
|
/**
|
|
84
94
|
* Parses a Zoho CRM error response body into a typed error. Delegates to CRM-specific error code handling before falling back to the generic Zoho error parser.
|
|
95
|
+
*
|
|
96
|
+
* @param errorResponseData - The raw error response data from the Zoho CRM API
|
|
97
|
+
* @param responseError - The original fetch response error for context
|
|
98
|
+
* @returns The parsed Zoho server error, or undefined if the error could not be classified
|
|
85
99
|
*/
|
|
86
100
|
export declare function parseZohoCrmServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData | ZohoServerErrorResponseDataArrayRef, responseError: FetchResponseError): ParsedZohoServerError;
|
|
87
101
|
/**
|
|
@@ -15,16 +15,16 @@ export interface ZohoCrmFactoryConfig extends ZohoAccountsContextRef {
|
|
|
15
15
|
/**
|
|
16
16
|
* Custom rate limiter configuration to control request concurrency and throttling.
|
|
17
17
|
*/
|
|
18
|
-
rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
18
|
+
readonly rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
19
19
|
/**
|
|
20
20
|
* Custom fetch factory for creating the underlying HTTP client.
|
|
21
21
|
* Defaults to a standard fetch service with OAuth Bearer token headers and a 20-second timeout.
|
|
22
22
|
*/
|
|
23
|
-
fetchFactory?: ZohoCrmFetchFactory;
|
|
23
|
+
readonly fetchFactory?: ZohoCrmFetchFactory;
|
|
24
24
|
/**
|
|
25
25
|
* Custom error logging function invoked when Zoho API errors are encountered.
|
|
26
26
|
*/
|
|
27
|
-
logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
27
|
+
readonly logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Factory function that creates a {@link ZohoCrm} client from a {@link ZohoCrmConfig}.
|
|
@@ -8,7 +8,7 @@ export type ZohoCrmNoteId = string;
|
|
|
8
8
|
* Metadata describing whether the note action was triggered by the system.
|
|
9
9
|
*/
|
|
10
10
|
export interface ZohoCrmNoteAction {
|
|
11
|
-
$is_system_action: boolean;
|
|
11
|
+
readonly $is_system_action: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Known source name indicating the note was created by a normal user.
|
|
@@ -22,8 +22,8 @@ export type ZohoCrmNoteSourceType = number;
|
|
|
22
22
|
* Describes the origin of a note, including who or what created it.
|
|
23
23
|
*/
|
|
24
24
|
export interface ZohoCrmNoteSource {
|
|
25
|
-
name: ZohoCrmNoteSourceName;
|
|
26
|
-
type: ZohoCrmNoteSourceType;
|
|
25
|
+
readonly name: ZohoCrmNoteSourceName;
|
|
26
|
+
readonly type: ZohoCrmNoteSourceType;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Reference data identifying the owner of a note.
|
|
@@ -33,26 +33,26 @@ export type ZohoCrmNoteOwnerData = ZohoCrmReferenceData;
|
|
|
33
33
|
* Full data shape for a CRM note as returned by the API, including metadata fields like permissions, source, and timestamps.
|
|
34
34
|
*/
|
|
35
35
|
export interface ZohoCrmNoteData {
|
|
36
|
-
Note_Title: string;
|
|
37
|
-
Note_Content: string;
|
|
38
|
-
Parent_Id: ZohoCrmParentReferenceData;
|
|
39
|
-
Created_Time: ISO8601DateString;
|
|
40
|
-
Modified_Time: ISO8601DateString;
|
|
41
|
-
$attachments: null;
|
|
42
|
-
$is_edit_allowed: boolean;
|
|
43
|
-
$editable: boolean;
|
|
44
|
-
$type_id: ZohoCrmTypeId;
|
|
45
|
-
$is_delete_allowed: boolean;
|
|
46
|
-
$note_action: ZohoCrmNoteAction;
|
|
47
|
-
$source: ZohoCrmNoteSource;
|
|
48
|
-
$se_module: ZohoCrmModuleName;
|
|
49
|
-
$is_shared_to_client: boolean;
|
|
50
|
-
Note_Owner: ZohoCrmNoteOwnerData;
|
|
51
|
-
Created_By: ZohoCrmCreatedByData;
|
|
52
|
-
Modified_By: ZohoCrmModifiedByData;
|
|
53
|
-
$size: ZohoCrmNoteFileSize | null;
|
|
54
|
-
$voice_note: boolean;
|
|
55
|
-
$status: ZohoCrmNoteStatus;
|
|
36
|
+
readonly Note_Title: string;
|
|
37
|
+
readonly Note_Content: string;
|
|
38
|
+
readonly Parent_Id: ZohoCrmParentReferenceData;
|
|
39
|
+
readonly Created_Time: ISO8601DateString;
|
|
40
|
+
readonly Modified_Time: ISO8601DateString;
|
|
41
|
+
readonly $attachments: null;
|
|
42
|
+
readonly $is_edit_allowed: boolean;
|
|
43
|
+
readonly $editable: boolean;
|
|
44
|
+
readonly $type_id: ZohoCrmTypeId;
|
|
45
|
+
readonly $is_delete_allowed: boolean;
|
|
46
|
+
readonly $note_action: ZohoCrmNoteAction;
|
|
47
|
+
readonly $source: ZohoCrmNoteSource;
|
|
48
|
+
readonly $se_module: ZohoCrmModuleName;
|
|
49
|
+
readonly $is_shared_to_client: boolean;
|
|
50
|
+
readonly Note_Owner: ZohoCrmNoteOwnerData;
|
|
51
|
+
readonly Created_By: ZohoCrmCreatedByData;
|
|
52
|
+
readonly Modified_By: ZohoCrmModifiedByData;
|
|
53
|
+
readonly $size: ZohoCrmNoteFileSize | null;
|
|
54
|
+
readonly $voice_note: boolean;
|
|
55
|
+
readonly $status: ZohoCrmNoteStatus;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Data required to create a new note, including the parent record reference and target module.
|
|
@@ -22,14 +22,14 @@ export type ZohoCrmTagColorCode = HexColorCode;
|
|
|
22
22
|
* The color and name of a Tag in Zoho Crm.
|
|
23
23
|
*/
|
|
24
24
|
export interface ZohoCrmTagData {
|
|
25
|
-
color_code?: Maybe<ZohoCrmTagColorCode>;
|
|
26
|
-
name: ZohoCrmTagName;
|
|
25
|
+
readonly color_code?: Maybe<ZohoCrmTagColorCode>;
|
|
26
|
+
readonly name: ZohoCrmTagName;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Includes the id of the Tag along with other tag data.
|
|
30
30
|
*/
|
|
31
31
|
export interface ZohoCrmTag extends ZohoCrmTagData {
|
|
32
|
-
id: ZohoCrmTagId;
|
|
32
|
+
readonly id: ZohoCrmTagId;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* ZohoCrmTag that also has ZohoCrmChangeObjectDetails
|
|
@@ -59,6 +59,9 @@ export type ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction = (input
|
|
|
59
59
|
*
|
|
60
60
|
* The result separates "already associated" errors from other errors, allowing callers to treat duplicate associations as non-fatal.
|
|
61
61
|
*
|
|
62
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
63
|
+
* @returns Factory function that associates candidates with job openings
|
|
64
|
+
*
|
|
62
65
|
* https://www.zoho.com/recruit/developer-guide/apiv2/associate-candidate.html
|
|
63
66
|
*/
|
|
64
67
|
export declare function zohoRecruitAssociateCandidateRecordsWithJobOpenings(context: ZohoRecruitContext): ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction;
|
|
@@ -80,6 +83,9 @@ export type ZohoRecruitSearchAssociatedRecordsResponse<T = ZohoRecruitRecord> =
|
|
|
80
83
|
export type ZohoRecruitSearchAssociatedRecordsFunction<R extends ZohoRecruitSearchAssociatedRecordsResponse> = (input: ZohoRecruitSearchAssociatedRecordsInput) => Promise<R>;
|
|
81
84
|
/**
|
|
82
85
|
* Searches for records associated with a given candidate or job opening. Returns an empty page result when no records are found.
|
|
86
|
+
*
|
|
87
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
88
|
+
* @returns Factory function that searches for associated records
|
|
83
89
|
*/
|
|
84
90
|
export declare function zohoRecruitSearchAssociatedRecords<R extends ZohoRecruitSearchAssociatedRecordsResponse>(context: ZohoRecruitContext): ZohoRecruitSearchAssociatedRecordsFunction<R>;
|
|
85
91
|
/**
|
|
@@ -89,10 +95,16 @@ export type ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput = Omit<Zo
|
|
|
89
95
|
export type ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<T extends ZohoRecruitRecord> = (input: ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput) => Promise<ZohoRecruitSearchAssociatedRecordsResponse<T>>;
|
|
90
96
|
/**
|
|
91
97
|
* Searches for job openings associated with a specific candidate.
|
|
98
|
+
*
|
|
99
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
100
|
+
* @returns Factory function that searches for job openings associated with a candidate
|
|
92
101
|
*/
|
|
93
102
|
export declare function zohoRecruitSearchCandidateAssociatedJobOpeningRecords<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<T>;
|
|
94
103
|
/**
|
|
95
104
|
* Creates a page factory for paginating over job openings associated with a candidate.
|
|
105
|
+
*
|
|
106
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
107
|
+
* @returns Page factory for iterating through associated job openings
|
|
96
108
|
*/
|
|
97
109
|
export declare function zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): import("@dereekb/util/fetch").FetchPageFactory<ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput, ZohoRecruitSearchAssociatedRecordsResponse<T>>;
|
|
98
110
|
/**
|
|
@@ -102,9 +114,16 @@ export type ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput = Omit<Zo
|
|
|
102
114
|
export type ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<T extends ZohoRecruitRecord> = (input: ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput) => Promise<ZohoRecruitSearchAssociatedRecordsResponse<T>>;
|
|
103
115
|
/**
|
|
104
116
|
* Searches for candidates associated with a specific job opening.
|
|
117
|
+
*
|
|
118
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
119
|
+
* @param jobOpeningModuleName - Module name for job openings, defaults to the standard module
|
|
120
|
+
* @returns Factory function that searches for candidates associated with a job opening
|
|
105
121
|
*/
|
|
106
122
|
export declare function zohoRecruitSearchJobOpeningAssociatedCandidateRecords<T extends ZohoRecruitRecord>(context: ZohoRecruitContext, jobOpeningModuleName?: string): ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<T>;
|
|
107
123
|
/**
|
|
108
124
|
* Creates a page factory for paginating over candidates associated with a job opening.
|
|
125
|
+
*
|
|
126
|
+
* @param context - Zoho Recruit API context providing fetch and authentication
|
|
127
|
+
* @returns Page factory for iterating through associated candidates
|
|
109
128
|
*/
|
|
110
129
|
export declare function zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory<T extends ZohoRecruitRecord>(context: ZohoRecruitContext): import("@dereekb/util/fetch").FetchPageFactory<ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput, ZohoRecruitSearchAssociatedRecordsResponse<T>>;
|
|
@@ -933,10 +933,16 @@ export type ZohoRecruitExecuteRestApiFunctionFunction = (input: ZohoRecruitExecu
|
|
|
933
933
|
export declare function zohoRecruitExecuteRestApiFunction(context: ZohoRecruitContext): ZohoRecruitExecuteRestApiFunctionFunction;
|
|
934
934
|
/**
|
|
935
935
|
* Builds URL search params from input objects, omitting the `module` key since it is used in the URL path rather than query string.
|
|
936
|
+
*
|
|
937
|
+
* @param input - One or more objects whose key-value pairs become query parameters
|
|
938
|
+
* @returns URLSearchParams with the `module` key excluded
|
|
936
939
|
*/
|
|
937
940
|
export declare function zohoRecruitUrlSearchParamsMinusModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
|
|
938
941
|
/**
|
|
939
942
|
* Builds URL search params from input objects, omitting both `id` and `module` keys since they are used in the URL path.
|
|
943
|
+
*
|
|
944
|
+
* @param input - One or more objects whose key-value pairs become query parameters
|
|
945
|
+
* @returns URLSearchParams with `id` and `module` keys excluded
|
|
940
946
|
*/
|
|
941
947
|
export declare function zohoRecruitUrlSearchParamsMinusIdAndModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
|
|
942
948
|
/**
|
|
@@ -945,6 +951,10 @@ export declare function zohoRecruitUrlSearchParamsMinusIdAndModule(...input: May
|
|
|
945
951
|
export declare const zohoRecruitUrlSearchParams: typeof makeUrlSearchParams;
|
|
946
952
|
/**
|
|
947
953
|
* Constructs a standard {@link FetchJsonInput} for Zoho Recruit API calls with the given HTTP method and optional body.
|
|
954
|
+
*
|
|
955
|
+
* @param method - HTTP method for the request
|
|
956
|
+
* @param body - Optional JSON body to include in the request
|
|
957
|
+
* @returns Configured fetch JSON input
|
|
948
958
|
*/
|
|
949
959
|
export declare function zohoRecruitApiFetchJsonInput(method: string, body?: Maybe<FetchJsonBody>): FetchJsonInput;
|
|
950
960
|
/**
|
|
@@ -21,6 +21,9 @@ export type ZohoRecruitApiUrlKey = ZohoApiUrlKey;
|
|
|
21
21
|
export type ZohoRecruitConfigApiUrlInput = ZohoRecruitApiUrlKey | ZohoRecruitApiUrl;
|
|
22
22
|
/**
|
|
23
23
|
* Resolves an environment key or passthrough URL to the full Zoho Recruit API URL.
|
|
24
|
+
*
|
|
25
|
+
* @param input - An environment key ('sandbox' or 'production') or a full API URL
|
|
26
|
+
* @returns The resolved Zoho Recruit API URL
|
|
24
27
|
*/
|
|
25
28
|
export declare function zohoRecruitConfigApiUrl(input: ZohoRecruitConfigApiUrlInput): ZohoApiUrl;
|
|
26
29
|
/**
|
|
@@ -30,13 +33,13 @@ export type ZohoRecruitConfig = ZohoConfig;
|
|
|
30
33
|
/**
|
|
31
34
|
* Input provided to a fetch factory so it can construct an HTTP client bound to the given Recruit API URL.
|
|
32
35
|
*/
|
|
33
|
-
export interface
|
|
36
|
+
export interface ZohoRecruitFetchFactoryParams {
|
|
34
37
|
readonly apiUrl: ZohoRecruitApiUrl;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Factory that produces a configured fetch client for a specific Zoho Recruit API endpoint.
|
|
38
41
|
*/
|
|
39
|
-
export type ZohoRecruitFetchFactory = FactoryWithRequiredInput<ConfiguredFetch,
|
|
42
|
+
export type ZohoRecruitFetchFactory = FactoryWithRequiredInput<ConfiguredFetch, ZohoRecruitFetchFactoryParams>;
|
|
40
43
|
/**
|
|
41
44
|
* Core context required for all Zoho Recruit API calls, bundling the HTTP client, JSON fetcher, authentication, configuration, and rate limiting.
|
|
42
45
|
*/
|
|
@@ -52,3 +55,7 @@ export interface ZohoRecruitContext extends ZohoRateLimiterRef {
|
|
|
52
55
|
export interface ZohoRecruitContextRef {
|
|
53
56
|
readonly recruitContext: ZohoRecruitContext;
|
|
54
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated use ZohoRecruitFetchFactoryParams instead.
|
|
60
|
+
*/
|
|
61
|
+
export type ZohoRecruitFetchFactoryInput = ZohoRecruitFetchFactoryParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
1
|
+
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type Maybe, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* Zoho Recruit module name.
|
|
4
4
|
*
|
|
@@ -84,15 +84,15 @@ export type ZohoRecruitDraftOrSaveState = 'draft' | 'save';
|
|
|
84
84
|
export type ZohoRecruitCommaSeparateFieldNames = CommaSeparatedString;
|
|
85
85
|
export type ZohoRecruitTrueFalseBoth = 'true' | 'false' | 'both';
|
|
86
86
|
export interface ZohoRecruitReferenceData {
|
|
87
|
-
name: string;
|
|
88
|
-
id: ZohoRecruitId;
|
|
87
|
+
readonly name: string;
|
|
88
|
+
readonly id: ZohoRecruitId;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Reference pair of a Zoho Recruit user name and id
|
|
92
92
|
*/
|
|
93
93
|
export interface ZohoRecruitUserReferenceData {
|
|
94
|
-
name: string;
|
|
95
|
-
id: ZohoRecruitUserId;
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly id: ZohoRecruitUserId;
|
|
96
96
|
}
|
|
97
97
|
export interface ZohoRecruitReferenceDataWithModule extends ZohoRecruitReferenceData, ZohoRecruitModuleNameRef {
|
|
98
98
|
}
|
|
@@ -114,11 +114,11 @@ export type ZohoRecruitValidUrl = WebsiteUrl;
|
|
|
114
114
|
* Update details returned by the server for a created/updated object.
|
|
115
115
|
*/
|
|
116
116
|
export interface ZohoRecruitChangeObjectDetails {
|
|
117
|
-
id: ZohoRecruitRecordId;
|
|
118
|
-
Modified_Time: ISO8601DateString;
|
|
119
|
-
Modified_By: ZohoRecruitCreatedByData;
|
|
120
|
-
Created_Time: ISO8601DateString;
|
|
121
|
-
Created_By: ZohoRecruitCreatedByData;
|
|
117
|
+
readonly id: ZohoRecruitRecordId;
|
|
118
|
+
readonly Modified_Time: ISO8601DateString;
|
|
119
|
+
readonly Modified_By: ZohoRecruitCreatedByData;
|
|
120
|
+
readonly Created_Time: ISO8601DateString;
|
|
121
|
+
readonly Created_By: ZohoRecruitCreatedByData;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Base Zoho Recruit field data type.
|
|
@@ -267,7 +267,7 @@ export interface ZohoRecruitRecordAttachmentMetadata {
|
|
|
267
267
|
/**
|
|
268
268
|
* Direct URL to the attachment, when available
|
|
269
269
|
*/
|
|
270
|
-
Attachment_URL:
|
|
270
|
+
Attachment_URL: Maybe<WebsiteUrl>;
|
|
271
271
|
/**
|
|
272
272
|
* User who last modified this attachment
|
|
273
273
|
*/
|
|
@@ -291,7 +291,7 @@ export interface ZohoRecruitRecordAttachmentMetadata {
|
|
|
291
291
|
/**
|
|
292
292
|
* Link URL when the attachment is a link
|
|
293
293
|
*/
|
|
294
|
-
$link_url?:
|
|
294
|
+
$link_url?: Maybe<WebsiteUrl>;
|
|
295
295
|
/**
|
|
296
296
|
* Number of linked documents
|
|
297
297
|
*/
|
|
@@ -49,10 +49,17 @@ export declare class ZohoRecruitRecordCrudNoMatchingRecordError extends ZohoRecr
|
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Creates a typed CRUD error subclass based on the error code returned by the Zoho Recruit API, enabling callers to catch specific failure modes.
|
|
52
|
+
*
|
|
53
|
+
* @param error - Structured error data from the Zoho Recruit API response
|
|
54
|
+
* @returns A specific CRUD error subclass matching the error code
|
|
52
55
|
*/
|
|
53
56
|
export declare function zohoRecruitRecordCrudError(error: ZohoServerErrorDataWithDetails): ZohoRecruitRecordCrudError;
|
|
54
57
|
/**
|
|
55
58
|
* Returns an assertion function that throws {@link ZohoRecruitRecordNoContentError} when the data array result is empty or null, indicating the requested record does not exist.
|
|
59
|
+
*
|
|
60
|
+
* @param moduleName - Optional module name for the error context
|
|
61
|
+
* @param recordId - Optional record ID for the error context
|
|
62
|
+
* @returns Assertion function that validates the data array is non-empty
|
|
56
63
|
*/
|
|
57
64
|
export declare function assertZohoRecruitRecordDataArrayResultHasContent<T>(moduleName?: ZohoRecruitModuleName, recordId?: ZohoRecruitRecordId): <R extends ZohoDataArrayResultRef<T>>(x: R) => R;
|
|
58
65
|
/**
|
|
@@ -61,10 +68,17 @@ export declare function assertZohoRecruitRecordDataArrayResultHasContent<T>(modu
|
|
|
61
68
|
export declare const logZohoRecruitErrorToConsole: import("..").LogZohoServerErrorFunction;
|
|
62
69
|
/**
|
|
63
70
|
* Parses the JSON body of a failed Zoho Recruit fetch response into a structured error, returning undefined if the body cannot be parsed.
|
|
71
|
+
*
|
|
72
|
+
* @param responseError - The fetch response error to parse
|
|
73
|
+
* @returns Parsed Zoho server error, or undefined if parsing fails
|
|
64
74
|
*/
|
|
65
75
|
export declare function parseZohoRecruitError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
66
76
|
/**
|
|
67
77
|
* Converts raw Zoho Recruit error response data into a parsed error, delegating to Recruit-specific handlers for known error codes and falling back to the shared Zoho parser.
|
|
78
|
+
*
|
|
79
|
+
* @param errorResponseData - Raw error response data from the Zoho Recruit API
|
|
80
|
+
* @param responseError - The underlying fetch response error
|
|
81
|
+
* @returns Parsed Zoho server error, or undefined if the data contains no recognizable error
|
|
68
82
|
*/
|
|
69
83
|
export declare function parseZohoRecruitServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData, responseError: FetchResponseError): ParsedZohoServerError;
|
|
70
84
|
/**
|
|
@@ -15,16 +15,16 @@ export interface ZohoRecruitFactoryConfig extends ZohoAccountsContextRef {
|
|
|
15
15
|
/**
|
|
16
16
|
* Custom rate limiter configuration to control request concurrency and throttling.
|
|
17
17
|
*/
|
|
18
|
-
rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
18
|
+
readonly rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
19
19
|
/**
|
|
20
20
|
* Custom fetch factory for creating the underlying HTTP client.
|
|
21
21
|
* Defaults to a standard fetch service with OAuth Bearer token headers and a 20-second timeout.
|
|
22
22
|
*/
|
|
23
|
-
fetchFactory?: ZohoRecruitFetchFactory;
|
|
23
|
+
readonly fetchFactory?: ZohoRecruitFetchFactory;
|
|
24
24
|
/**
|
|
25
25
|
* Custom error logging function invoked when Zoho API errors are encountered.
|
|
26
26
|
*/
|
|
27
|
-
logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
27
|
+
readonly logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Factory function that creates a {@link ZohoRecruit} client from a {@link ZohoRecruitConfig}.
|
|
@@ -7,12 +7,18 @@ export declare const ZOHO_SIGN_SERVICE_NAME: ZohoApiServiceName | ZohoServiceAcc
|
|
|
7
7
|
export type ZohoSignApiUrl = ZohoApiUrl;
|
|
8
8
|
export type ZohoSignApiUrlKey = ZohoApiUrlKey;
|
|
9
9
|
export type ZohoSignConfigApiUrlInput = ZohoSignApiUrlKey | ZohoSignApiUrl;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves an environment key or passthrough URL to the full Zoho Sign API URL.
|
|
12
|
+
*
|
|
13
|
+
* @param input - An environment key ('sandbox' or 'production') or a full API URL
|
|
14
|
+
* @returns The resolved Zoho Sign API URL
|
|
15
|
+
*/
|
|
10
16
|
export declare function zohoSignConfigApiUrl(input: ZohoSignConfigApiUrlInput): ZohoApiUrl;
|
|
11
17
|
export type ZohoSignConfig = ZohoConfig;
|
|
12
|
-
export interface
|
|
18
|
+
export interface ZohoSignFetchFactoryParams {
|
|
13
19
|
readonly apiUrl: ZohoSignApiUrl;
|
|
14
20
|
}
|
|
15
|
-
export type ZohoSignFetchFactory = FactoryWithRequiredInput<ConfiguredFetch,
|
|
21
|
+
export type ZohoSignFetchFactory = FactoryWithRequiredInput<ConfiguredFetch, ZohoSignFetchFactoryParams>;
|
|
16
22
|
export interface ZohoSignContext extends ZohoRateLimiterRef {
|
|
17
23
|
readonly fetch: ConfiguredFetch;
|
|
18
24
|
readonly fetchJson: FetchJsonFunction;
|
|
@@ -22,3 +28,7 @@ export interface ZohoSignContext extends ZohoRateLimiterRef {
|
|
|
22
28
|
export interface ZohoSignContextRef {
|
|
23
29
|
readonly signContext: ZohoSignContext;
|
|
24
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated use ZohoSignFetchFactoryParams instead.
|
|
33
|
+
*/
|
|
34
|
+
export type ZohoSignFetchFactoryInput = ZohoSignFetchFactoryParams;
|
package/src/lib/sign/sign.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EmailAddress } from '@dereekb/util';
|
|
1
|
+
import { type EmailAddress, type FileSize, type HexColorCode, type PageNumber, type Pixels, type UnixDateTimeMillisecondsNumber } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* An identifier in Zoho Sign.
|
|
4
4
|
*/
|
|
@@ -64,8 +64,8 @@ export interface ZohoSignFieldType {
|
|
|
64
64
|
* Text styling properties for a field.
|
|
65
65
|
*/
|
|
66
66
|
export interface ZohoSignTextProperty {
|
|
67
|
-
readonly font_size?:
|
|
68
|
-
readonly font_color?:
|
|
67
|
+
readonly font_size?: Pixels;
|
|
68
|
+
readonly font_color?: HexColorCode;
|
|
69
69
|
readonly font?: string;
|
|
70
70
|
readonly is_italic?: boolean;
|
|
71
71
|
readonly is_underline?: boolean;
|
|
@@ -94,11 +94,11 @@ export interface ZohoSignField {
|
|
|
94
94
|
readonly document_id?: ZohoSignDocumentId;
|
|
95
95
|
readonly action_id?: ZohoSignActionId;
|
|
96
96
|
readonly is_mandatory?: boolean;
|
|
97
|
-
readonly x_coord?:
|
|
98
|
-
readonly y_coord?:
|
|
99
|
-
readonly abs_width?:
|
|
100
|
-
readonly abs_height?:
|
|
101
|
-
readonly page_no?:
|
|
97
|
+
readonly x_coord?: Pixels;
|
|
98
|
+
readonly y_coord?: Pixels;
|
|
99
|
+
readonly abs_width?: Pixels;
|
|
100
|
+
readonly abs_height?: Pixels;
|
|
101
|
+
readonly page_no?: PageNumber;
|
|
102
102
|
readonly default_value?: string;
|
|
103
103
|
readonly is_read_only?: boolean;
|
|
104
104
|
readonly name_format?: ZohoSignNameFormat;
|
|
@@ -138,7 +138,7 @@ export interface ZohoSignActionFields {
|
|
|
138
138
|
export interface ZohoSignDocument {
|
|
139
139
|
readonly document_id: ZohoSignDocumentId;
|
|
140
140
|
readonly document_name?: string;
|
|
141
|
-
readonly document_size?:
|
|
141
|
+
readonly document_size?: FileSize;
|
|
142
142
|
readonly total_pages?: number;
|
|
143
143
|
readonly document_order?: string;
|
|
144
144
|
}
|
|
@@ -157,11 +157,11 @@ export interface ZohoSignRequest {
|
|
|
157
157
|
readonly owner_last_name?: string;
|
|
158
158
|
readonly description?: string;
|
|
159
159
|
readonly notes?: string;
|
|
160
|
-
readonly created_time?:
|
|
161
|
-
readonly modified_time?:
|
|
162
|
-
readonly action_time?:
|
|
163
|
-
readonly sign_submitted_time?:
|
|
164
|
-
readonly expire_by?:
|
|
160
|
+
readonly created_time?: UnixDateTimeMillisecondsNumber;
|
|
161
|
+
readonly modified_time?: UnixDateTimeMillisecondsNumber;
|
|
162
|
+
readonly action_time?: UnixDateTimeMillisecondsNumber;
|
|
163
|
+
readonly sign_submitted_time?: UnixDateTimeMillisecondsNumber;
|
|
164
|
+
readonly expire_by?: UnixDateTimeMillisecondsNumber;
|
|
165
165
|
readonly expiration_days?: number;
|
|
166
166
|
readonly sign_percentage?: number;
|
|
167
167
|
readonly email_reminders?: boolean;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import { type FetchResponseError } from '@dereekb/util/fetch';
|
|
2
2
|
import { type ZohoServerErrorResponseData, type ParsedZohoServerError, type ZohoServerErrorResponseDataArrayRef } from '../zoho.error.api';
|
|
3
3
|
export declare const logZohoSignErrorToConsole: import("..").LogZohoServerErrorFunction;
|
|
4
|
+
/**
|
|
5
|
+
* Parses the JSON body of a failed Zoho Sign fetch response into a structured error, returning undefined if the body cannot be parsed.
|
|
6
|
+
*
|
|
7
|
+
* @param responseError - The fetch response error to parse
|
|
8
|
+
* @returns Parsed Zoho server error, or undefined if parsing fails
|
|
9
|
+
*/
|
|
4
10
|
export declare function parseZohoSignError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
11
|
+
/**
|
|
12
|
+
* Converts raw Zoho Sign error response data into a parsed error, delegating to Sign-specific handlers for known error codes and falling back to the shared Zoho parser.
|
|
13
|
+
*
|
|
14
|
+
* @param errorResponseData - Raw error response data from the Zoho Sign API
|
|
15
|
+
* @param responseError - The underlying fetch response error
|
|
16
|
+
* @returns Parsed Zoho server error, or undefined if the data contains no recognizable error
|
|
17
|
+
*/
|
|
5
18
|
export declare function parseZohoSignServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData | ZohoServerErrorResponseDataArrayRef, responseError: FetchResponseError): ParsedZohoServerError;
|
|
6
19
|
export declare const interceptZohoSign200StatusWithErrorResponse: import("@dereekb/util/fetch").FetchJsonInterceptJsonResponseFunction;
|
|
7
20
|
export declare const handleZohoSignErrorFetch: import("..").HandleZohoErrorFetchFactory;
|
|
@@ -15,16 +15,16 @@ export interface ZohoSignFactoryConfig extends ZohoAccountsContextRef {
|
|
|
15
15
|
/**
|
|
16
16
|
* Custom rate limiter configuration to control request concurrency and throttling.
|
|
17
17
|
*/
|
|
18
|
-
rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
18
|
+
readonly rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
19
19
|
/**
|
|
20
20
|
* Custom fetch factory for creating the underlying HTTP client.
|
|
21
21
|
* Defaults to a standard fetch service with OAuth Bearer token headers and a 20-second timeout.
|
|
22
22
|
*/
|
|
23
|
-
fetchFactory?: ZohoSignFetchFactory;
|
|
23
|
+
readonly fetchFactory?: ZohoSignFetchFactory;
|
|
24
24
|
/**
|
|
25
25
|
* Custom error logging function invoked when Zoho API errors are encountered.
|
|
26
26
|
*/
|
|
27
|
-
logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
27
|
+
readonly logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Factory function that creates a {@link ZohoSign} client from a {@link ZohoSignConfig}.
|
|
@@ -76,6 +76,12 @@ export type ZohoServerSuccessData<T = unknown> = Omit<ZohoServerErrorData<T>, 'c
|
|
|
76
76
|
* Contains details and a status
|
|
77
77
|
*/
|
|
78
78
|
export type ZohoServerErrorDataWithDetails<T = unknown> = Required<ZohoServerErrorData<T>>;
|
|
79
|
+
/**
|
|
80
|
+
* Normalizes a Zoho error response entry into a consistent {@link ZohoServerErrorData} shape, handling both object and string error formats.
|
|
81
|
+
*
|
|
82
|
+
* @param error - The raw error entry, either a structured object or a plain error code string
|
|
83
|
+
* @returns Normalized error data with code and message fields
|
|
84
|
+
*/
|
|
79
85
|
export declare function zohoServerErrorData(error: ZohoServerErrorResponseDataError): ZohoServerErrorData;
|
|
80
86
|
/**
|
|
81
87
|
* Zoho Server Error
|
|
@@ -117,8 +123,9 @@ export interface LogZohoServerErrorFunctionConfig {
|
|
|
117
123
|
/**
|
|
118
124
|
* Creates a logZohoServerErrorFunction that logs the error to console.
|
|
119
125
|
*
|
|
120
|
-
* @param zohoApiNamePrefix Prefix to use when logging
|
|
121
|
-
* @
|
|
126
|
+
* @param zohoApiNamePrefix - Prefix to use when logging (e.g. 'ZohoRecruit', 'ZohoSign')
|
|
127
|
+
* @param options - Optional configuration for controlling which error types are logged
|
|
128
|
+
* @returns A function that logs Zoho server errors to the console
|
|
122
129
|
*/
|
|
123
130
|
export declare function logZohoServerErrorFunction(zohoApiNamePrefix: string, options?: LogZohoServerErrorFunctionConfig): LogZohoServerErrorFunction;
|
|
124
131
|
/**
|
|
@@ -128,18 +135,22 @@ export declare function logZohoServerErrorFunction(zohoApiNamePrefix: string, op
|
|
|
128
135
|
* @returns
|
|
129
136
|
*/
|
|
130
137
|
export type HandleZohoErrorFetchFactory = (fetch: ConfiguredFetch, logError?: LogZohoServerErrorFunction, onError?: (error: ParsedZohoServerError) => void) => ConfiguredFetch;
|
|
131
|
-
export type ParsedZohoServerError = FetchRequestFactoryError | ZohoServerError
|
|
138
|
+
export type ParsedZohoServerError = Maybe<FetchRequestFactoryError | ZohoServerError>;
|
|
132
139
|
export type ParseZohoFetchResponseErrorFunction = (responseError: FetchResponseError) => Promise<ParsedZohoServerError>;
|
|
133
140
|
/**
|
|
134
141
|
* Wraps a ConfiguredFetch to support handling errors returned by fetch.
|
|
135
142
|
*
|
|
136
|
-
* @param fetch
|
|
137
|
-
* @
|
|
143
|
+
* @param parseZohoError - Function that parses a fetch response error into a Zoho-specific error
|
|
144
|
+
* @param defaultLogError - Default error logging function used when no custom logger is provided
|
|
145
|
+
* @returns Factory that wraps a ConfiguredFetch with Zoho error handling
|
|
138
146
|
*/
|
|
139
147
|
export declare function handleZohoErrorFetchFactory(parseZohoError: ParseZohoFetchResponseErrorFunction, defaultLogError: LogZohoServerErrorFunction): HandleZohoErrorFetchFactory;
|
|
140
148
|
export type ParseZohoServerErrorResponseData = (zohoServerErrorResponseData: ZohoServerErrorResponseData, fetchResponseError: FetchResponseError) => ParsedZohoServerError;
|
|
141
149
|
/**
|
|
142
150
|
* FetchJsonInterceptJsonResponseFunction that intercepts a 200 response that actually contains a ZohoServerError and throws a ZohoServerError for the error handling to catch.
|
|
151
|
+
*
|
|
152
|
+
* @param parseZohoServerErrorResponseData - Function that parses raw error response data into a structured error
|
|
153
|
+
* @returns Interceptor function that detects and throws hidden errors in 200 responses
|
|
143
154
|
*/
|
|
144
155
|
export declare function interceptZohoErrorResponseFactory(parseZohoServerErrorResponseData: ParseZohoServerErrorResponseData): FetchJsonInterceptJsonResponseFunction;
|
|
145
156
|
/**
|
|
@@ -229,6 +240,12 @@ export interface ZohoRateLimitHeaderDetails {
|
|
|
229
240
|
*/
|
|
230
241
|
readonly resetAt: Date;
|
|
231
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Extracts rate limit details from Zoho API response headers, returning null if the headers are absent.
|
|
245
|
+
*
|
|
246
|
+
* @param headers - HTTP response headers from a Zoho API call
|
|
247
|
+
* @returns Parsed rate limit details, or null if rate limit headers are missing
|
|
248
|
+
*/
|
|
232
249
|
export declare function zohoRateLimitHeaderDetails(headers: Headers): Maybe<ZohoRateLimitHeaderDetails>;
|
|
233
250
|
export declare class ZohoTooManyRequestsError extends ZohoServerFetchResponseError {
|
|
234
251
|
get headerDetails(): Maybe<ZohoRateLimitHeaderDetails>;
|
|
@@ -236,9 +253,9 @@ export declare class ZohoTooManyRequestsError extends ZohoServerFetchResponseErr
|
|
|
236
253
|
/**
|
|
237
254
|
* Function that parses/transforms a ZohoServerErrorResponseData into a general ZohoServerError or other known error type.
|
|
238
255
|
*
|
|
239
|
-
* @param errorResponseData
|
|
240
|
-
* @param responseError
|
|
241
|
-
* @returns
|
|
256
|
+
* @param errorResponseData - Raw error response data from the Zoho API
|
|
257
|
+
* @param responseError - The underlying fetch response error
|
|
258
|
+
* @returns A typed Zoho server error, or undefined if no error is found
|
|
242
259
|
*/
|
|
243
260
|
export declare function parseZohoServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData | ZohoServerErrorResponseDataArrayRef, responseError: FetchResponseError): ZohoServerFetchResponseError | undefined;
|
|
244
261
|
/**
|