@dereekb/zoho 13.11.13 → 13.11.15
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/cli/index.js +5 -5
- package/cli/package.json +7 -7
- package/index.cjs.js +569 -503
- package/index.esm.js +569 -503
- package/nestjs/index.cjs.js +248 -255
- package/nestjs/index.esm.js +248 -255
- package/nestjs/package.json +5 -5
- package/nestjs/src/lib/accounts/accounts.config.d.ts +1 -1
- package/nestjs/src/lib/accounts/accounts.service.d.ts +11 -11
- package/nestjs/src/lib/crm/crm.api.d.ts +31 -31
- package/nestjs/src/lib/crm/crm.config.d.ts +1 -1
- package/nestjs/src/lib/crm/crm.module.d.ts +12 -13
- package/nestjs/src/lib/desk/desk.api.d.ts +48 -48
- package/nestjs/src/lib/desk/desk.config.d.ts +2 -1
- package/nestjs/src/lib/desk/desk.module.d.ts +6 -6
- package/nestjs/src/lib/recruit/recruit.api.d.ts +35 -35
- package/nestjs/src/lib/recruit/recruit.config.d.ts +1 -1
- package/nestjs/src/lib/recruit/recruit.module.d.ts +12 -13
- package/nestjs/src/lib/sign/sign.api.d.ts +16 -16
- package/nestjs/src/lib/sign/sign.module.d.ts +12 -13
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.d.ts +2 -2
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.module.d.ts +3 -3
- package/nestjs/src/lib/sign/webhook/webhook.zoho.sign.verify.d.ts +2 -2
- package/nestjs/src/lib/zoho.config.d.ts +2 -1
- package/package.json +8 -8
- package/src/lib/accounts/accounts.api.d.ts +10 -10
- package/src/lib/accounts/accounts.config.d.ts +2 -2
- package/src/lib/accounts/accounts.d.ts +3 -2
- package/src/lib/accounts/accounts.error.api.d.ts +5 -5
- package/src/lib/accounts/accounts.factory.d.ts +8 -6
- package/src/lib/crm/crm.api.d.ts +87 -81
- package/src/lib/crm/crm.api.notes.d.ts +11 -10
- package/src/lib/crm/crm.api.tags.d.ts +16 -14
- package/src/lib/crm/crm.config.d.ts +2 -2
- package/src/lib/crm/crm.d.ts +2 -2
- package/src/lib/crm/crm.error.api.d.ts +10 -10
- package/src/lib/crm/crm.factory.d.ts +3 -2
- package/src/lib/crm/crm.notes.d.ts +2 -2
- package/src/lib/desk/desk.agent.d.ts +2 -2
- package/src/lib/desk/desk.api.activities.d.ts +5 -4
- package/src/lib/desk/desk.api.agents.d.ts +11 -10
- package/src/lib/desk/desk.api.attachments.d.ts +4 -4
- package/src/lib/desk/desk.api.comments.d.ts +8 -8
- package/src/lib/desk/desk.api.contacts.d.ts +9 -8
- package/src/lib/desk/desk.api.departments.d.ts +4 -4
- package/src/lib/desk/desk.api.followers.d.ts +6 -6
- package/src/lib/desk/desk.api.page.d.ts +6 -5
- package/src/lib/desk/desk.api.tags.d.ts +10 -10
- package/src/lib/desk/desk.api.threads.d.ts +7 -6
- package/src/lib/desk/desk.api.tickets.d.ts +23 -21
- package/src/lib/desk/desk.api.time.d.ts +10 -10
- package/src/lib/desk/desk.config.d.ts +2 -2
- package/src/lib/desk/desk.error.api.d.ts +5 -5
- package/src/lib/desk/desk.factory.d.ts +3 -2
- package/src/lib/desk/desk.limit.d.ts +3 -3
- package/src/lib/desk/desk.ticket.d.ts +4 -4
- package/src/lib/recruit/recruit.api.candidates.d.ts +15 -13
- package/src/lib/recruit/recruit.api.d.ts +85 -80
- package/src/lib/recruit/recruit.api.notes.d.ts +11 -10
- package/src/lib/recruit/recruit.api.tags.d.ts +19 -18
- package/src/lib/recruit/recruit.config.d.ts +2 -2
- package/src/lib/recruit/recruit.d.ts +2 -2
- package/src/lib/recruit/recruit.error.api.d.ts +10 -10
- package/src/lib/recruit/recruit.factory.d.ts +3 -2
- package/src/lib/recruit/recruit.notes.d.ts +2 -2
- package/src/lib/shared/criteria.d.ts +5 -5
- package/src/lib/shared/criteria.util.d.ts +2 -2
- package/src/lib/sign/sign.api.d.ts +47 -46
- package/src/lib/sign/sign.api.page.d.ts +6 -5
- package/src/lib/sign/sign.config.d.ts +2 -2
- package/src/lib/sign/sign.d.ts +4 -4
- package/src/lib/sign/sign.error.api.d.ts +5 -5
- package/src/lib/sign/sign.factory.d.ts +3 -2
- package/src/lib/zoho.api.page.d.ts +5 -4
- package/src/lib/zoho.error.api.d.ts +17 -14
- package/src/lib/zoho.limit.d.ts +6 -5
- package/src/lib/zoho.type.d.ts +1 -1
|
@@ -36,8 +36,8 @@ export type ZohoRecruitCreateTagsFunction = (input: ZohoRecruitCreateTagsRequest
|
|
|
36
36
|
* (which are often non-fatal) from other errors, making it easy to handle the common
|
|
37
37
|
* case where a tag already exists.
|
|
38
38
|
*
|
|
39
|
-
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting
|
|
40
|
-
* @returns Function that creates tags in the specified module
|
|
39
|
+
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting.
|
|
40
|
+
* @returns Function that creates tags in the specified module.
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```typescript
|
|
@@ -79,8 +79,10 @@ export type ZohoRecruitGetTagsFunction = (input: ZohoRecruitGetTagsRequest) => P
|
|
|
79
79
|
* Returns the list of tags within a module. Normalizes the non-standard API response
|
|
80
80
|
* that returns data under a `tags` key instead of the standard `data` key.
|
|
81
81
|
*
|
|
82
|
-
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting
|
|
83
|
-
* @returns Function that retrieves tags for a module
|
|
82
|
+
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting.
|
|
83
|
+
* @returns Function that retrieves tags for a module.
|
|
84
|
+
*
|
|
85
|
+
* @see https://www.zoho.com/recruit/developer-guide/apiv2/get-tag-list.html
|
|
84
86
|
*
|
|
85
87
|
* @example
|
|
86
88
|
* ```typescript
|
|
@@ -90,8 +92,6 @@ export type ZohoRecruitGetTagsFunction = (input: ZohoRecruitGetTagsRequest) => P
|
|
|
90
92
|
* module: ZOHO_RECRUIT_CANDIDATES_MODULE
|
|
91
93
|
* });
|
|
92
94
|
* ```
|
|
93
|
-
*
|
|
94
|
-
* @see https://www.zoho.com/recruit/developer-guide/apiv2/get-tag-list.html
|
|
95
95
|
*/
|
|
96
96
|
export declare function zohoRecruitGetTagsForModule(context: ZohoRecruitContext): ZohoRecruitGetTagsFunction;
|
|
97
97
|
/**
|
|
@@ -104,8 +104,9 @@ export type ZohoRecruitGetTagsForModulePageFactory = (input: ZohoRecruitGetTagsR
|
|
|
104
104
|
* Returns a page factory for iterating over tags in a module across multiple pages.
|
|
105
105
|
* Wraps {@link zohoRecruitGetTagsForModule} with automatic pagination handling.
|
|
106
106
|
*
|
|
107
|
-
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting
|
|
108
|
-
* @returns Page factory for iterating over module tags
|
|
107
|
+
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting.
|
|
108
|
+
* @returns Page factory for iterating over module tags.
|
|
109
|
+
*
|
|
109
110
|
* @__NO_SIDE_EFFECTS__
|
|
110
111
|
*/
|
|
111
112
|
export declare function zohoRecruitGetTagsForModulePageFactory(context: ZohoRecruitContext): ZohoRecruitGetTagsForModulePageFactory;
|
|
@@ -163,9 +164,11 @@ export type ZohoRecruitAddTagsToRecordsFunction = (input: ZohoRecruitAddTagsToRe
|
|
|
163
164
|
* Adds one or more tags to one or more records. Returns a paired success/error result
|
|
164
165
|
* for each record. Maximum of {@link ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED} (100) record IDs per call.
|
|
165
166
|
*
|
|
166
|
-
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting
|
|
167
|
-
* @returns Function that adds tags to records
|
|
168
|
-
* @throws {Error} If more than 100 record IDs are provided
|
|
167
|
+
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting.
|
|
168
|
+
* @returns Function that adds tags to records.
|
|
169
|
+
* @throws {Error} If more than 100 record IDs are provided.
|
|
170
|
+
*
|
|
171
|
+
* @see https://www.zoho.com/recruit/developer-guide/apiv2/add-tags.html
|
|
169
172
|
*
|
|
170
173
|
* @example
|
|
171
174
|
* ```typescript
|
|
@@ -177,8 +180,6 @@ export type ZohoRecruitAddTagsToRecordsFunction = (input: ZohoRecruitAddTagsToRe
|
|
|
177
180
|
* ids: [candidateId1, candidateId2]
|
|
178
181
|
* });
|
|
179
182
|
* ```
|
|
180
|
-
*
|
|
181
|
-
* @see https://www.zoho.com/recruit/developer-guide/apiv2/add-tags.html
|
|
182
183
|
*/
|
|
183
184
|
export declare function zohoRecruitAddTagsToRecords(context: ZohoRecruitContext): ZohoRecruitAddTagsToRecordsFunction;
|
|
184
185
|
/**
|
|
@@ -209,9 +210,11 @@ export type ZohoRecruitRemoveTagsFromRecordsFunction = (input: ZohoRecruitRemove
|
|
|
209
210
|
* Removes one or more tags from one or more records. Returns a paired success/error result
|
|
210
211
|
* for each record. Maximum of {@link ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED} (100) record IDs per call.
|
|
211
212
|
*
|
|
212
|
-
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting
|
|
213
|
-
* @returns Function that removes tags from records
|
|
214
|
-
* @throws {Error} If more than 100 record IDs are provided
|
|
213
|
+
* @param context - Authenticated Zoho Recruit context providing fetch and rate limiting.
|
|
214
|
+
* @returns Function that removes tags from records.
|
|
215
|
+
* @throws {Error} If more than 100 record IDs are provided.
|
|
216
|
+
*
|
|
217
|
+
* @see https://www.zoho.com/recruit/developer-guide/apiv2/remove-tags.html
|
|
215
218
|
*
|
|
216
219
|
* @example
|
|
217
220
|
* ```typescript
|
|
@@ -223,8 +226,6 @@ export type ZohoRecruitRemoveTagsFromRecordsFunction = (input: ZohoRecruitRemove
|
|
|
223
226
|
* ids: candidateId
|
|
224
227
|
* });
|
|
225
228
|
* ```
|
|
226
|
-
*
|
|
227
|
-
* @see https://www.zoho.com/recruit/developer-guide/apiv2/remove-tags.html
|
|
228
229
|
*/
|
|
229
230
|
export declare function zohoRecruitRemoveTagsFromRecords(context: ZohoRecruitContext): ZohoRecruitRemoveTagsFromRecordsFunction;
|
|
230
231
|
/**
|
|
@@ -22,8 +22,8 @@ export type ZohoRecruitConfigApiUrlInput = ZohoRecruitApiUrlKey | ZohoRecruitApi
|
|
|
22
22
|
/**
|
|
23
23
|
* Resolves an environment key or passthrough URL to the full Zoho Recruit API URL.
|
|
24
24
|
*
|
|
25
|
-
* @param input - An environment key ('sandbox' or 'production') or a full API URL
|
|
26
|
-
* @returns The resolved Zoho Recruit API URL
|
|
25
|
+
* @param input - An environment key ('sandbox' or 'production') or a full API URL.
|
|
26
|
+
* @returns The resolved Zoho Recruit API URL.
|
|
27
27
|
*/
|
|
28
28
|
export declare function zohoRecruitConfigApiUrl(input: ZohoRecruitConfigApiUrlInput): ZohoApiUrl;
|
|
29
29
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type Maybe, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
1
|
+
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type SuggestedString, type Maybe, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* Zoho Recruit module name.
|
|
4
4
|
*
|
|
@@ -183,7 +183,7 @@ export interface ZohoRecruitRecordEmailMetadata {
|
|
|
183
183
|
*/
|
|
184
184
|
status: ZohoRecruitRecordEmailMetadataStatus[];
|
|
185
185
|
}
|
|
186
|
-
export type ZohoRecruitRecordEmailMetadataStatusType = 'sent'
|
|
186
|
+
export type ZohoRecruitRecordEmailMetadataStatusType = SuggestedString<'sent'>;
|
|
187
187
|
export interface ZohoRecruitRecordEmailMetadataStatus {
|
|
188
188
|
type: ZohoRecruitRecordEmailMetadataStatusType;
|
|
189
189
|
}
|
|
@@ -50,16 +50,16 @@ export declare class ZohoRecruitRecordCrudNoMatchingRecordError extends ZohoRecr
|
|
|
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
52
|
*
|
|
53
|
-
* @param error - Structured error data from the Zoho Recruit API response
|
|
54
|
-
* @returns A specific CRUD error subclass matching the error code
|
|
53
|
+
* @param error - Structured error data from the Zoho Recruit API response.
|
|
54
|
+
* @returns A specific CRUD error subclass matching the error code.
|
|
55
55
|
*/
|
|
56
56
|
export declare function zohoRecruitRecordCrudError(error: ZohoServerErrorDataWithDetails): ZohoRecruitRecordCrudError;
|
|
57
57
|
/**
|
|
58
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
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
|
|
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.
|
|
63
63
|
*/
|
|
64
64
|
export declare function assertZohoRecruitRecordDataArrayResultHasContent<T>(moduleName?: ZohoRecruitModuleName, recordId?: ZohoRecruitRecordId): <R extends ZohoDataArrayResultRef<T>>(x: R) => R;
|
|
65
65
|
/**
|
|
@@ -69,16 +69,16 @@ export declare const logZohoRecruitErrorToConsole: import("..").LogZohoServerErr
|
|
|
69
69
|
/**
|
|
70
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
71
|
*
|
|
72
|
-
* @param responseError - The fetch response error to parse
|
|
73
|
-
* @returns Parsed Zoho server error, or undefined if parsing fails
|
|
72
|
+
* @param responseError - The fetch response error to parse.
|
|
73
|
+
* @returns Parsed Zoho server error, or undefined if parsing fails.
|
|
74
74
|
*/
|
|
75
75
|
export declare function parseZohoRecruitError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
76
76
|
/**
|
|
77
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
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
|
|
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.
|
|
82
82
|
*/
|
|
83
83
|
export declare function parseZohoRecruitServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData, responseError: FetchResponseError): ParsedZohoServerError;
|
|
84
84
|
/**
|
|
@@ -38,8 +38,8 @@ export type ZohoRecruitFactory = (config: ZohoRecruitConfig) => ZohoRecruit;
|
|
|
38
38
|
* Each client handles OAuth token refresh on {@link ZohoInvalidTokenError}, rate limiting,
|
|
39
39
|
* and Zoho Recruit's non-standard error responses (200 status with error body).
|
|
40
40
|
*
|
|
41
|
-
* @param factoryConfig - Configuration providing account credentials and optional overrides
|
|
42
|
-
* @returns A factory function that creates authenticated Zoho Recruit clients
|
|
41
|
+
* @param factoryConfig - Configuration providing account credentials and optional overrides.
|
|
42
|
+
* @returns A factory function that creates authenticated Zoho Recruit clients.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```typescript
|
|
@@ -54,6 +54,7 @@ export type ZohoRecruitFactory = (config: ZohoRecruitConfig) => ZohoRecruit;
|
|
|
54
54
|
* // Use the recruit context for API calls:
|
|
55
55
|
* const { recruitContext } = zohoRecruit;
|
|
56
56
|
* ```
|
|
57
|
+
*
|
|
57
58
|
* @__NO_SIDE_EFFECTS__
|
|
58
59
|
*/
|
|
59
60
|
export declare function zohoRecruitFactory(factoryConfig: ZohoRecruitFactoryConfig): ZohoRecruitFactory;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ISO8601DateString, type UniqueModelWithId } from '@dereekb/util';
|
|
1
|
+
import { type ISO8601DateString, type UniqueModelWithId, type Maybe } from '@dereekb/util';
|
|
2
2
|
import { type ZohoRecruitReferenceData, type ZohoRecruitParentReferenceData, type ZohoRecruitTypeId, type ZohoRecruitModuleName, type ZohoRecruitCreatedByData, type ZohoRecruitModifiedByData, type ZohoRecruitId } from './recruit';
|
|
3
3
|
/**
|
|
4
4
|
* Unique identifier for a note in Zoho Recruit.
|
|
@@ -41,7 +41,7 @@ export interface ZohoRecruitNoteData {
|
|
|
41
41
|
Note_Owner: ZohoRecruitNoteOwnerData;
|
|
42
42
|
Created_By: ZohoRecruitCreatedByData;
|
|
43
43
|
Modified_By: ZohoRecruitModifiedByData;
|
|
44
|
-
$size: ZohoRecruitNoteFileSize
|
|
44
|
+
$size: Maybe<ZohoRecruitNoteFileSize>;
|
|
45
45
|
$voice_note: boolean;
|
|
46
46
|
$status: ZohoRecruitNoteStatus;
|
|
47
47
|
}
|
|
@@ -24,8 +24,8 @@ export declare const MAX_ZOHO_SEARCH_MODULE_RECORDS_CRITERIA = 10;
|
|
|
24
24
|
* {@link ZohoSearchRecordsCriteriaTree} with nested AND/OR groups. Returns
|
|
25
25
|
* `undefined` when the input is nullish or empty.
|
|
26
26
|
*
|
|
27
|
-
* @param input - Criteria tree element, entry array, or raw criteria string
|
|
28
|
-
* @returns Compiled criteria string, or `undefined` if input is empty
|
|
27
|
+
* @param input - Criteria tree element, entry array, or raw criteria string.
|
|
28
|
+
* @returns Compiled criteria string, or `undefined` if input is empty.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```typescript
|
|
@@ -51,8 +51,8 @@ export declare function zohoSearchRecordsCriteriaString<T = any>(input: Maybe<Zo
|
|
|
51
51
|
* recursively resolving nested AND/OR groups. When both `and` and `or` are
|
|
52
52
|
* present at the same level, the OR group is merged into the AND group.
|
|
53
53
|
*
|
|
54
|
-
* @param tree - Criteria tree containing `and` and/or `or` branches
|
|
55
|
-
* @returns Compiled criteria string, or `undefined` if the tree is empty
|
|
54
|
+
* @param tree - Criteria tree containing `and` and/or `or` branches.
|
|
55
|
+
* @returns Compiled criteria string, or `undefined` if the tree is empty.
|
|
56
56
|
*/
|
|
57
57
|
export declare function zohoSearchRecordsCriteriaStringForTree<T = any>(tree: ZohoSearchRecordsCriteriaTree<T>): Maybe<ZohoSearchRecordsCriteriaString>;
|
|
58
58
|
/**
|
|
@@ -123,7 +123,7 @@ export declare const escapeZohoFieldValueForCriteriaString: import("@dereekb/uti
|
|
|
123
123
|
*
|
|
124
124
|
* Automatically escapes parentheses and commas in the value via {@link escapeZohoFieldValueForCriteriaString}.
|
|
125
125
|
*
|
|
126
|
-
* @param entry - The criteria entry to convert
|
|
126
|
+
* @param entry - The criteria entry to convert.
|
|
127
127
|
* @returns Criteria string in the format `(field:filter:escapedValue)`
|
|
128
128
|
*
|
|
129
129
|
* @example
|
|
@@ -5,9 +5,9 @@ import { type ZohoSearchRecordsCriteriaEntryArray } from './criteria';
|
|
|
5
5
|
*
|
|
6
6
|
* When used within an OR criteria tree, this enables searching for records matching any of the provided emails.
|
|
7
7
|
*
|
|
8
|
-
* @param emails - Single email or array of emails to create criteria entries for
|
|
8
|
+
* @param emails - Single email or array of emails to create criteria entries for.
|
|
9
9
|
* @param field - Record field name to match against. Defaults to `'Email'`.
|
|
10
|
-
* @returns Array of criteria entries, one per email, each using the `equals` filter
|
|
10
|
+
* @returns Array of criteria entries, one per email, each using the `equals` filter.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```typescript
|
|
@@ -48,16 +48,16 @@ export type ZohoSignGetDocumentFunction = (input: ZohoSignGetDocumentInput) => P
|
|
|
48
48
|
* Fetches the full details of a single Zoho Sign request (envelope) by its ID,
|
|
49
49
|
* including actions, documents, and field data.
|
|
50
50
|
*
|
|
51
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
52
|
-
* @returns Function that retrieves a document by request ID
|
|
51
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
52
|
+
* @returns Function that retrieves a document by request ID.
|
|
53
|
+
*
|
|
54
|
+
* @see https://www.zoho.com/sign/api/document-managment/get-details-of-a-particular-document.html
|
|
53
55
|
*
|
|
54
56
|
* @example
|
|
55
57
|
* ```typescript
|
|
56
58
|
* const getDocument = zohoSignGetDocument(context);
|
|
57
59
|
* const response = await getDocument({ requestId: '12345' });
|
|
58
60
|
* ```
|
|
59
|
-
*
|
|
60
|
-
* @see https://www.zoho.com/sign/api/document-managment/get-details-of-a-particular-document.html
|
|
61
61
|
*/
|
|
62
62
|
export declare function zohoSignGetDocument(context: ZohoSignContext): ZohoSignGetDocumentFunction;
|
|
63
63
|
export interface ZohoSignGetDocumentsInput extends ZohoSignPageFilter {
|
|
@@ -72,16 +72,16 @@ export type ZohoSignGetDocumentsFunction = (input: ZohoSignGetDocumentsInput) =>
|
|
|
72
72
|
* Pagination parameters (`start_index`, `row_count`) are serialized as a
|
|
73
73
|
* JSON `data` query parameter per the Zoho Sign API convention.
|
|
74
74
|
*
|
|
75
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
76
|
-
* @returns Function that retrieves a paginated list of documents
|
|
75
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
76
|
+
* @returns Function that retrieves a paginated list of documents.
|
|
77
|
+
*
|
|
78
|
+
* @see https://www.zoho.com/sign/api/document-managment/get-document-list.html
|
|
77
79
|
*
|
|
78
80
|
* @example
|
|
79
81
|
* ```typescript
|
|
80
82
|
* const getDocuments = zohoSignGetDocuments(context);
|
|
81
83
|
* const response = await getDocuments({ start_index: 1, row_count: 10 });
|
|
82
84
|
* ```
|
|
83
|
-
*
|
|
84
|
-
* @see https://www.zoho.com/sign/api/document-managment/get-document-list.html
|
|
85
85
|
*/
|
|
86
86
|
export declare function zohoSignGetDocuments(context: ZohoSignContext): ZohoSignGetDocumentsFunction;
|
|
87
87
|
/**
|
|
@@ -91,8 +91,8 @@ export declare function zohoSignGetDocuments(context: ZohoSignContext): ZohoSign
|
|
|
91
91
|
* `start_index`/`row_count` pagination, making it easy to iterate
|
|
92
92
|
* through all documents across multiple pages.
|
|
93
93
|
*
|
|
94
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
95
|
-
* @returns Page factory for iterating through documents
|
|
94
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
95
|
+
* @returns Page factory for iterating through documents.
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* ```typescript
|
|
@@ -102,6 +102,7 @@ export declare function zohoSignGetDocuments(context: ZohoSignContext): ZohoSign
|
|
|
102
102
|
* const firstPage = await fetchPage.fetchNext();
|
|
103
103
|
* const secondPage = await firstPage.fetchNext();
|
|
104
104
|
* ```
|
|
105
|
+
*
|
|
105
106
|
* @__NO_SIDE_EFFECTS__
|
|
106
107
|
*/
|
|
107
108
|
export declare function zohoSignGetDocumentsPageFactory(context: ZohoSignContext): import("@dereekb/util/fetch").FetchPageFactory<ZohoSignGetDocumentsInput, ZohoSignGetDocumentsResponse>;
|
|
@@ -116,16 +117,16 @@ export type ZohoSignGetDocumentFormDataFunction = (input: ZohoSignGetDocumentFor
|
|
|
116
117
|
* returns data after all recipients have signed. The response includes
|
|
117
118
|
* field labels and values grouped by recipient action.
|
|
118
119
|
*
|
|
119
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
120
|
-
* @returns Function that retrieves form data for a completed document
|
|
120
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
121
|
+
* @returns Function that retrieves form data for a completed document.
|
|
122
|
+
*
|
|
123
|
+
* @see https://www.zoho.com/sign/api/document-managment/get-document-form-data.html
|
|
121
124
|
*
|
|
122
125
|
* @example
|
|
123
126
|
* ```typescript
|
|
124
127
|
* const getFormData = zohoSignGetDocumentFormData(context);
|
|
125
128
|
* const response = await getFormData({ requestId: '12345' });
|
|
126
129
|
* ```
|
|
127
|
-
*
|
|
128
|
-
* @see https://www.zoho.com/sign/api/document-managment/get-document-form-data.html
|
|
129
130
|
*/
|
|
130
131
|
export declare function zohoSignGetDocumentFormData(context: ZohoSignContext): ZohoSignGetDocumentFormDataFunction;
|
|
131
132
|
export type ZohoSignRetrieveFieldTypesFunction = () => Promise<ZohoSignRetrieveFieldTypesResponse>;
|
|
@@ -136,16 +137,16 @@ export type ZohoSignRetrieveFieldTypesFunction = () => Promise<ZohoSignRetrieveF
|
|
|
136
137
|
* that can be placed on documents. Useful for dynamically building document
|
|
137
138
|
* templates or validating field configurations.
|
|
138
139
|
*
|
|
139
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
140
|
-
* @returns Function that retrieves all available field types
|
|
140
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
141
|
+
* @returns Function that retrieves all available field types.
|
|
142
|
+
*
|
|
143
|
+
* @see https://www.zoho.com/sign/api/document-managment/retrieve-field-type.html
|
|
141
144
|
*
|
|
142
145
|
* @example
|
|
143
146
|
* ```typescript
|
|
144
147
|
* const retrieveFieldTypes = zohoSignRetrieveFieldTypes(context);
|
|
145
148
|
* const response = await retrieveFieldTypes();
|
|
146
149
|
* ```
|
|
147
|
-
*
|
|
148
|
-
* @see https://www.zoho.com/sign/api/document-managment/retrieve-field-type.html
|
|
149
150
|
*/
|
|
150
151
|
export declare function zohoSignRetrieveFieldTypes(context: ZohoSignContext): ZohoSignRetrieveFieldTypesFunction;
|
|
151
152
|
export interface ZohoSignDownloadPdfInput {
|
|
@@ -173,8 +174,10 @@ export type ZohoSignDownloadPdfFunction = (input: ZohoSignDownloadPdfInput) => P
|
|
|
173
174
|
* completion certificate, merge all documents, or provide a password for
|
|
174
175
|
* protected files.
|
|
175
176
|
*
|
|
176
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
177
|
-
* @returns Function that downloads signed PDFs by request ID
|
|
177
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
178
|
+
* @returns Function that downloads signed PDFs by request ID.
|
|
179
|
+
*
|
|
180
|
+
* @see https://www.zoho.com/sign/api/document-managment/download-pdf.html
|
|
178
181
|
*
|
|
179
182
|
* @example
|
|
180
183
|
* ```typescript
|
|
@@ -189,8 +192,6 @@ export type ZohoSignDownloadPdfFunction = (input: ZohoSignDownloadPdfInput) => P
|
|
|
189
192
|
*
|
|
190
193
|
* const blob = await response.blob();
|
|
191
194
|
* ```
|
|
192
|
-
*
|
|
193
|
-
* @see https://www.zoho.com/sign/api/document-managment/download-pdf.html
|
|
194
195
|
*/
|
|
195
196
|
export declare function zohoSignDownloadPdf(context: ZohoSignContext): ZohoSignDownloadPdfFunction;
|
|
196
197
|
export interface ZohoSignDownloadCompletionCertificateInput {
|
|
@@ -204,8 +205,10 @@ export type ZohoSignDownloadCompletionCertificateFunction = (input: ZohoSignDown
|
|
|
204
205
|
* certificate contains an audit trail of the signing process including
|
|
205
206
|
* timestamps and recipient details. Returns a raw {@link Response}.
|
|
206
207
|
*
|
|
207
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
208
|
-
* @returns Function that downloads the completion certificate by request ID
|
|
208
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
209
|
+
* @returns Function that downloads the completion certificate by request ID.
|
|
210
|
+
*
|
|
211
|
+
* @see https://www.zoho.com/sign/api/document-managment/download-completion-certificate.html
|
|
209
212
|
*
|
|
210
213
|
* @example
|
|
211
214
|
* ```typescript
|
|
@@ -213,8 +216,6 @@ export type ZohoSignDownloadCompletionCertificateFunction = (input: ZohoSignDown
|
|
|
213
216
|
* const response = await downloadCert({ requestId: '12345' });
|
|
214
217
|
* const blob = await response.blob();
|
|
215
218
|
* ```
|
|
216
|
-
*
|
|
217
|
-
* @see https://www.zoho.com/sign/api/document-managment/download-completion-certificate.html
|
|
218
219
|
*/
|
|
219
220
|
export declare function zohoSignDownloadCompletionCertificate(context: ZohoSignContext): ZohoSignDownloadCompletionCertificateFunction;
|
|
220
221
|
export interface ZohoSignCreateDocumentInput {
|
|
@@ -236,8 +237,10 @@ export type ZohoSignCreateDocumentFunction = (input: ZohoSignCreateDocumentInput
|
|
|
236
237
|
* The created document starts in draft status and must be submitted
|
|
237
238
|
* separately via {@link zohoSignSendDocumentForSignature}.
|
|
238
239
|
*
|
|
239
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
240
|
-
* @returns Function that creates a new document draft
|
|
240
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
241
|
+
* @returns Function that creates a new document draft.
|
|
242
|
+
*
|
|
243
|
+
* @see https://www.zoho.com/sign/api/document-managment/create-document.html
|
|
241
244
|
*
|
|
242
245
|
* @example
|
|
243
246
|
* ```typescript
|
|
@@ -260,8 +263,6 @@ export type ZohoSignCreateDocumentFunction = (input: ZohoSignCreateDocumentInput
|
|
|
260
263
|
*
|
|
261
264
|
* const draftId = response.requests.request_id;
|
|
262
265
|
* ```
|
|
263
|
-
*
|
|
264
|
-
* @see https://www.zoho.com/sign/api/document-managment/create-document.html
|
|
265
266
|
*/
|
|
266
267
|
export declare function zohoSignCreateDocument(context: ZohoSignContext): ZohoSignCreateDocumentFunction;
|
|
267
268
|
export interface ZohoSignUpdateDocumentInput {
|
|
@@ -277,8 +278,10 @@ export type ZohoSignUpdateDocumentFunction = (input: ZohoSignUpdateDocumentInput
|
|
|
277
278
|
* expiration settings. Cannot be used on documents that have already been
|
|
278
279
|
* submitted for signature.
|
|
279
280
|
*
|
|
280
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
281
|
-
* @returns Function that updates a draft document by request ID
|
|
281
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
282
|
+
* @returns Function that updates a draft document by request ID.
|
|
283
|
+
*
|
|
284
|
+
* @see https://www.zoho.com/sign/api/document-managment/update-document.html
|
|
282
285
|
*
|
|
283
286
|
* @example
|
|
284
287
|
* ```typescript
|
|
@@ -289,8 +292,6 @@ export type ZohoSignUpdateDocumentFunction = (input: ZohoSignUpdateDocumentInput
|
|
|
289
292
|
* data: { notes: 'Updated notes for this document' }
|
|
290
293
|
* });
|
|
291
294
|
* ```
|
|
292
|
-
*
|
|
293
|
-
* @see https://www.zoho.com/sign/api/document-managment/update-document.html
|
|
294
295
|
*/
|
|
295
296
|
export declare function zohoSignUpdateDocument(context: ZohoSignContext): ZohoSignUpdateDocumentFunction;
|
|
296
297
|
export interface ZohoSignSendDocumentForSignatureInput {
|
|
@@ -306,8 +307,10 @@ export type ZohoSignSendDocumentForSignatureFunction = (input: ZohoSignSendDocum
|
|
|
306
307
|
* submission. Once submitted, the document transitions from draft to
|
|
307
308
|
* "inprogress" status and recipients receive signing notifications.
|
|
308
309
|
*
|
|
309
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
310
|
-
* @returns Function that sends a document for signature by request ID
|
|
310
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
311
|
+
* @returns Function that sends a document for signature by request ID.
|
|
312
|
+
*
|
|
313
|
+
* @see https://www.zoho.com/sign/api/document-managment/send-document-for-signature.html
|
|
311
314
|
*
|
|
312
315
|
* @example
|
|
313
316
|
* ```typescript
|
|
@@ -322,8 +325,6 @@ export type ZohoSignSendDocumentForSignatureFunction = (input: ZohoSignSendDocum
|
|
|
322
325
|
* data: { expiration_days: 30 }
|
|
323
326
|
* });
|
|
324
327
|
* ```
|
|
325
|
-
*
|
|
326
|
-
* @see https://www.zoho.com/sign/api/document-managment/send-document-for-signature.html
|
|
327
328
|
*/
|
|
328
329
|
export declare function zohoSignSendDocumentForSignature(context: ZohoSignContext): ZohoSignSendDocumentForSignatureFunction;
|
|
329
330
|
export interface ZohoSignExtendDocumentInput {
|
|
@@ -343,16 +344,16 @@ export type ZohoSignExtendDocumentFunction = (input: ZohoSignExtendDocumentInput
|
|
|
343
344
|
* provided as a human-readable string (e.g. "30 November 2024"). Useful for
|
|
344
345
|
* giving recipients additional time to complete signing.
|
|
345
346
|
*
|
|
346
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
347
|
-
* @returns Function that extends a document's expiration by request ID
|
|
347
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
348
|
+
* @returns Function that extends a document's expiration by request ID.
|
|
349
|
+
*
|
|
350
|
+
* @see https://www.zoho.com/sign/api/document-managment/extend-document.html
|
|
348
351
|
*
|
|
349
352
|
* @example
|
|
350
353
|
* ```typescript
|
|
351
354
|
* const extendDocument = zohoSignExtendDocument(context);
|
|
352
355
|
* await extendDocument({ requestId: '12345', expire_by: '30 November 2024' });
|
|
353
356
|
* ```
|
|
354
|
-
*
|
|
355
|
-
* @see https://www.zoho.com/sign/api/document-managment/extend-document.html
|
|
356
357
|
*/
|
|
357
358
|
export declare function zohoSignExtendDocument(context: ZohoSignContext): ZohoSignExtendDocumentFunction;
|
|
358
359
|
export interface ZohoSignDeleteDocumentInput {
|
|
@@ -375,8 +376,10 @@ export type ZohoSignDeleteDocumentFunction = (input: ZohoSignDeleteDocumentInput
|
|
|
375
376
|
* from recipients before deletion. An optional `reason` can be provided
|
|
376
377
|
* to explain the recall. Sends the parameters as URL-encoded form data.
|
|
377
378
|
*
|
|
378
|
-
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting
|
|
379
|
-
* @returns Function that deletes a document by request ID
|
|
379
|
+
* @param context - Authenticated Zoho Sign context providing fetch and rate limiting.
|
|
380
|
+
* @returns Function that deletes a document by request ID.
|
|
381
|
+
*
|
|
382
|
+
* @see https://www.zoho.com/sign/api/document-managment/delete-document.html
|
|
380
383
|
*
|
|
381
384
|
* @example
|
|
382
385
|
* ```typescript
|
|
@@ -392,7 +395,5 @@ export type ZohoSignDeleteDocumentFunction = (input: ZohoSignDeleteDocumentInput
|
|
|
392
395
|
* reason: 'Contract terms changed'
|
|
393
396
|
* });
|
|
394
397
|
* ```
|
|
395
|
-
*
|
|
396
|
-
* @see https://www.zoho.com/sign/api/document-managment/delete-document.html
|
|
397
398
|
*/
|
|
398
399
|
export declare function zohoSignDeleteDocument(context: ZohoSignContext): ZohoSignDeleteDocumentFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Maybe } from '@dereekb/util';
|
|
1
|
+
import { type SuggestedString, type Maybe } from '@dereekb/util';
|
|
2
2
|
import { type FetchPageFactoryConfigDefaults } from '@dereekb/util/fetch';
|
|
3
3
|
/**
|
|
4
4
|
* Pagination parameters for Zoho Sign list endpoints.
|
|
@@ -27,7 +27,7 @@ export interface ZohoSignPageFilter {
|
|
|
27
27
|
/**
|
|
28
28
|
* Known sortable column names for Zoho Sign list endpoints, with a `string` fallback for custom columns.
|
|
29
29
|
*/
|
|
30
|
-
export type ZohoSignSortColumn = 'request_name' | 'folder_name' | 'owner_full_name' | 'recipient_email' | 'form_name' | 'created_time'
|
|
30
|
+
export type ZohoSignSortColumn = SuggestedString<'request_name' | 'folder_name' | 'owner_full_name' | 'recipient_email' | 'form_name' | 'created_time'>;
|
|
31
31
|
/**
|
|
32
32
|
* Sort direction for Zoho Sign list queries.
|
|
33
33
|
*/
|
|
@@ -90,9 +90,9 @@ export type ZohoSignFetchPageFetchFunction<I extends ZohoSignPageFilter, R exten
|
|
|
90
90
|
* The factory reads `page_context.has_more_rows` from each response to determine if additional
|
|
91
91
|
* pages exist, and automatically advances `start_index` by `row_count` for subsequent requests.
|
|
92
92
|
*
|
|
93
|
-
* @param fetch - The Zoho Sign fetch function to paginate over
|
|
94
|
-
* @param defaults - Optional default configuration for the page factory
|
|
95
|
-
* @returns A page factory that produces iterable page fetchers
|
|
93
|
+
* @param fetch - The Zoho Sign fetch function to paginate over.
|
|
94
|
+
* @param defaults - Optional default configuration for the page factory.
|
|
95
|
+
* @returns A page factory that produces iterable page fetchers.
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* ```typescript
|
|
@@ -105,6 +105,7 @@ export type ZohoSignFetchPageFetchFunction<I extends ZohoSignPageFilter, R exten
|
|
|
105
105
|
* const secondPage = await firstPage.fetchNext();
|
|
106
106
|
* }
|
|
107
107
|
* ```
|
|
108
|
+
*
|
|
108
109
|
* @__NO_SIDE_EFFECTS__
|
|
109
110
|
*/
|
|
110
111
|
export declare function zohoSignFetchPageFactory<I extends ZohoSignPageFilter, R extends ZohoSignPageResult<any>>(fetch: ZohoSignFetchPageFetchFunction<I, R>, defaults?: Maybe<FetchPageFactoryConfigDefaults>): import("@dereekb/util/fetch").FetchPageFactory<I, R>;
|
|
@@ -10,8 +10,8 @@ export type ZohoSignConfigApiUrlInput = ZohoSignApiUrlKey | ZohoSignApiUrl;
|
|
|
10
10
|
/**
|
|
11
11
|
* Resolves an environment key or passthrough URL to the full Zoho Sign API URL.
|
|
12
12
|
*
|
|
13
|
-
* @param input - An environment key ('sandbox' or 'production') or a full API URL
|
|
14
|
-
* @returns The resolved Zoho Sign API URL
|
|
13
|
+
* @param input - An environment key ('sandbox' or 'production') or a full API URL.
|
|
14
|
+
* @returns The resolved Zoho Sign API URL.
|
|
15
15
|
*/
|
|
16
16
|
export declare function zohoSignConfigApiUrl(input: ZohoSignConfigApiUrlInput): ZohoApiUrl;
|
|
17
17
|
export type ZohoSignConfig = ZohoConfig;
|
package/src/lib/sign/sign.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EmailAddress, type FileSize, type HexColorCode, type PageNumber, type Pixels, type UnixDateTimeMillisecondsNumber } from '@dereekb/util';
|
|
1
|
+
import { type EmailAddress, type FileSize, type HexColorCode, type SuggestedString, type PageNumber, type Pixels, type UnixDateTimeMillisecondsNumber } from '@dereekb/util';
|
|
2
2
|
/**
|
|
3
3
|
* An identifier in Zoho Sign.
|
|
4
4
|
*/
|
|
@@ -40,7 +40,7 @@ export type ZohoSignFieldTypeId = string;
|
|
|
40
40
|
/**
|
|
41
41
|
* Status of a Zoho Sign request.
|
|
42
42
|
*/
|
|
43
|
-
export type ZohoSignRequestStatus = 'inprogress' | 'completed' | 'recalled' | 'declined' | 'expired'
|
|
43
|
+
export type ZohoSignRequestStatus = SuggestedString<'inprogress' | 'completed' | 'recalled' | 'declined' | 'expired'>;
|
|
44
44
|
/**
|
|
45
45
|
* Recipient action type in Zoho Sign.
|
|
46
46
|
*/
|
|
@@ -52,7 +52,7 @@ export type ZohoSignVerificationType = 'EMAIL' | 'SMS' | 'OFFLINE';
|
|
|
52
52
|
/**
|
|
53
53
|
* Field type name for document fields.
|
|
54
54
|
*/
|
|
55
|
-
export type ZohoSignFieldTypeName = 'Checkbox' | 'Radiogroup' | 'Signature' | 'Initial' | 'Textfield' | 'Email' | 'Date' | 'Name' | 'Company' | 'Jobtitle' | 'CustomDate' | 'Dropdown' | 'Attachment' | 'Checkout'
|
|
55
|
+
export type ZohoSignFieldTypeName = SuggestedString<'Checkbox' | 'Radiogroup' | 'Signature' | 'Initial' | 'Textfield' | 'Email' | 'Date' | 'Name' | 'Company' | 'Jobtitle' | 'CustomDate' | 'Dropdown' | 'Attachment' | 'Checkout'>;
|
|
56
56
|
/**
|
|
57
57
|
* Name format for name fields.
|
|
58
58
|
*/
|
|
@@ -60,7 +60,7 @@ export type ZohoSignNameFormat = 'FIRST_NAME' | 'LAST_NAME' | 'FULL_NAME';
|
|
|
60
60
|
/**
|
|
61
61
|
* Field category classification.
|
|
62
62
|
*/
|
|
63
|
-
export type ZohoSignFieldCategory = 'textfield' | 'image' | 'datefield'
|
|
63
|
+
export type ZohoSignFieldCategory = SuggestedString<'textfield' | 'image' | 'datefield'>;
|
|
64
64
|
/**
|
|
65
65
|
* Definition of a field type available in Zoho Sign.
|
|
66
66
|
*/
|
|
@@ -4,16 +4,16 @@ export declare const logZohoSignErrorToConsole: import("..").LogZohoServerErrorF
|
|
|
4
4
|
/**
|
|
5
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
6
|
*
|
|
7
|
-
* @param responseError - The fetch response error to parse
|
|
8
|
-
* @returns Parsed Zoho server error, or undefined if parsing fails
|
|
7
|
+
* @param responseError - The fetch response error to parse.
|
|
8
|
+
* @returns Parsed Zoho server error, or undefined if parsing fails.
|
|
9
9
|
*/
|
|
10
10
|
export declare function parseZohoSignError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
11
11
|
/**
|
|
12
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
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
|
|
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
17
|
*/
|
|
18
18
|
export declare function parseZohoSignServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData | ZohoServerErrorResponseDataArrayRef, responseError: FetchResponseError): ParsedZohoServerError;
|
|
19
19
|
export declare const interceptZohoSign200StatusWithErrorResponse: import("@dereekb/util/fetch").FetchJsonInterceptJsonResponseFunction;
|
|
@@ -38,8 +38,8 @@ export type ZohoSignFactory = (config: ZohoSignConfig) => ZohoSign;
|
|
|
38
38
|
* Each client handles OAuth token refresh on {@link ZohoInvalidTokenError}, rate limiting,
|
|
39
39
|
* and Zoho Sign's non-standard error responses (200 status with error body).
|
|
40
40
|
*
|
|
41
|
-
* @param factoryConfig - Configuration providing account credentials and optional overrides
|
|
42
|
-
* @returns A factory function that creates authenticated Zoho Sign clients
|
|
41
|
+
* @param factoryConfig - Configuration providing account credentials and optional overrides.
|
|
42
|
+
* @returns A factory function that creates authenticated Zoho Sign clients.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```typescript
|
|
@@ -54,6 +54,7 @@ export type ZohoSignFactory = (config: ZohoSignConfig) => ZohoSign;
|
|
|
54
54
|
* // Use the sign context for API calls:
|
|
55
55
|
* const { signContext } = zohoSign;
|
|
56
56
|
* ```
|
|
57
|
+
*
|
|
57
58
|
* @__NO_SIDE_EFFECTS__
|
|
58
59
|
*/
|
|
59
60
|
export declare function zohoSignFactory(factoryConfig: ZohoSignFactoryConfig): ZohoSignFactory;
|
|
@@ -35,7 +35,7 @@ export interface ZohoPageResult<T, I extends ZohoPageResultInfo = ZohoPageResult
|
|
|
35
35
|
* Creates an empty {@link ZohoPageResult} with no data and `more_records: false`.
|
|
36
36
|
* Useful as a fallback when the API returns `null` instead of an empty result.
|
|
37
37
|
*
|
|
38
|
-
* @returns An empty page result with default pagination info
|
|
38
|
+
* @returns An empty page result with default pagination info.
|
|
39
39
|
*/
|
|
40
40
|
export declare function emptyZohoPageResult<T = unknown>(): ZohoPageResult<T>;
|
|
41
41
|
/**
|
|
@@ -76,9 +76,9 @@ export type ZohoFetchPageFetchFunction<I extends ZohoPageFilter, R extends ZohoP
|
|
|
76
76
|
* The factory reads `info.more_records` from each response to determine if additional
|
|
77
77
|
* pages exist, and automatically increments the `page` parameter for subsequent requests.
|
|
78
78
|
*
|
|
79
|
-
* @param fetch - The Zoho fetch function to paginate over
|
|
80
|
-
* @param defaults - Optional default configuration for the page factory
|
|
81
|
-
* @returns A page factory that produces iterable page fetchers
|
|
79
|
+
* @param fetch - The Zoho fetch function to paginate over.
|
|
80
|
+
* @param defaults - Optional default configuration for the page factory.
|
|
81
|
+
* @returns A page factory that produces iterable page fetchers.
|
|
82
82
|
*
|
|
83
83
|
* @example
|
|
84
84
|
* ```typescript
|
|
@@ -91,6 +91,7 @@ export type ZohoFetchPageFetchFunction<I extends ZohoPageFilter, R extends ZohoP
|
|
|
91
91
|
* const secondPage = await firstPage.fetchNext();
|
|
92
92
|
* }
|
|
93
93
|
* ```
|
|
94
|
+
*
|
|
94
95
|
* @__NO_SIDE_EFFECTS__
|
|
95
96
|
*/
|
|
96
97
|
export declare function zohoFetchPageFactory<I extends ZohoPageFilter, R extends ZohoPageResult<any>>(fetch: ZohoFetchPageFetchFunction<I, R>, defaults?: Maybe<FetchPageFactoryConfigDefaults>): import("@dereekb/util/fetch").FetchPageFactory<I, R>;
|