@dereekb/zoho 12.6.21 → 13.0.0
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/LICENSE +1 -1
- package/index.cjs.js +1763 -2531
- package/index.esm.js +1655 -2524
- package/nestjs/index.cjs.js +598 -0
- package/nestjs/index.esm.js +582 -0
- package/nestjs/package.json +19 -3
- package/nestjs/src/lib/accounts/accounts.config.d.ts +32 -0
- package/nestjs/src/lib/crm/crm.api.d.ts +43 -0
- package/nestjs/src/lib/crm/crm.config.d.ts +10 -0
- package/nestjs/src/lib/crm/crm.module.d.ts +24 -0
- package/nestjs/src/lib/crm/index.d.ts +3 -0
- package/nestjs/src/lib/recruit/recruit.api.d.ts +7 -7
- package/package.json +14 -7
- package/src/lib/accounts/accounts.api.d.ts +1 -1
- package/src/lib/accounts/accounts.error.api.d.ts +2 -2
- package/src/lib/crm/crm.api.d.ts +430 -0
- package/src/lib/crm/crm.api.notes.d.ts +40 -0
- package/src/lib/crm/crm.api.tags.d.ts +160 -0
- package/src/lib/crm/crm.config.d.ts +24 -0
- package/src/lib/crm/crm.criteria.d.ts +19 -0
- package/src/lib/crm/crm.d.ts +325 -0
- package/src/lib/crm/crm.error.api.d.ts +52 -0
- package/src/lib/crm/crm.factory.d.ts +22 -0
- package/src/lib/crm/crm.notes.d.ts +48 -0
- package/src/lib/crm/crm.tags.d.ts +40 -0
- package/src/lib/crm/index.d.ts +10 -0
- package/src/lib/index.d.ts +1 -0
- package/src/lib/recruit/index.d.ts +0 -1
- package/src/lib/recruit/recruit.api.candidates.d.ts +6 -6
- package/src/lib/recruit/recruit.api.d.ts +102 -22
- package/src/lib/recruit/recruit.api.notes.d.ts +30 -6
- package/src/lib/recruit/recruit.api.tags.d.ts +30 -6
- package/src/lib/recruit/recruit.criteria.d.ts +8 -44
- package/src/lib/recruit/recruit.d.ts +7 -3
- package/src/lib/recruit/recruit.error.api.d.ts +7 -3
- package/src/lib/shared/criteria.d.ts +55 -0
- package/src/lib/shared/criteria.util.d.ts +10 -0
- package/src/lib/zoho.error.api.d.ts +64 -6
- package/src/lib/zoho.type.d.ts +1 -18
- package/nestjs/CHANGELOG.md +0 -459
- package/nestjs/README.md +0 -11
- package/nestjs/src/index.js +0 -5
- package/nestjs/src/index.js.map +0 -1
- package/nestjs/src/lib/accounts/accounts.api.js +0 -37
- package/nestjs/src/lib/accounts/accounts.api.js.map +0 -1
- package/nestjs/src/lib/accounts/accounts.config.js +0 -50
- package/nestjs/src/lib/accounts/accounts.config.js.map +0 -1
- package/nestjs/src/lib/accounts/accounts.service.js +0 -240
- package/nestjs/src/lib/accounts/accounts.service.js.map +0 -1
- package/nestjs/src/lib/accounts/index.js +0 -7
- package/nestjs/src/lib/accounts/index.js.map +0 -1
- package/nestjs/src/lib/index.js +0 -7
- package/nestjs/src/lib/index.js.map +0 -1
- package/nestjs/src/lib/recruit/index.js +0 -7
- package/nestjs/src/lib/recruit/index.js.map +0 -1
- package/nestjs/src/lib/recruit/recruit.api.js +0 -130
- package/nestjs/src/lib/recruit/recruit.api.js.map +0 -1
- package/nestjs/src/lib/recruit/recruit.config.js +0 -16
- package/nestjs/src/lib/recruit/recruit.config.js.map +0 -1
- package/nestjs/src/lib/recruit/recruit.module.js +0 -61
- package/nestjs/src/lib/recruit/recruit.module.js.map +0 -1
- package/nestjs/src/lib/zoho.config.js +0 -52
- package/nestjs/src/lib/zoho.config.js.map +0 -1
- package/src/lib/recruit/recruit.criteria.util.d.ts +0 -10
- /package/{index.cjs.d.ts → index.d.ts} +0 -0
- /package/{index.esm.d.ts → nestjs/index.d.ts} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ZohoPageResult } from '../zoho.api.page';
|
|
2
|
+
import { type FetchPageFactory } from '@dereekb/util/fetch';
|
|
3
|
+
import { type ZohoCrmContext } from './crm.config';
|
|
4
|
+
import { type ZohoCrmModuleNameRef, type ZohoCrmRecordId } from './crm';
|
|
5
|
+
import { type ArrayOrValue } from '@dereekb/util';
|
|
6
|
+
import { type ZohoCrmMultiRecordResult, type ZohoCrmChangeObjectResponseSuccessEntry, type ZohoCrmChangeObjectResponseErrorEntry, type ZohoCrmChangeObjectResponse, type ZohoCrmGetRelatedRecordsRequestWithFields } from './crm.api';
|
|
7
|
+
import { type NewZohoCrmNoteData, type ZohoCrmNoteId, type ZohoCrmRecordNote } from './crm.notes';
|
|
8
|
+
export interface ZohoCrmCreateNotesRequest {
|
|
9
|
+
readonly data: ZohoCrmCreateNotesRequestEntry[];
|
|
10
|
+
}
|
|
11
|
+
export type ZohoCrmCreateNotesResult = ZohoCrmMultiRecordResult<ZohoCrmCreateNotesRequestEntry, ZohoCrmChangeObjectResponseSuccessEntry, ZohoCrmChangeObjectResponseErrorEntry>;
|
|
12
|
+
export type ZohoCrmCreateNotesRequestEntry = NewZohoCrmNoteData;
|
|
13
|
+
export type ZohoCrmCreateNotesResponse = ZohoCrmChangeObjectResponse;
|
|
14
|
+
export type ZohoCrmCreateNotesFunction = (input: ZohoCrmCreateNotesRequest) => Promise<ZohoCrmCreateNotesResult>;
|
|
15
|
+
export declare function zohoCrmCreateNotes(context: ZohoCrmContext): (input: ZohoCrmCreateNotesRequest) => Promise<ZohoCrmMultiRecordResult<NewZohoCrmNoteData, ZohoCrmChangeObjectResponseSuccessEntry<import("./crm").ZohoCrmChangeObjectDetails>, ZohoCrmChangeObjectResponseErrorEntry>>;
|
|
16
|
+
export interface ZohoCrmDeleteNotesRequest {
|
|
17
|
+
readonly ids: ArrayOrValue<ZohoCrmNoteId>;
|
|
18
|
+
}
|
|
19
|
+
export type ZohoCrmDeleteNotesResult = ZohoCrmMultiRecordResult<ZohoCrmNoteId, ZohoCrmChangeObjectResponseSuccessEntry, ZohoCrmChangeObjectResponseErrorEntry>;
|
|
20
|
+
export type ZohoCrmDeleteNotesResponse = ZohoCrmChangeObjectResponse;
|
|
21
|
+
export type ZohoCrmDeleteNotesFunction = (input: ZohoCrmDeleteNotesRequest) => Promise<ZohoCrmDeleteNotesResult>;
|
|
22
|
+
export declare function zohoCrmDeleteNotes(context: ZohoCrmContext): (input: ZohoCrmDeleteNotesRequest) => Promise<ZohoCrmMultiRecordResult<string, ZohoCrmChangeObjectResponseSuccessEntry<import("./crm").ZohoCrmChangeObjectDetails>, ZohoCrmChangeObjectResponseErrorEntry>>;
|
|
23
|
+
export type ZohoCrmGetNotesForRecordRequest = ZohoCrmGetRelatedRecordsRequestWithFields;
|
|
24
|
+
export type ZohoCrmGetNotesForRecordResponse = ZohoPageResult<ZohoCrmRecordNote>;
|
|
25
|
+
export type ZohoCrmGetNotesForRecordFunction = (input: ZohoCrmGetNotesForRecordRequest) => Promise<ZohoCrmGetNotesForRecordResponse>;
|
|
26
|
+
export declare function zohoCrmGetNotesForRecord(context: ZohoCrmContext): ZohoCrmGetNotesForRecordFunction;
|
|
27
|
+
export type ZohoCrmGetNotesForRecordPageFactory = FetchPageFactory<ZohoCrmGetNotesForRecordRequest, ZohoCrmGetNotesForRecordResponse>;
|
|
28
|
+
export declare function zohoCrmGetNotesForRecordPageFactory(context: ZohoCrmContext): ZohoCrmGetNotesForRecordPageFactory;
|
|
29
|
+
export interface ZohoCrmCreateNotesForRecordRequest extends ZohoCrmModuleNameRef {
|
|
30
|
+
readonly id: ZohoCrmRecordId;
|
|
31
|
+
readonly notes: ArrayOrValue<Omit<NewZohoCrmNoteData, 'se_module' | 'Parent_Id'>>;
|
|
32
|
+
}
|
|
33
|
+
export type ZohoCrmCreateNotesForRecordFunction = (input: ZohoCrmCreateNotesForRecordRequest) => Promise<ZohoCrmCreateNotesResult>;
|
|
34
|
+
/**
|
|
35
|
+
* https://www.zoho.com/crm/developer/docs/api/v8/create-notes.html
|
|
36
|
+
*
|
|
37
|
+
* @param context
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
export declare function zohoCrmCreateNotesForRecord(context: ZohoCrmContext): ZohoCrmCreateNotesForRecordFunction;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type ZohoCrmContext } from './crm.config';
|
|
2
|
+
import { type ArrayOrValue, type Maybe } from '@dereekb/util';
|
|
3
|
+
import { type ZohoCrmModuleNameRef, type ZohoCrmRecordId } from './crm';
|
|
4
|
+
import { type ZohoCrmChangeObjectLikeResponse, type ZohoCrmChangeObjectLikeResponseSuccessEntryMeta, type ZohoCrmChangeObjectResponse, type ZohoCrmChangeObjectResponseErrorEntry, type ZohoCrmChangeObjectResponseSuccessEntry, type ZohoCrmGetRecordsPageFilter, type ZohoCrmMultiRecordResult, type ZohoCrmMultiRecordResultEntry } from './crm.api';
|
|
5
|
+
import { type ZohoCrmTagId, type ZohoCrmTagData, type ZohoCrmTagName, type ZohoCrmTagWithObjectDetails } from './crm.tags';
|
|
6
|
+
import { type FetchPage, type FetchPageFactoryOptions } from '@dereekb/util/fetch';
|
|
7
|
+
import { type ZohoPageResult } from '../zoho.api.page';
|
|
8
|
+
export type ZohoCrmCreateTagData = Pick<ZohoCrmTagData, 'name'> & Partial<Pick<ZohoCrmTagData, 'color_code'>>;
|
|
9
|
+
export interface ZohoCrmCreateTagsRequest extends ZohoCrmModuleNameRef {
|
|
10
|
+
readonly tags: ArrayOrValue<ZohoCrmCreateTagData>;
|
|
11
|
+
}
|
|
12
|
+
export interface ZohoCrmCreateTagsResponse {
|
|
13
|
+
readonly tags: ZohoCrmChangeObjectResponse['data'];
|
|
14
|
+
}
|
|
15
|
+
export type ZohoCrmCreateTagsResult = ZohoCrmMultiRecordResult<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseSuccessEntry, ZohoCrmChangeObjectResponseErrorEntry> & {
|
|
16
|
+
readonly duplicateErrorItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseErrorEntry>[];
|
|
17
|
+
readonly allErrorItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseErrorEntry>[];
|
|
18
|
+
};
|
|
19
|
+
export type ZohoCrmCreateTagsFunction = (input: ZohoCrmCreateTagsRequest) => Promise<ZohoCrmCreateTagsResult>;
|
|
20
|
+
export declare function zohoCrmCreateTagsForModule(context: ZohoCrmContext): (input: ZohoCrmCreateTagsRequest) => Promise<{
|
|
21
|
+
errorItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseErrorEntry>[];
|
|
22
|
+
duplicateErrorItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseErrorEntry>[];
|
|
23
|
+
allErrorItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseErrorEntry>[];
|
|
24
|
+
successItems: ZohoCrmMultiRecordResultEntry<ZohoCrmCreateTagData, ZohoCrmChangeObjectResponseSuccessEntry<import("./crm").ZohoCrmChangeObjectDetails>>[];
|
|
25
|
+
}>;
|
|
26
|
+
export interface ZohoCrmDeleteTagRequest {
|
|
27
|
+
readonly id: ZohoCrmTagId;
|
|
28
|
+
}
|
|
29
|
+
export interface ZohoCrmDeleteTagResponseSuccessEntry extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
|
|
30
|
+
readonly details: {
|
|
31
|
+
readonly id: ZohoCrmTagId;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface ZohoCrmDeleteTagResponse {
|
|
35
|
+
readonly tags: ZohoCrmDeleteTagResponseSuccessEntry;
|
|
36
|
+
}
|
|
37
|
+
export type ZohoCrmDeleteTagResult = ZohoCrmDeleteTagResponseSuccessEntry;
|
|
38
|
+
export type ZohoCrmDeleteTagFunction = (input: ZohoCrmDeleteTagRequest) => Promise<ZohoCrmDeleteTagResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Deletes a single tag by ID.
|
|
41
|
+
*
|
|
42
|
+
* Note: A tag cannot be deleted if it is associated with any configuration (e.g. Workflow Rules).
|
|
43
|
+
*
|
|
44
|
+
* https://www.zoho.com/crm/developer/docs/api/v8/delete-tag.html
|
|
45
|
+
*
|
|
46
|
+
* @param context
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare function zohoCrmDeleteTag(context: ZohoCrmContext): ZohoCrmDeleteTagFunction;
|
|
50
|
+
export interface ZohoCrmGetTagsRequest extends ZohoCrmModuleNameRef, ZohoCrmGetRecordsPageFilter {
|
|
51
|
+
readonly my_tags?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ZohoCrmGetTagsResponse extends Omit<ZohoPageResult<ZohoCrmTagWithObjectDetails>, 'data'> {
|
|
54
|
+
readonly tags: ZohoCrmTagWithObjectDetails[];
|
|
55
|
+
}
|
|
56
|
+
export type ZohoCrmGetTagsResult = ZohoPageResult<ZohoCrmTagWithObjectDetails>;
|
|
57
|
+
export type ZohoCrmGetTagsFunction = (input: ZohoCrmGetTagsRequest) => Promise<ZohoCrmGetTagsResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the list of tags within a module.
|
|
60
|
+
*
|
|
61
|
+
* https://www.zoho.com/crm/developer-guide/apiv2/get-tag-list.html
|
|
62
|
+
*
|
|
63
|
+
* @param context
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export declare function zohoCrmGetTagsForModule(context: ZohoCrmContext): ZohoCrmGetTagsFunction;
|
|
67
|
+
export type ZohoCrmGetTagsForModulePageFactory = (input: ZohoCrmGetTagsRequest, options?: Maybe<FetchPageFactoryOptions<ZohoCrmGetTagsRequest, ZohoCrmGetTagsResult>>) => FetchPage<ZohoCrmGetTagsRequest, ZohoCrmGetTagsResult>;
|
|
68
|
+
export declare function zohoCrmGetTagsForModulePageFactory(context: ZohoCrmContext): ZohoCrmGetTagsForModulePageFactory;
|
|
69
|
+
/**
|
|
70
|
+
* Limit enforced by Zoho Crm
|
|
71
|
+
*/
|
|
72
|
+
export declare const ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED = 100;
|
|
73
|
+
export interface ZohoCrmAddTagsToRecordsRequest extends ZohoCrmModuleNameRef {
|
|
74
|
+
/**
|
|
75
|
+
* Tag names to add to the records.
|
|
76
|
+
*/
|
|
77
|
+
readonly tag_names?: Maybe<ArrayOrValue<ZohoCrmTagName>>;
|
|
78
|
+
/**
|
|
79
|
+
* Specific tags to add to the records.
|
|
80
|
+
*/
|
|
81
|
+
readonly tags?: Maybe<ArrayOrValue<ZohoCrmTagData & {
|
|
82
|
+
id?: Maybe<ZohoCrmTagId>;
|
|
83
|
+
}>>;
|
|
84
|
+
/**
|
|
85
|
+
* Specify if the existing tags are to be overwritten.
|
|
86
|
+
*/
|
|
87
|
+
readonly over_write?: Maybe<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Ids corresponding to the records in the module to add the tags to.
|
|
90
|
+
*
|
|
91
|
+
* Max of 100 ids.
|
|
92
|
+
*/
|
|
93
|
+
readonly ids: ArrayOrValue<ZohoCrmRecordId>;
|
|
94
|
+
}
|
|
95
|
+
export interface ZohoCrmAddTagsToRecordsResultDetails {
|
|
96
|
+
/**
|
|
97
|
+
* Record id that was updated
|
|
98
|
+
*/
|
|
99
|
+
readonly id: ZohoCrmRecordId;
|
|
100
|
+
/**
|
|
101
|
+
* Tag names that were added to the record
|
|
102
|
+
*/
|
|
103
|
+
readonly tags: ZohoCrmTagName[];
|
|
104
|
+
}
|
|
105
|
+
export interface ZohoCrmAddTagsToRecordsSuccessEntry extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
|
|
106
|
+
readonly details: ZohoCrmAddTagsToRecordsResultDetails;
|
|
107
|
+
}
|
|
108
|
+
export type ZohoCrmAddTagsToRecordsResponse = ZohoCrmChangeObjectLikeResponse<ZohoCrmAddTagsToRecordsSuccessEntry>;
|
|
109
|
+
/**
|
|
110
|
+
* Contains all the details of the error.
|
|
111
|
+
*/
|
|
112
|
+
export type ZohoCrmAddTagsToRecordsErrorEntryDetails = ZohoCrmAddTagsToRecordsResultDetails;
|
|
113
|
+
export type ZohoCrmAddTagsToRecordsErrorEntry = ZohoCrmChangeObjectResponseErrorEntry & {
|
|
114
|
+
readonly details: ZohoCrmAddTagsToRecordsErrorEntryDetails;
|
|
115
|
+
};
|
|
116
|
+
export type ZohoCrmAddTagsToRecordsResult = ZohoCrmMultiRecordResult<ZohoCrmAddTagsToRecordsRequest, ZohoCrmAddTagsToRecordsSuccessEntry, ZohoCrmAddTagsToRecordsErrorEntry>;
|
|
117
|
+
export type ZohoCrmAddTagsToRecordsFunction = (input: ZohoCrmAddTagsToRecordsRequest) => Promise<ZohoCrmAddTagsToRecordsResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Adds one or more tags to one or more records.
|
|
120
|
+
*
|
|
121
|
+
* https://www.zoho.com/crm/developer-guide/apiv2/add-tags.html
|
|
122
|
+
*
|
|
123
|
+
* @param context
|
|
124
|
+
* @returns
|
|
125
|
+
*/
|
|
126
|
+
export declare function zohoCrmAddTagsToRecords(context: ZohoCrmContext): ZohoCrmAddTagsToRecordsFunction;
|
|
127
|
+
export declare function zohoCrmAddTagsToRecordsRequestBody(input: ZohoCrmAddTagsToRecordsRequest): {
|
|
128
|
+
tags: (ZohoCrmTagData & {
|
|
129
|
+
id?: Maybe<ZohoCrmTagId>;
|
|
130
|
+
})[];
|
|
131
|
+
ids: string[];
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Limit enforced by Zoho Crm
|
|
135
|
+
*/
|
|
136
|
+
export declare const ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED = 100;
|
|
137
|
+
export type ZohoCrmRemoveTagsFromRecordsRequest = ZohoCrmAddTagsToRecordsRequest;
|
|
138
|
+
export type ZohoCrmRemoveTagsFromRecordsResultDetails = ZohoCrmAddTagsToRecordsResultDetails;
|
|
139
|
+
export interface ZohoCrmRemoveTagsFromRecordsSuccessEntry extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
|
|
140
|
+
readonly details: ZohoCrmRemoveTagsFromRecordsResultDetails;
|
|
141
|
+
}
|
|
142
|
+
export type ZohoCrmRemoveTagsFromRecordsResponse = ZohoCrmChangeObjectLikeResponse<ZohoCrmRemoveTagsFromRecordsSuccessEntry>;
|
|
143
|
+
/**
|
|
144
|
+
* Contains all the details of the error.
|
|
145
|
+
*/
|
|
146
|
+
export type ZohoCrmRemoveTagsFromRecordsErrorEntryDetails = ZohoCrmRemoveTagsFromRecordsResultDetails;
|
|
147
|
+
export type ZohoCrmRemoveTagsFromRecordsErrorEntry = ZohoCrmChangeObjectResponseErrorEntry & {
|
|
148
|
+
readonly details: ZohoCrmRemoveTagsFromRecordsErrorEntryDetails;
|
|
149
|
+
};
|
|
150
|
+
export type ZohoCrmRemoveTagsFromRecordsResult = ZohoCrmMultiRecordResult<ZohoCrmRemoveTagsFromRecordsRequest, ZohoCrmRemoveTagsFromRecordsSuccessEntry, ZohoCrmRemoveTagsFromRecordsErrorEntry>;
|
|
151
|
+
export type ZohoCrmRemoveTagsFromRecordsFunction = (input: ZohoCrmRemoveTagsFromRecordsRequest) => Promise<ZohoCrmRemoveTagsFromRecordsResult>;
|
|
152
|
+
/**
|
|
153
|
+
* Removes one or more tags from one or more records.
|
|
154
|
+
*
|
|
155
|
+
* https://www.zoho.com/crm/developer-guide/apiv2/remove-tags.html
|
|
156
|
+
*
|
|
157
|
+
* @param context
|
|
158
|
+
* @returns
|
|
159
|
+
*/
|
|
160
|
+
export declare function zohoCrmRemoveTagsFromRecords(context: ZohoCrmContext): ZohoCrmRemoveTagsFromRecordsFunction;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type FactoryWithRequiredInput } from '@dereekb/util';
|
|
2
|
+
import { type ConfiguredFetch, type FetchJsonFunction } from '@dereekb/util/fetch';
|
|
3
|
+
import { type ZohoApiUrl, type ZohoApiUrlKey, type ZohoConfig, type ZohoApiServiceName } from '../zoho.config';
|
|
4
|
+
import { type ZohoAccessTokenStringFactory, type ZohoServiceAccessTokenKey } from '../accounts';
|
|
5
|
+
import { type ZohoRateLimiterRef } from '../zoho.limit';
|
|
6
|
+
export declare const ZOHO_CRM_SERVICE_NAME: ZohoApiServiceName | ZohoServiceAccessTokenKey;
|
|
7
|
+
export type ZohoCrmApiUrl = ZohoApiUrl;
|
|
8
|
+
export type ZohoCrmApiUrlKey = ZohoApiUrlKey;
|
|
9
|
+
export type ZohoCrmConfigApiUrlInput = ZohoCrmApiUrlKey | ZohoCrmApiUrl;
|
|
10
|
+
export declare function zohoCrmConfigApiUrl(input: ZohoCrmConfigApiUrlInput): ZohoApiUrl;
|
|
11
|
+
export type ZohoCrmConfig = ZohoConfig;
|
|
12
|
+
export interface ZohoCrmFetchFactoryInput {
|
|
13
|
+
readonly apiUrl: ZohoCrmApiUrl;
|
|
14
|
+
}
|
|
15
|
+
export type ZohoCrmFetchFactory = FactoryWithRequiredInput<ConfiguredFetch, ZohoCrmFetchFactoryInput>;
|
|
16
|
+
export interface ZohoCrmContext extends ZohoRateLimiterRef {
|
|
17
|
+
readonly fetch: ConfiguredFetch;
|
|
18
|
+
readonly fetchJson: FetchJsonFunction;
|
|
19
|
+
readonly accessTokenStringFactory: ZohoAccessTokenStringFactory;
|
|
20
|
+
readonly config: ZohoCrmConfig;
|
|
21
|
+
}
|
|
22
|
+
export interface ZohoCrmContextRef {
|
|
23
|
+
readonly crmContext: ZohoCrmContext;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ZohoSearchRecordsCriteriaString, type ZohoSearchRecordsCriteriaTree, type ZohoSearchRecordsCriteriaFilterType, type ZohoSearchRecordsCriteriaEntry, zohoSearchRecordsCriteriaString, zohoSearchRecordsCriteriaStringForTree, zohoSearchRecordsCriteriaEntryToCriteriaString } from '../shared/criteria';
|
|
2
|
+
/**
|
|
3
|
+
* Can search up to 10 criteria at a time.
|
|
4
|
+
*
|
|
5
|
+
* https://www.zoho.com/crm/developer/docs/api/v8/search-records.html
|
|
6
|
+
*
|
|
7
|
+
* "You can search for a maximum of 10 criteria (with the same or different column) with equals and starts_with conditions."
|
|
8
|
+
*/
|
|
9
|
+
export declare const MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA = 10;
|
|
10
|
+
export type ZohoCrmSearchRecordsCriteriaString = ZohoSearchRecordsCriteriaString;
|
|
11
|
+
export declare const zohoCrmSearchRecordsCriteriaString: typeof zohoSearchRecordsCriteriaString;
|
|
12
|
+
export declare const zohoCrmSearchRecordsCriteriaStringForTree: typeof zohoSearchRecordsCriteriaStringForTree;
|
|
13
|
+
export type ZohoCrmSearchRecordsCriteriaTree<T = any> = ZohoSearchRecordsCriteriaTree<T>;
|
|
14
|
+
export type ZohoCrmSearchRecordsCriteriaTreeElement<T = any> = ZohoCrmSearchRecordsCriteriaEntryArray<T> | ZohoCrmSearchRecordsCriteriaTree<T> | ZohoCrmSearchRecordsCriteriaString;
|
|
15
|
+
export type ZohoCrmSearchRecordsCriteriaFilterType = ZohoSearchRecordsCriteriaFilterType;
|
|
16
|
+
export type ZohoCrmSearchRecordsCriteriaEntryArray<T = any> = ZohoCrmSearchRecordsCriteriaEntry<T>[];
|
|
17
|
+
export type ZohoCrmSearchRecordsCriteriaEntry<T = any> = ZohoSearchRecordsCriteriaEntry<T>;
|
|
18
|
+
export declare const escapeZohoCrmFieldValueForCriteriaString: import("@dereekb/util").EscapeStringCharactersFunction;
|
|
19
|
+
export declare const zohoCrmSearchRecordsCriteriaEntryToCriteriaString: typeof zohoSearchRecordsCriteriaEntryToCriteriaString;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { type CommaSeparatedString, type EmailAddress, type ISO8601DateString, type UniqueModelWithId, type WebsiteUrl } from '@dereekb/util';
|
|
2
|
+
/**
|
|
3
|
+
* Zoho CRM module name.
|
|
4
|
+
*
|
|
5
|
+
* Example "Leads"
|
|
6
|
+
*/
|
|
7
|
+
export type ZohoCrmModuleName = string;
|
|
8
|
+
/**
|
|
9
|
+
* Leads module name
|
|
10
|
+
*/
|
|
11
|
+
export declare const ZOHO_CRM_LEADS_MODULE = "Leads";
|
|
12
|
+
/**
|
|
13
|
+
* Contacts module name
|
|
14
|
+
*/
|
|
15
|
+
export declare const ZOHO_CRM_CONTACTS_MODULE = "Contacts";
|
|
16
|
+
/**
|
|
17
|
+
* Tasks module name
|
|
18
|
+
*/
|
|
19
|
+
export declare const ZOHO_CRM_TASKS_MODULE = "Tasks";
|
|
20
|
+
/**
|
|
21
|
+
* Notes module name
|
|
22
|
+
*/
|
|
23
|
+
export declare const ZOHO_CRM_NOTES_MODULE = "Notes";
|
|
24
|
+
/**
|
|
25
|
+
* Emails module name
|
|
26
|
+
*/
|
|
27
|
+
export declare const ZOHO_CRM_EMAILS_MODULE = "Emails";
|
|
28
|
+
/**
|
|
29
|
+
* Attachments module name
|
|
30
|
+
*/
|
|
31
|
+
export declare const ZOHO_CRM_ATTACHMENTS_MODULE = "Attachments";
|
|
32
|
+
/**
|
|
33
|
+
* Contains a reference to a module.
|
|
34
|
+
*/
|
|
35
|
+
export interface ZohoCrmModuleNameRef {
|
|
36
|
+
readonly module: ZohoCrmModuleName;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The API name of a function that is accessible via the Crm REST API
|
|
40
|
+
*/
|
|
41
|
+
export type ZohoCrmRestFunctionApiName = string;
|
|
42
|
+
/**
|
|
43
|
+
* An identifier in Zoho Crm.
|
|
44
|
+
*/
|
|
45
|
+
export type ZohoCrmId = string;
|
|
46
|
+
/**
|
|
47
|
+
* Identifier of a Lead record in Zoho CRM.
|
|
48
|
+
*/
|
|
49
|
+
export type ZohoCrmLeadId = string;
|
|
50
|
+
/**
|
|
51
|
+
* Identifier of an Account record in Zoho CRM.
|
|
52
|
+
*/
|
|
53
|
+
export type ZohoCrmAccountId = string;
|
|
54
|
+
/**
|
|
55
|
+
* Identifier of a Contact record in Zoho CRM.
|
|
56
|
+
*/
|
|
57
|
+
export type ZohoCrmContactId = string;
|
|
58
|
+
/**
|
|
59
|
+
* Identifier of a Deal record in Zoho CRM.
|
|
60
|
+
*/
|
|
61
|
+
export type ZohoCrmDealId = string;
|
|
62
|
+
/**
|
|
63
|
+
* Identifier of a Campaign record in Zoho CRM.
|
|
64
|
+
*/
|
|
65
|
+
export type ZohoCrmCampaignId = string;
|
|
66
|
+
/**
|
|
67
|
+
* Identifier of a Task record in Zoho CRM.
|
|
68
|
+
*/
|
|
69
|
+
export type ZohoCrmTaskId = string;
|
|
70
|
+
/**
|
|
71
|
+
* Identifier of a Case record in Zoho CRM.
|
|
72
|
+
*/
|
|
73
|
+
export type ZohoCrmCaseId = string;
|
|
74
|
+
/**
|
|
75
|
+
* Zoho Crm record id
|
|
76
|
+
*
|
|
77
|
+
* Example "576214000000569001"
|
|
78
|
+
*/
|
|
79
|
+
export type ZohoCrmRecordId = string;
|
|
80
|
+
/**
|
|
81
|
+
* Zoho Crm type id
|
|
82
|
+
*
|
|
83
|
+
* Example "576214000000820595"
|
|
84
|
+
*/
|
|
85
|
+
export type ZohoCrmTypeId = string;
|
|
86
|
+
/**
|
|
87
|
+
* Zoho Crm user identifier.
|
|
88
|
+
*
|
|
89
|
+
* Users can be found in the Users and Controls section in settings.
|
|
90
|
+
*/
|
|
91
|
+
export type ZohoCrmUserId = string;
|
|
92
|
+
/**
|
|
93
|
+
* Zoho Crm custom view id
|
|
94
|
+
*/
|
|
95
|
+
export type ZohoCrmCustomViewId = string;
|
|
96
|
+
/**
|
|
97
|
+
* Zoho Crm territory id
|
|
98
|
+
*/
|
|
99
|
+
export type ZohoCrmTerritoryId = string;
|
|
100
|
+
/**
|
|
101
|
+
* The name of a field on a record.
|
|
102
|
+
*/
|
|
103
|
+
export type ZohoCrmFieldName = string;
|
|
104
|
+
/**
|
|
105
|
+
* Comma separated list of field names
|
|
106
|
+
*/
|
|
107
|
+
export type ZohoCrmCommaSeparateFieldNames = CommaSeparatedString;
|
|
108
|
+
export type ZohoCrmDraftOrSaveState = 'draft' | 'save';
|
|
109
|
+
export type ZohoCrmTrueFalseBoth = 'true' | 'false' | 'both';
|
|
110
|
+
export interface ZohoCrmReferenceData {
|
|
111
|
+
name: string;
|
|
112
|
+
id: ZohoCrmId;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Reference pair of a Zoho Crm user name and id
|
|
116
|
+
*/
|
|
117
|
+
export interface ZohoCrmUserReferenceData {
|
|
118
|
+
name: string;
|
|
119
|
+
id: ZohoCrmUserId;
|
|
120
|
+
}
|
|
121
|
+
export interface ZohoCrmReferenceDataWithModule extends ZohoCrmReferenceData, ZohoCrmModuleNameRef {
|
|
122
|
+
}
|
|
123
|
+
export type ZohoCrmCreatedByData = ZohoCrmUserReferenceData;
|
|
124
|
+
export type ZohoCrmRecordOwner = ZohoCrmUserReferenceData;
|
|
125
|
+
export interface ZohoCrmModifiedByData extends ZohoCrmReferenceData {
|
|
126
|
+
zuid: ZohoCrmId;
|
|
127
|
+
}
|
|
128
|
+
export type ZohoCrmParentReferenceData = ZohoCrmReferenceDataWithModule;
|
|
129
|
+
/**
|
|
130
|
+
* Zoho Crm only allows URLs that can be resolved via the internet (I.E. uses a normal tdl)
|
|
131
|
+
*
|
|
132
|
+
* The following are considered invalid:
|
|
133
|
+
* - localhost:8080
|
|
134
|
+
* - ht://dereekb.com
|
|
135
|
+
*/
|
|
136
|
+
export type ZohoCrmValidUrl = WebsiteUrl;
|
|
137
|
+
/**
|
|
138
|
+
* Update details returned by the server for a created/updated object.
|
|
139
|
+
*/
|
|
140
|
+
export interface ZohoCrmChangeObjectDetails {
|
|
141
|
+
id: ZohoCrmRecordId;
|
|
142
|
+
Modified_Time: ISO8601DateString;
|
|
143
|
+
Modified_By: ZohoCrmCreatedByData;
|
|
144
|
+
Created_Time: ISO8601DateString;
|
|
145
|
+
Created_By: ZohoCrmCreatedByData;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Base Zoho Crm field data type.
|
|
149
|
+
*/
|
|
150
|
+
export interface ZohoCrmRecordFieldsData {
|
|
151
|
+
}
|
|
152
|
+
export interface ZohoCrmRecordDraftStateData {
|
|
153
|
+
/**
|
|
154
|
+
* Used to update a draft record or to convert a draft to a normal record.
|
|
155
|
+
*
|
|
156
|
+
* When creating, passing "draft" will create the record as a draft.
|
|
157
|
+
*/
|
|
158
|
+
$state?: ZohoCrmDraftOrSaveState;
|
|
159
|
+
}
|
|
160
|
+
export type NewZohoCrmRecordData<T = ZohoCrmRecordFieldsData> = T & ZohoCrmRecordDraftStateData;
|
|
161
|
+
/**
|
|
162
|
+
* A ZohoCrm record containing the corresponding record's id.
|
|
163
|
+
*/
|
|
164
|
+
export type UpdateZohoCrmRecordData = UniqueModelWithId & ZohoCrmRecordFieldsData & ZohoCrmRecordDraftStateData;
|
|
165
|
+
/**
|
|
166
|
+
* A ZohoCrm record containing record details.
|
|
167
|
+
*/
|
|
168
|
+
export type ZohoCrmRecord = UniqueModelWithId & ZohoCrmRecordFieldsData;
|
|
169
|
+
/**
|
|
170
|
+
* Returns true if it is a valid ZohoCrmValidUrl.
|
|
171
|
+
*/
|
|
172
|
+
export declare const isZohoCrmValidUrl: (input: WebsiteUrl) => input is ZohoCrmValidUrl;
|
|
173
|
+
/**
|
|
174
|
+
* The status of a record.
|
|
175
|
+
*/
|
|
176
|
+
export type ZohoCrmRecordStatus = string;
|
|
177
|
+
/**
|
|
178
|
+
* Metadata for a record's email.
|
|
179
|
+
*/
|
|
180
|
+
export interface ZohoCrmRecordEmailMetadata {
|
|
181
|
+
/**
|
|
182
|
+
* Whether or not an attachment is present.
|
|
183
|
+
*/
|
|
184
|
+
attachment: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* The subject of the email.
|
|
187
|
+
*/
|
|
188
|
+
subject: string;
|
|
189
|
+
/**
|
|
190
|
+
* The email address the email was sent to.
|
|
191
|
+
*/
|
|
192
|
+
to: EmailAddress;
|
|
193
|
+
/**
|
|
194
|
+
* The email address the email was sent from.
|
|
195
|
+
*/
|
|
196
|
+
from: EmailAddress;
|
|
197
|
+
/**
|
|
198
|
+
* The date the email was sent.
|
|
199
|
+
*/
|
|
200
|
+
sent_on: ISO8601DateString;
|
|
201
|
+
/**
|
|
202
|
+
* The status of the email.
|
|
203
|
+
*/
|
|
204
|
+
status: ZohoCrmRecordEmailMetadataStatus[];
|
|
205
|
+
}
|
|
206
|
+
export type ZohoCrmRecordEmailMetadataStatusType = 'sent' | string;
|
|
207
|
+
export interface ZohoCrmRecordEmailMetadataStatus {
|
|
208
|
+
type: ZohoCrmRecordEmailMetadataStatusType;
|
|
209
|
+
}
|
|
210
|
+
export declare const ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME = "Resume";
|
|
211
|
+
export interface ZohoCrmRecordAttachmentMetadataAttachType extends ZohoCrmReferenceData {
|
|
212
|
+
name: typeof ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME | string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Record id for an attachment.
|
|
216
|
+
*/
|
|
217
|
+
export type ZohoCrmAttachmentRecordId = ZohoCrmRecordId;
|
|
218
|
+
/**
|
|
219
|
+
* The size of the attachment in bytes, stored as a string.
|
|
220
|
+
*/
|
|
221
|
+
export type ZohoCrmRecordAttachmentMetadataSize = string;
|
|
222
|
+
/**
|
|
223
|
+
* Attachment category id
|
|
224
|
+
*/
|
|
225
|
+
export type ZohoCrmAttachmentCategoryId = string;
|
|
226
|
+
/**
|
|
227
|
+
* Known attachment category names
|
|
228
|
+
*/
|
|
229
|
+
export type KnownZohoCrmAttachmentCategoryName = 'Resume' | 'Offer' | 'Contracts' | 'Criminal records' | 'Mandatory reporter' | 'Teaching certification' | 'Health records' | 'Others' | 'Cover Letter' | 'Formatted Resume';
|
|
230
|
+
/**
|
|
231
|
+
* Attachment category name
|
|
232
|
+
*
|
|
233
|
+
* I.E. "Resume"
|
|
234
|
+
*/
|
|
235
|
+
export type ZohoCrmAttachmentCategoryName = KnownZohoCrmAttachmentCategoryName | string;
|
|
236
|
+
/**
|
|
237
|
+
* The type of attachment.
|
|
238
|
+
*
|
|
239
|
+
* "Attachment" - Download the attachment to retrieve the value.
|
|
240
|
+
* "Link URL" - Use the Attachment_URL property to retrieve the value.
|
|
241
|
+
*/
|
|
242
|
+
export type ZohoCrmAttachmentType = 'Attachment' | 'Link URL';
|
|
243
|
+
/**
|
|
244
|
+
* Metadata for a record's attachment.
|
|
245
|
+
*/
|
|
246
|
+
export interface ZohoCrmRecordAttachmentMetadata {
|
|
247
|
+
/**
|
|
248
|
+
* The type of attachment
|
|
249
|
+
*/
|
|
250
|
+
$attach_type: ZohoCrmRecordAttachmentMetadataAttachType;
|
|
251
|
+
/**
|
|
252
|
+
* Last time the attachment was modified
|
|
253
|
+
*/
|
|
254
|
+
Modified_Time: ISO8601DateString;
|
|
255
|
+
/**
|
|
256
|
+
* The category of the attachment
|
|
257
|
+
*/
|
|
258
|
+
Category: ZohoCrmRecordAttachmentMetadataAttachType;
|
|
259
|
+
/**
|
|
260
|
+
* The name of the attachment
|
|
261
|
+
*/
|
|
262
|
+
File_Name: string;
|
|
263
|
+
/**
|
|
264
|
+
* The size of the attachment in bytes, stored as a string.
|
|
265
|
+
*/
|
|
266
|
+
Size: ZohoCrmRecordAttachmentMetadataSize;
|
|
267
|
+
/**
|
|
268
|
+
* The time the attachment was created
|
|
269
|
+
*/
|
|
270
|
+
Created_Time: ISO8601DateString;
|
|
271
|
+
/**
|
|
272
|
+
* The parent record id for this attachment
|
|
273
|
+
*/
|
|
274
|
+
Parent_Id: ZohoCrmRecordId;
|
|
275
|
+
/**
|
|
276
|
+
* Owner of the attachment
|
|
277
|
+
*/
|
|
278
|
+
Attachment_Owner: ZohoCrmUserReferenceData;
|
|
279
|
+
/**
|
|
280
|
+
* Internal file identifier for the attachment
|
|
281
|
+
*/
|
|
282
|
+
$file_id: string;
|
|
283
|
+
/**
|
|
284
|
+
* Type of attachment, and how to retrieve the value.
|
|
285
|
+
*/
|
|
286
|
+
$type: ZohoCrmAttachmentType;
|
|
287
|
+
/**
|
|
288
|
+
* Direct URL to the attachment, when available
|
|
289
|
+
*/
|
|
290
|
+
Attachment_URL: string | null;
|
|
291
|
+
/**
|
|
292
|
+
* User who last modified this attachment
|
|
293
|
+
*/
|
|
294
|
+
Modified_By: ZohoCrmUserReferenceData;
|
|
295
|
+
/**
|
|
296
|
+
* Attachment record id
|
|
297
|
+
*/
|
|
298
|
+
id: ZohoCrmAttachmentRecordId;
|
|
299
|
+
/**
|
|
300
|
+
* User who created this attachment
|
|
301
|
+
*/
|
|
302
|
+
Created_By: ZohoCrmUserReferenceData;
|
|
303
|
+
/**
|
|
304
|
+
* Whether the attachment is editable
|
|
305
|
+
*/
|
|
306
|
+
$editable: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Module this attachment belongs to (e.g., Leads)
|
|
309
|
+
*/
|
|
310
|
+
$se_module: ZohoCrmModuleName;
|
|
311
|
+
/**
|
|
312
|
+
* Link URL when the attachment is a link
|
|
313
|
+
*/
|
|
314
|
+
$link_url?: string | null;
|
|
315
|
+
/**
|
|
316
|
+
* Number of linked documents
|
|
317
|
+
*/
|
|
318
|
+
$link_docs: number;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Update details returned by the server for an updated record.
|
|
322
|
+
*
|
|
323
|
+
* @deprecated use ZohoCrmChangeObjectDetails instead.
|
|
324
|
+
*/
|
|
325
|
+
export type ZohoCrmRecordUpdateDetails = ZohoCrmChangeObjectDetails;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type FetchResponseError } from '@dereekb/util/fetch';
|
|
2
|
+
import { BaseError } from 'make-error';
|
|
3
|
+
import { type ZohoServerErrorDataWithDetails, type ZohoServerErrorResponseData, ZohoServerError, type ParsedZohoServerError, type ZohoServerErrorResponseDataArrayRef } from '../zoho.error.api';
|
|
4
|
+
import { type ZohoCrmModuleName, type ZohoCrmRecordId } from './crm';
|
|
5
|
+
import { type ZohoDataArrayResultRef } from '../zoho.api.page';
|
|
6
|
+
/**
|
|
7
|
+
* Error code for when two records are already associated with each other.
|
|
8
|
+
*
|
|
9
|
+
* Example being a candidate and a job opening are already associated.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE = "ALREADY_ASSOCIATED";
|
|
12
|
+
/**
|
|
13
|
+
* Thrown when a record with the given id has no content. Typically also means it does not exist.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ZohoCrmRecordNoContentError extends BaseError {
|
|
16
|
+
readonly moduleName?: ZohoCrmModuleName | undefined;
|
|
17
|
+
readonly recordId?: ZohoCrmRecordId | undefined;
|
|
18
|
+
constructor(moduleName?: ZohoCrmModuleName | undefined, recordId?: ZohoCrmRecordId | undefined);
|
|
19
|
+
}
|
|
20
|
+
export declare class ZohoCrmRecordCrudError extends ZohoServerError<ZohoServerErrorDataWithDetails> {
|
|
21
|
+
}
|
|
22
|
+
export declare class ZohoCrmRecordCrudMandatoryFieldNotFoundError extends ZohoCrmRecordCrudError {
|
|
23
|
+
}
|
|
24
|
+
export declare class ZohoCrmRecordCrudDuplicateDataError extends ZohoCrmRecordCrudError {
|
|
25
|
+
}
|
|
26
|
+
export type ZohoCrmRecordCrudInvalidDataErrorDetails = Record<string, string>;
|
|
27
|
+
export interface ZohoCrmRecordCrudInvalidFieldDetails {
|
|
28
|
+
/**
|
|
29
|
+
* The api name for this field
|
|
30
|
+
*
|
|
31
|
+
* Example: 'id'
|
|
32
|
+
*/
|
|
33
|
+
readonly api_name: string;
|
|
34
|
+
/**
|
|
35
|
+
* The json path for this field from the root data.
|
|
36
|
+
*
|
|
37
|
+
* Example: `$.data[0].id`
|
|
38
|
+
*/
|
|
39
|
+
readonly json_path: string;
|
|
40
|
+
}
|
|
41
|
+
export declare class ZohoCrmRecordCrudInvalidDataError extends ZohoCrmRecordCrudError {
|
|
42
|
+
get invalidFieldDetails(): ZohoCrmRecordCrudInvalidFieldDetails;
|
|
43
|
+
}
|
|
44
|
+
export declare class ZohoCrmRecordCrudNoMatchingRecordError extends ZohoCrmRecordCrudInvalidDataError {
|
|
45
|
+
}
|
|
46
|
+
export declare function zohoCrmRecordCrudError(error: ZohoServerErrorDataWithDetails): ZohoCrmRecordCrudError;
|
|
47
|
+
export declare function assertZohoCrmRecordDataArrayResultHasContent<T>(moduleName?: ZohoCrmModuleName, recordId?: ZohoCrmRecordId): <R extends ZohoDataArrayResultRef<T>>(x: R) => R;
|
|
48
|
+
export declare const logZohoCrmErrorToConsole: import("..").LogZohoServerErrorFunction;
|
|
49
|
+
export declare function parseZohoCrmError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
50
|
+
export declare function parseZohoCrmServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData | ZohoServerErrorResponseDataArrayRef, responseError: FetchResponseError): ParsedZohoServerError;
|
|
51
|
+
export declare const interceptZohoCrm200StatusWithErrorResponse: import("@dereekb/util/fetch").FetchJsonInterceptJsonResponseFunction;
|
|
52
|
+
export declare const handleZohoCrmErrorFetch: import("..").HandleZohoErrorFetchFactory;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ZohoCrmConfig, type ZohoCrmContextRef, type ZohoCrmFetchFactory } from './crm.config';
|
|
2
|
+
import { type LogZohoServerErrorFunction } from '../zoho.error.api';
|
|
3
|
+
import { type ZohoAccountsContextRef } from '../accounts/accounts.config';
|
|
4
|
+
import { type ZohoRateLimitedFetchHandlerConfig } from '../zoho.limit';
|
|
5
|
+
import { type Maybe } from '@dereekb/util';
|
|
6
|
+
export type ZohoCrm = ZohoCrmContextRef;
|
|
7
|
+
export interface ZohoCrmFactoryConfig extends ZohoAccountsContextRef {
|
|
8
|
+
/**
|
|
9
|
+
* Custom ZohoRateLimitedFetchHandlerConfig
|
|
10
|
+
*/
|
|
11
|
+
rateLimiterConfig?: Maybe<ZohoRateLimitedFetchHandlerConfig>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new fetch instance to use when making calls.
|
|
14
|
+
*/
|
|
15
|
+
fetchFactory?: ZohoCrmFetchFactory;
|
|
16
|
+
/**
|
|
17
|
+
* Custom log error function.
|
|
18
|
+
*/
|
|
19
|
+
logZohoServerErrorFunction?: LogZohoServerErrorFunction;
|
|
20
|
+
}
|
|
21
|
+
export type ZohoCrmFactory = (config: ZohoCrmConfig) => ZohoCrm;
|
|
22
|
+
export declare function zohoCrmFactory(factoryConfig: ZohoCrmFactoryConfig): ZohoCrmFactory;
|