@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.
Files changed (66) hide show
  1. package/LICENSE +1 -1
  2. package/index.cjs.js +1763 -2531
  3. package/index.esm.js +1655 -2524
  4. package/nestjs/index.cjs.js +598 -0
  5. package/nestjs/index.esm.js +582 -0
  6. package/nestjs/package.json +19 -3
  7. package/nestjs/src/lib/accounts/accounts.config.d.ts +32 -0
  8. package/nestjs/src/lib/crm/crm.api.d.ts +43 -0
  9. package/nestjs/src/lib/crm/crm.config.d.ts +10 -0
  10. package/nestjs/src/lib/crm/crm.module.d.ts +24 -0
  11. package/nestjs/src/lib/crm/index.d.ts +3 -0
  12. package/nestjs/src/lib/recruit/recruit.api.d.ts +7 -7
  13. package/package.json +14 -7
  14. package/src/lib/accounts/accounts.api.d.ts +1 -1
  15. package/src/lib/accounts/accounts.error.api.d.ts +2 -2
  16. package/src/lib/crm/crm.api.d.ts +430 -0
  17. package/src/lib/crm/crm.api.notes.d.ts +40 -0
  18. package/src/lib/crm/crm.api.tags.d.ts +160 -0
  19. package/src/lib/crm/crm.config.d.ts +24 -0
  20. package/src/lib/crm/crm.criteria.d.ts +19 -0
  21. package/src/lib/crm/crm.d.ts +325 -0
  22. package/src/lib/crm/crm.error.api.d.ts +52 -0
  23. package/src/lib/crm/crm.factory.d.ts +22 -0
  24. package/src/lib/crm/crm.notes.d.ts +48 -0
  25. package/src/lib/crm/crm.tags.d.ts +40 -0
  26. package/src/lib/crm/index.d.ts +10 -0
  27. package/src/lib/index.d.ts +1 -0
  28. package/src/lib/recruit/index.d.ts +0 -1
  29. package/src/lib/recruit/recruit.api.candidates.d.ts +6 -6
  30. package/src/lib/recruit/recruit.api.d.ts +102 -22
  31. package/src/lib/recruit/recruit.api.notes.d.ts +30 -6
  32. package/src/lib/recruit/recruit.api.tags.d.ts +30 -6
  33. package/src/lib/recruit/recruit.criteria.d.ts +8 -44
  34. package/src/lib/recruit/recruit.d.ts +7 -3
  35. package/src/lib/recruit/recruit.error.api.d.ts +7 -3
  36. package/src/lib/shared/criteria.d.ts +55 -0
  37. package/src/lib/shared/criteria.util.d.ts +10 -0
  38. package/src/lib/zoho.error.api.d.ts +64 -6
  39. package/src/lib/zoho.type.d.ts +1 -18
  40. package/nestjs/CHANGELOG.md +0 -459
  41. package/nestjs/README.md +0 -11
  42. package/nestjs/src/index.js +0 -5
  43. package/nestjs/src/index.js.map +0 -1
  44. package/nestjs/src/lib/accounts/accounts.api.js +0 -37
  45. package/nestjs/src/lib/accounts/accounts.api.js.map +0 -1
  46. package/nestjs/src/lib/accounts/accounts.config.js +0 -50
  47. package/nestjs/src/lib/accounts/accounts.config.js.map +0 -1
  48. package/nestjs/src/lib/accounts/accounts.service.js +0 -240
  49. package/nestjs/src/lib/accounts/accounts.service.js.map +0 -1
  50. package/nestjs/src/lib/accounts/index.js +0 -7
  51. package/nestjs/src/lib/accounts/index.js.map +0 -1
  52. package/nestjs/src/lib/index.js +0 -7
  53. package/nestjs/src/lib/index.js.map +0 -1
  54. package/nestjs/src/lib/recruit/index.js +0 -7
  55. package/nestjs/src/lib/recruit/index.js.map +0 -1
  56. package/nestjs/src/lib/recruit/recruit.api.js +0 -130
  57. package/nestjs/src/lib/recruit/recruit.api.js.map +0 -1
  58. package/nestjs/src/lib/recruit/recruit.config.js +0 -16
  59. package/nestjs/src/lib/recruit/recruit.config.js.map +0 -1
  60. package/nestjs/src/lib/recruit/recruit.module.js +0 -61
  61. package/nestjs/src/lib/recruit/recruit.module.js.map +0 -1
  62. package/nestjs/src/lib/zoho.config.js +0 -52
  63. package/nestjs/src/lib/zoho.config.js.map +0 -1
  64. package/src/lib/recruit/recruit.criteria.util.d.ts +0 -10
  65. /package/{index.cjs.d.ts → index.d.ts} +0 -0
  66. /package/{index.esm.d.ts → nestjs/index.d.ts} +0 -0
@@ -0,0 +1,43 @@
1
+ import { ZohoCrm, ZohoCrmContext } from '@dereekb/zoho';
2
+ import { ZohoCrmServiceConfig } from './crm.config';
3
+ import { ZohoAccountsApi } from '../accounts/accounts.api';
4
+ export declare class ZohoCrmApi {
5
+ readonly config: ZohoCrmServiceConfig;
6
+ readonly zohoAccountsApi: ZohoAccountsApi;
7
+ readonly zohoCrm: ZohoCrm;
8
+ get crmContext(): ZohoCrmContext;
9
+ get zohoRateLimiter(): import("@dereekb/util").ResetPeriodPromiseRateLimiter;
10
+ constructor(config: ZohoCrmServiceConfig, zohoAccountsApi: ZohoAccountsApi);
11
+ get insertRecord(): import("@dereekb/zoho").ZohoCrmCreateRecordLikeFunction;
12
+ get upsertRecord(): import("@dereekb/zoho").ZohoCrmUpsertRecordLikeFunction;
13
+ get updateRecord(): import("@dereekb/zoho").ZohoCrmUpdateRecordLikeFunction;
14
+ get deleteRecord(): import("@dereekb/zoho").ZohoCrmDeleteRecordFunction;
15
+ get getRecordById(): import("@dereekb/zoho").ZohoCrmGetRecordByIdFunction;
16
+ get getRecords(): import("@dereekb/zoho").ZohoCrmGetRecordsFunction;
17
+ get searchRecords(): import("@dereekb/zoho").ZohoCrmSearchRecordsFunction;
18
+ get searchRecordsPageFactory(): import("@dereekb/zoho").ZohoCrmSearchRecordsPageFactory;
19
+ get getRelatedRecordsFunctionFactory(): import("@dereekb/zoho").ZohoCrmGetRelatedRecordsFunctionFactory;
20
+ get getEmailsForRecord(): import("@dereekb/zoho").ZohoCrmGetEmailsForRecordFunction;
21
+ get getEmailsForRecordPageFactory(): import("@dereekb/zoho").ZohoCrmGetEmailsForRecordPageFactory;
22
+ get getAttachmentsForRecord(): import("@dereekb/zoho").ZohoCrmGetAttachmentsForRecordFunction;
23
+ get getAttachmentsForRecordPageFactory(): import("@dereekb/zoho").ZohoCrmGetAttachmentsForRecordPageFactory;
24
+ get uploadAttachmentForRecord(): import("@dereekb/zoho").ZohoCrmUploadAttachmentForRecordFunction;
25
+ get downloadAttachmentForRecord(): import("@dereekb/zoho").ZohoCrmDownloadAttachmentForRecordFunction;
26
+ get deleteAttachmentFromRecord(): import("@dereekb/zoho").ZohoCrmDeleteAttachmentFromRecordFunction;
27
+ get createNotes(): (input: import("@dereekb/zoho").ZohoCrmCreateNotesRequest) => Promise<import("@dereekb/zoho").ZohoCrmMultiRecordResult<import("@dereekb/zoho").NewZohoCrmNoteData, import("@dereekb/zoho").ZohoCrmChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoCrmChangeObjectDetails>, import("@dereekb/zoho").ZohoCrmChangeObjectResponseErrorEntry>>;
28
+ get deleteNotes(): (input: import("@dereekb/zoho").ZohoCrmDeleteNotesRequest) => Promise<import("@dereekb/zoho").ZohoCrmMultiRecordResult<string, import("@dereekb/zoho").ZohoCrmChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoCrmChangeObjectDetails>, import("@dereekb/zoho").ZohoCrmChangeObjectResponseErrorEntry>>;
29
+ get createNotesForRecord(): import("@dereekb/zoho").ZohoCrmCreateNotesForRecordFunction;
30
+ get getNotesForRecord(): import("@dereekb/zoho").ZohoCrmGetNotesForRecordFunction;
31
+ get getNotesForRecordPageFactory(): import("@dereekb/zoho").ZohoCrmGetNotesForRecordPageFactory;
32
+ get executeRestApiFunction(): import("@dereekb/zoho").ZohoCrmExecuteRestApiFunctionFunction;
33
+ get createTagsForModule(): (input: import("@dereekb/zoho").ZohoCrmCreateTagsRequest) => Promise<{
34
+ errorItems: import("@dereekb/zoho").ZohoCrmMultiRecordResultEntry<import("@dereekb/zoho").ZohoCrmCreateTagData, import("@dereekb/zoho").ZohoCrmChangeObjectResponseErrorEntry>[];
35
+ duplicateErrorItems: import("@dereekb/zoho").ZohoCrmMultiRecordResultEntry<import("@dereekb/zoho").ZohoCrmCreateTagData, import("@dereekb/zoho").ZohoCrmChangeObjectResponseErrorEntry>[];
36
+ allErrorItems: import("@dereekb/zoho").ZohoCrmMultiRecordResultEntry<import("@dereekb/zoho").ZohoCrmCreateTagData, import("@dereekb/zoho").ZohoCrmChangeObjectResponseErrorEntry>[];
37
+ successItems: import("@dereekb/zoho").ZohoCrmMultiRecordResultEntry<import("@dereekb/zoho").ZohoCrmCreateTagData, import("@dereekb/zoho").ZohoCrmChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoCrmChangeObjectDetails>>[];
38
+ }>;
39
+ get deleteTag(): import("@dereekb/zoho").ZohoCrmDeleteTagFunction;
40
+ get getTagsForModule(): import("@dereekb/zoho").ZohoCrmGetTagsFunction;
41
+ get addTagsToRecords(): import("@dereekb/zoho").ZohoCrmAddTagsToRecordsFunction;
42
+ get removeTagsFromRecords(): import("@dereekb/zoho").ZohoCrmRemoveTagsFromRecordsFunction;
43
+ }
@@ -0,0 +1,10 @@
1
+ import { type ZohoCrmConfig, type ZohoCrmFactoryConfig } from '@dereekb/zoho';
2
+ export type ZohoCrmServiceApiConfig = ZohoCrmConfig & {};
3
+ /**
4
+ * Configuration for ZohoCrmService
5
+ */
6
+ export declare abstract class ZohoCrmServiceConfig {
7
+ readonly zohoCrm: ZohoCrmServiceApiConfig;
8
+ readonly factoryConfig?: ZohoCrmFactoryConfig;
9
+ static assertValidConfig(config: ZohoCrmServiceConfig): void;
10
+ }
@@ -0,0 +1,24 @@
1
+ import { type ModuleMetadata } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
3
+ import { ZohoCrmServiceConfig } from './crm.config';
4
+ import { ZohoAccountsServiceConfig } from '../accounts/accounts.config';
5
+ import { type Maybe } from '@dereekb/util';
6
+ export declare function zohoCrmServiceConfigFactory(configService: ConfigService): ZohoCrmServiceConfig;
7
+ export declare function zohoCrmAccountServiceConfigFactory(configService: ConfigService): ZohoAccountsServiceConfig;
8
+ export interface ProvideAppZohoCrmMetadataConfig extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> {
9
+ /**
10
+ * The ZohoCrmModule requires the following dependencies in order to initialze properly:
11
+ * - ZohoAccountsAccessTokenCacheService
12
+ *
13
+ * This module declaration makes it easier to import a module that exports those depenendencies.
14
+ */
15
+ readonly dependencyModule?: Maybe<Required<ModuleMetadata>['imports']['0']>;
16
+ }
17
+ /**
18
+ * Convenience function used to generate ModuleMetadata for an app's ZohoCrmModule.
19
+ *
20
+ * @param provide
21
+ * @param useFactory
22
+ * @returns
23
+ */
24
+ export declare function appZohoCrmModuleMetadata(config: ProvideAppZohoCrmMetadataConfig): ModuleMetadata;
@@ -0,0 +1,3 @@
1
+ export * from './crm.api';
2
+ export * from './crm.config';
3
+ export * from './crm.module';
@@ -6,7 +6,7 @@ export declare class ZohoRecruitApi {
6
6
  readonly zohoAccountsApi: ZohoAccountsApi;
7
7
  readonly zohoRecruit: ZohoRecruit;
8
8
  get recruitContext(): ZohoRecruitContext;
9
- get zohoRateLimiter(): import("dist/packages/util/src").ResetPeriodPromiseRateLimiter;
9
+ get zohoRateLimiter(): import("@dereekb/util").ResetPeriodPromiseRateLimiter;
10
10
  constructor(config: ZohoRecruitServiceConfig, zohoAccountsApi: ZohoAccountsApi);
11
11
  get insertRecord(): import("@dereekb/zoho").ZohoRecruitCreateRecordLikeFunction;
12
12
  get upsertRecord(): import("@dereekb/zoho").ZohoRecruitUpsertRecordLikeFunction;
@@ -15,12 +15,12 @@ export declare class ZohoRecruitApi {
15
15
  get getRecordById(): import("@dereekb/zoho").ZohoRecruitGetRecordByIdFunction;
16
16
  get getRecords(): import("@dereekb/zoho").ZohoRecruitGetRecordsFunction;
17
17
  get searchRecords(): import("@dereekb/zoho").ZohoRecruitSearchRecordsFunction;
18
- get searchRecordsPageFactory(): import("@dereekb/zoho").SearchRecordsPageFactory;
18
+ get searchRecordsPageFactory(): import("@dereekb/zoho").ZohoRecruitSearchRecordsPageFactory;
19
19
  get getRelatedRecordsFunctionFactory(): import("@dereekb/zoho").ZohoRecruitGetRelatedRecordsFunctionFactory;
20
20
  get getEmailsForRecord(): import("@dereekb/zoho").ZohoRecruitGetEmailsForRecordFunction;
21
- get getEmailsForRecordPageFactory(): import("@dereekb/zoho").GetEmailsForRecordPageFactory;
21
+ get getEmailsForRecordPageFactory(): import("@dereekb/zoho").ZohoRecruitGetEmailsForRecordPageFactory;
22
22
  get getAttachmentsForRecord(): import("@dereekb/zoho").ZohoRecruitGetAttachmentsForRecordFunction;
23
- get getAttachmentsForRecordPageFactory(): import("@dereekb/zoho").GetAttachmentsForRecordPageFactory;
23
+ get getAttachmentsForRecordPageFactory(): import("@dereekb/zoho").ZohoRecruitGetAttachmentsForRecordPageFactory;
24
24
  get uploadAttachmentForRecord(): import("@dereekb/zoho").ZohoRecruitUploadAttachmentForRecordFunction;
25
25
  get downloadAttachmentForRecord(): import("@dereekb/zoho").ZohoRecruitDownloadAttachmentForRecordFunction;
26
26
  get deleteAttachmentFromRecord(): import("@dereekb/zoho").ZohoRecruitDeleteAttachmentFromRecordFunction;
@@ -28,13 +28,13 @@ export declare class ZohoRecruitApi {
28
28
  get deleteNotes(): (input: import("@dereekb/zoho").ZohoRecruitDeleteNotesRequest) => Promise<import("@dereekb/zoho").ZohoRecruitMultiRecordResult<string, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseSuccessEntry<import("@dereekb/zoho").ZohoRecruitChangeObjectDetails>, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseErrorEntry>>;
29
29
  get createNotesForRecord(): import("@dereekb/zoho").ZohoRecruitCreateNotesForRecordFunction;
30
30
  get getNotesForRecord(): import("@dereekb/zoho").ZohoRecruitGetNotesForRecordFunction;
31
- get getNotesForRecordPageFactory(): import("@dereekb/zoho").GetNotesForRecordPageFactory;
31
+ get getNotesForRecordPageFactory(): import("@dereekb/zoho").ZohoRecruitGetNotesForRecordPageFactory;
32
32
  get executeRestApiFunction(): import("@dereekb/zoho").ZohoRecruitExecuteRestApiFunctionFunction;
33
33
  get associateCandidateRecordsWithJobOpenings(): import("@dereekb/zoho").ZohoRecruitAssociateCandidateRecordsWithJobOpeningsFunction;
34
34
  get searchCandidateAssociatedJobOpeningRecords(): import("@dereekb/zoho").ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsFunction<import("@dereekb/zoho").ZohoRecruitRecord>;
35
- get searchCandidateAssociatedJobOpeningRecordsPageFactory(): import("dist/packages/util/fetch/src").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
35
+ get searchCandidateAssociatedJobOpeningRecordsPageFactory(): import("@dereekb/util/fetch").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchCandidateAssociatedJobOpeningRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
36
36
  get searchJobOpeningAssociatedCandidateRecords(): import("@dereekb/zoho").ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsFunction<import("@dereekb/zoho").ZohoRecruitRecord>;
37
- get searchJobOpeningAssociatedCandidateRecordsPageFactory(): import("dist/packages/util/fetch/src").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
37
+ get searchJobOpeningAssociatedCandidateRecordsPageFactory(): import("@dereekb/util/fetch").FetchPageFactory<import("@dereekb/zoho").ZohoRecruitSearchJobOpeningAssociatedCandidateRecordsInput, import("@dereekb/zoho").ZohoRecruitSearchAssociatedRecordsResponse<import("@dereekb/zoho").ZohoRecruitRecord>>;
38
38
  get createTagsForModule(): (input: import("@dereekb/zoho").ZohoRecruitCreateTagsRequest) => Promise<{
39
39
  errorItems: import("@dereekb/zoho").ZohoRecruitMultiRecordResultEntry<import("@dereekb/zoho").ZohoRecruitCreateTagData, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseErrorEntry>[];
40
40
  duplicateErrorItems: import("@dereekb/zoho").ZohoRecruitMultiRecordResultEntry<import("@dereekb/zoho").ZohoRecruitCreateTagData, import("@dereekb/zoho").ZohoRecruitChangeObjectResponseErrorEntry>[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/zoho",
3
- "version": "12.6.21",
3
+ "version": "13.0.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -15,16 +15,23 @@
15
15
  },
16
16
  "./nestjs": {
17
17
  "types": "./nestjs/src/index.d.ts",
18
- "main": "./nestjs/src/index.js",
19
- "require": "./nestjs/src/index.js",
20
- "default": "./nestjs/src/index.js"
18
+ "module": "./nestjs/index.esm.js",
19
+ "main": "./nestjs/index.cjs.js",
20
+ "node": {
21
+ "require": "./nestjs/index.cjs.js"
22
+ },
23
+ "browser": {
24
+ "require": "./nestjs/index.cjs.js",
25
+ "import": "./nestjs/index.esm.js"
26
+ }
21
27
  }
22
28
  },
23
29
  "peerDependencies": {
24
- "@dereekb/util": "*",
25
- "make-error": "^1.3.0"
30
+ "@dereekb/util": "13.0.0",
31
+ "make-error": "^1.3.0",
32
+ "core-js": "^3.0.0"
26
33
  },
27
34
  "module": "./index.esm.js",
28
35
  "main": "./index.cjs.js",
29
- "types": "./index.esm.d.ts"
36
+ "types": "./index.d.ts"
30
37
  }
@@ -23,5 +23,5 @@ export interface ZohoAccountsAccessTokenErrorResponse {
23
23
  * @param context
24
24
  * @returns
25
25
  */
26
- export declare function accessToken(context: ZohoAccountsContext): (input?: ZohoAccountsAccessTokenInput) => Promise<ZohoAccountsAccessTokenResponse>;
26
+ export declare function zohoAccountsAccessToken(context: ZohoAccountsContext): (input?: ZohoAccountsAccessTokenInput) => Promise<ZohoAccountsAccessTokenResponse>;
27
27
  export declare function zohoAccountsApiFetchJsonInput(method: string, body?: FetchJsonBody): FetchJsonInput;
@@ -21,8 +21,8 @@ export declare class ZohoAccountsAuthFailureError extends FetchRequestFactoryErr
21
21
  readonly reason?: string | undefined;
22
22
  constructor(reason?: string | undefined);
23
23
  }
24
- export declare const logZohoAccountsErrorToConsole: import("../zoho.error.api").LogZohoServerErrorFunction;
24
+ export declare const logZohoAccountsErrorToConsole: import("..").LogZohoServerErrorFunction;
25
25
  export declare function parseZohoAccountsError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
26
26
  export declare function parseZohoAccountsServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData, responseError: FetchResponseError): ParsedZohoServerError;
27
27
  export declare const interceptZohoAccounts200StatusWithErrorResponse: import("@dereekb/util/fetch").FetchJsonInterceptJsonResponseFunction;
28
- export declare const handleZohoAccountsErrorFetch: import("../zoho.error.api").HandleZohoErrorFetchFactory;
28
+ export declare const handleZohoAccountsErrorFetch: import("..").HandleZohoErrorFetchFactory;
@@ -0,0 +1,430 @@
1
+ import { type ZohoDataArrayResultRef, type ZohoPageFilter, type ZohoPageResult } from './../zoho.api.page';
2
+ import { type FetchFileResponse, type FetchJsonBody, type FetchJsonInput, type FetchPage, type FetchPageFactory, type FetchPageFactoryOptions, makeUrlSearchParams } from '@dereekb/util/fetch';
3
+ import { type ZohoCrmConfigApiUrlInput, type ZohoCrmContext } from './crm.config';
4
+ import { type ZohoCrmCommaSeparateFieldNames, type ZohoCrmCustomViewId, type ZohoCrmDraftOrSaveState, type ZohoCrmFieldName, type ZohoCrmModuleNameRef, type ZohoCrmChangeObjectDetails, type ZohoCrmRecord, type ZohoCrmRecordId, type ZohoCrmTerritoryId, type ZohoCrmTrueFalseBoth, type ZohoCrmRestFunctionApiName, type ZohoCrmUserId, type ZohoCrmModuleName, type ZohoCrmRecordEmailMetadata, type ZohoCrmRecordAttachmentMetadata, type ZohoCrmAttachmentRecordId, type ZohoCrmAttachmentCategoryId, type KnownZohoCrmAttachmentCategoryName } from './crm';
5
+ import { type ZohoCrmSearchRecordsCriteriaTreeElement } from './crm.criteria';
6
+ import { type ArrayOrValue, type EmailAddress, type Maybe, type PhoneNumber, type SortingOrder, type UniqueModelWithId, type WebsiteUrlWithPrefix } from '@dereekb/util';
7
+ import { type ZohoServerErrorDataWithDetails, type ZohoServerErrorStatus, type ZohoServerSuccessCode, type ZohoServerSuccessStatus } from '../zoho.error.api';
8
+ import { type ZohoDateTimeString } from '../zoho.type';
9
+ import { BaseError } from 'make-error';
10
+ /**
11
+ * The maximum number of records allowed for most CRUD functions.
12
+ *
13
+ * This is a limit enforced by the Zoho Crm API
14
+ */
15
+ export declare const ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT = 100;
16
+ export type ZohoCrmUpdateRecordResult<T> = ZohoCrmMultiRecordResult<T, ZohoCrmChangeObjectResponseSuccessEntry, ZohoCrmChangeObjectResponseErrorEntry>;
17
+ export type ZohoCrmUpdateRecordResponse = ZohoCrmChangeObjectResponse;
18
+ export type ZohoCrmCreateRecordData<T> = Omit<T, 'id'>;
19
+ export interface ZohoCrmCreateSingleRecordInput<T> extends ZohoCrmModuleNameRef {
20
+ readonly data: ZohoCrmCreateRecordData<T>;
21
+ }
22
+ export interface ZohoCrmCreateMultiRecordInput<T> extends ZohoCrmModuleNameRef {
23
+ readonly data: ZohoCrmCreateRecordData<T>[];
24
+ }
25
+ export type ZohoCrmCreateRecordLikeFunction = ZohoCrmCreateMultiRecordFunction & ZohoCrmCreateSingleRecordFunction;
26
+ export type ZohoCrmCreateSingleRecordFunction = <T>(input: ZohoCrmCreateSingleRecordInput<T>) => Promise<ZohoCrmChangeObjectDetails>;
27
+ export type ZohoCrmCreateMultiRecordFunction = <T>(input: ZohoCrmCreateMultiRecordInput<T>) => Promise<ZohoCrmUpdateRecordResult<T>>;
28
+ export type ZohoCrmUpdateRecordInput<T> = ZohoCrmUpdateSingleRecordInput<T> | ZohoCrmUpdateMultiRecordInput<T>;
29
+ export type ZohoCrmUpdateRecordData<T> = UniqueModelWithId & Partial<T>;
30
+ export interface ZohoCrmUpdateSingleRecordInput<T> extends ZohoCrmModuleNameRef {
31
+ readonly data: ZohoCrmUpdateRecordData<T>;
32
+ }
33
+ export interface ZohoCrmUpdateMultiRecordInput<T> extends ZohoCrmModuleNameRef {
34
+ readonly data: ZohoCrmUpdateRecordData<T>[];
35
+ }
36
+ export type ZohoCrmUpdateRecordLikeFunction = ZohoCrmUpdateMultiRecordFunction & ZohoCrmUpdateSingleRecordFunction;
37
+ export type ZohoCrmUpdateMultiRecordFunction = <T>(input: ZohoCrmUpdateMultiRecordInput<T>) => Promise<ZohoCrmUpdateRecordResult<T>>;
38
+ export type ZohoCrmUpdateSingleRecordFunction = <T>(input: ZohoCrmUpdateSingleRecordInput<T>) => Promise<ZohoCrmChangeObjectDetails>;
39
+ export type ZohoCrmUpsertRecordData<T> = ZohoCrmCreateRecordData<T> | ZohoCrmUpdateRecordData<T>;
40
+ export interface ZohoCrmUpsertSingleRecordInput<T> extends ZohoCrmModuleNameRef {
41
+ readonly data: ZohoCrmUpsertRecordData<T>;
42
+ }
43
+ export interface ZohoCrmUpsertMultiRecordInput<T> extends ZohoCrmModuleNameRef {
44
+ readonly data: ZohoCrmUpsertRecordData<T>[];
45
+ }
46
+ export type ZohoCrmUpsertRecordLikeFunction = ZohoCrmUpsertMultiRecordFunction & ZohoCrmUpsertSingleRecordFunction;
47
+ export type ZohoCrmUpsertMultiRecordFunction = <T>(input: ZohoCrmUpsertMultiRecordInput<T>) => Promise<ZohoCrmUpdateRecordResult<T>>;
48
+ export type ZohoCrmUpsertSingleRecordFunction = <T>(input: ZohoCrmUpsertSingleRecordInput<T>) => Promise<ZohoCrmChangeObjectDetails>;
49
+ export type ZohoCrmInsertRecordFunction = ZohoCrmCreateRecordLikeFunction;
50
+ /**
51
+ * Inserts one or more records into Crm.
52
+ *
53
+ * https://www.zoho.com/crm/developer-guide/apiv2/insert-records.html
54
+ *
55
+ * @param context
56
+ * @returns
57
+ */
58
+ export declare function zohoCrmInsertRecord(context: ZohoCrmContext): ZohoCrmInsertRecordFunction;
59
+ /**
60
+ * Upsert function that can do either an insert or and update ased on the input.
61
+ */
62
+ export type ZohoCrmUpsertRecordFunction = ZohoCrmUpsertRecordLikeFunction;
63
+ /**
64
+ * Updates or inserts one or more records in Crm.
65
+ *
66
+ * https://www.zoho.com/crm/developer-guide/apiv2/upsert-records.html
67
+ *
68
+ * @param context
69
+ * @returns
70
+ */
71
+ export declare function zohoCrmUpsertRecord(context: ZohoCrmContext): ZohoCrmUpsertRecordFunction;
72
+ export type ZohoCrmUpdateRecordFunction = ZohoCrmUpdateRecordLikeFunction;
73
+ /**
74
+ * Updates one or more records in Crm.
75
+ *
76
+ * https://www.zoho.com/crm/developer-guide/apiv2/update-records.html
77
+ *
78
+ * @param context
79
+ * @returns
80
+ */
81
+ export declare function zohoCrmUpdateRecord(context: ZohoCrmContext): ZohoCrmUpdateRecordFunction;
82
+ export type ZohoCrmDeleteRecordFunction = (input: ZohoCrmDeleteRecordInput) => Promise<ZohoCrmDeleteRecordResponse>;
83
+ export interface ZohoCrmDeleteRecordInput extends ZohoCrmModuleNameRef {
84
+ /**
85
+ * Id or array of ids to delete.
86
+ */
87
+ readonly ids: ArrayOrValue<ZohoCrmRecordId>;
88
+ readonly wf_trigger?: boolean;
89
+ }
90
+ export interface ZohoCrmDeleteRecordResponseSuccessEntry extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
91
+ readonly details: {
92
+ readonly id: ZohoCrmRecordId;
93
+ };
94
+ }
95
+ export type ZohoCrmDeleteRecordResponse = ZohoCrmChangeObjectLikeResponseSuccessAndErrorPairs<ZohoCrmDeleteRecordResponseSuccessEntry>;
96
+ export type ZohoCrmDeleteRecordResult = ZohoCrmChangeObjectResponseSuccessEntry[];
97
+ /**
98
+ * Deletes one or more records from the given module.
99
+ *
100
+ * https://www.zoho.com/crm/developer-guide/apiv2/delete-records.html
101
+ *
102
+ * @param context
103
+ * @returns ZohoCrmDeleteRecordFunction
104
+ */
105
+ export declare function zohoCrmDeleteRecord(context: ZohoCrmContext): ZohoCrmDeleteRecordFunction;
106
+ export interface ZohoCrmGetRecordByIdInput extends ZohoCrmModuleNameRef {
107
+ readonly id: ZohoCrmRecordId;
108
+ }
109
+ export type ZohoCrmGetRecordByIdResponse<T = ZohoCrmRecord> = ZohoDataArrayResultRef<T>;
110
+ export type ZohoCrmGetRecordByIdResult<T = ZohoCrmRecord> = T;
111
+ export type ZohoCrmGetRecordByIdFunction = <T = ZohoCrmRecord>(input: ZohoCrmGetRecordByIdInput) => Promise<ZohoCrmGetRecordByIdResult<T>>;
112
+ /**
113
+ * Retrieves a specific record from the given module.
114
+ *
115
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-records.html
116
+ *
117
+ * @param context
118
+ * @returns
119
+ */
120
+ export declare function zohoCrmGetRecordById(context: ZohoCrmContext): ZohoCrmGetRecordByIdFunction;
121
+ export interface ZohoCrmGetRecordsPageFilter extends ZohoPageFilter {
122
+ readonly converted?: ZohoCrmTrueFalseBoth;
123
+ readonly approved?: ZohoCrmTrueFalseBoth;
124
+ }
125
+ export interface ZohoCrmGetRecordsFieldsRef {
126
+ readonly fields: ArrayOrValue<ZohoCrmFieldName> | ZohoCrmCommaSeparateFieldNames;
127
+ }
128
+ export interface ZohoCrmGetRecordsInput extends ZohoCrmModuleNameRef, ZohoCrmGetRecordsPageFilter, ZohoCrmGetRecordsFieldsRef {
129
+ readonly sort_order?: SortingOrder;
130
+ readonly sort_by?: ZohoCrmFieldName;
131
+ readonly cvid?: ZohoCrmCustomViewId;
132
+ readonly territory_id?: ZohoCrmTerritoryId;
133
+ readonly include_child?: boolean;
134
+ readonly $state?: ZohoCrmDraftOrSaveState;
135
+ }
136
+ export type ZohoCrmGetRecordsResponse<T = ZohoCrmRecord> = ZohoPageResult<T>;
137
+ export type ZohoCrmGetRecordsFunction = <T = ZohoCrmRecord>(input: ZohoCrmGetRecordsInput) => Promise<ZohoCrmGetRecordsResponse<T>>;
138
+ /**
139
+ * Retrieves records from the given module. Used for paginating across all records.
140
+ *
141
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-records.html
142
+ *
143
+ * @param context
144
+ * @returns
145
+ */
146
+ export declare function zohoCrmGetRecords(context: ZohoCrmContext): ZohoCrmGetRecordsFunction;
147
+ /**
148
+ * Configuration for searching records.
149
+ *
150
+ * Only criteria, email, phone, or word will be used at a single time.
151
+ */
152
+ export interface ZohoCrmSearchRecordsInput<T = ZohoCrmRecord> extends ZohoCrmModuleNameRef, ZohoCrmGetRecordsPageFilter {
153
+ readonly criteria?: Maybe<ZohoCrmSearchRecordsCriteriaTreeElement<T>>;
154
+ readonly cvid?: Maybe<ZohoCrmCustomViewId>;
155
+ readonly email?: Maybe<EmailAddress>;
156
+ readonly phone?: Maybe<PhoneNumber>;
157
+ readonly word?: Maybe<string>;
158
+ }
159
+ export type ZohoCrmSearchRecordsResponse<T = ZohoCrmRecord> = ZohoCrmGetRecordsResponse<T>;
160
+ export type ZohoCrmSearchRecordsFunction = <T = ZohoCrmRecord>(input: ZohoCrmSearchRecordsInput<T>) => Promise<ZohoCrmSearchRecordsResponse<T>>;
161
+ /**
162
+ * Searches records from the given module.
163
+ *
164
+ * https://www.zoho.com/crm/developer-guide/apiv2/search-records.html
165
+ *
166
+ * @param context
167
+ * @returns
168
+ */
169
+ export declare function zohoCrmSearchRecords(context: ZohoCrmContext): ZohoCrmSearchRecordsFunction;
170
+ export type ZohoCrmSearchRecordsPageFactory = <T = ZohoCrmRecord>(input: ZohoCrmSearchRecordsInput<T>, options?: Maybe<FetchPageFactoryOptions<ZohoCrmSearchRecordsInput<T>, ZohoCrmSearchRecordsResponse<T>>>) => FetchPage<ZohoCrmSearchRecordsInput<T>, ZohoCrmSearchRecordsResponse<T>>;
171
+ export declare function zohoCrmSearchRecordsPageFactory(context: ZohoCrmContext): ZohoCrmSearchRecordsPageFactory;
172
+ export interface ZohoCrmGetRelatedRecordsFunctionConfig {
173
+ readonly targetModule: ZohoCrmModuleName;
174
+ /**
175
+ * If true, will return an empty page result instead of null when no results are found.
176
+ *
177
+ * Defaults to true.
178
+ */
179
+ readonly returnEmptyRecordsInsteadOfNull?: boolean;
180
+ }
181
+ export type ZohoCrmGetRelatedRecordsFunctionFactory = <T = ZohoCrmRecord>(input: ZohoCrmGetRelatedRecordsFunctionConfig) => ZohoCrmGetRelatedRecordsFunction<T>;
182
+ export type ZohoCrmGetRelatedRecordsPageFilter = ZohoPageFilter;
183
+ export interface ZohoCrmGetRelatedRecordsRequest extends ZohoCrmGetRecordByIdInput, ZohoCrmGetRelatedRecordsPageFilter {
184
+ /**
185
+ * Optional, Use to filter the related records of the primary/target record with said ids.
186
+ *
187
+ * For example, providing this value will return the Notes with these ids when searching on related Notes for the primary/target record.
188
+ */
189
+ readonly ids?: Maybe<ArrayOrValue<ZohoCrmRecordId>>;
190
+ /**
191
+ * @deprecated set variables on request object directly instead of using this filter.
192
+ */
193
+ readonly filter?: Maybe<ZohoCrmGetRelatedRecordsPageFilter>;
194
+ }
195
+ /**
196
+ * A variant of ZohoCrmGetRelatedRecordsRequest that includes a required fields property.
197
+ */
198
+ export interface ZohoCrmGetRelatedRecordsRequestWithFields extends ZohoCrmGetRelatedRecordsRequest, ZohoCrmGetRecordsFieldsRef {
199
+ }
200
+ export type ZohoCrmGetRelatedRecordsResponse<T = ZohoCrmRecord> = ZohoPageResult<T>;
201
+ export type ZohoCrmGetRelatedRecordsFunction<T = ZohoCrmRecord> = (input: ZohoCrmGetRelatedRecordsRequest) => Promise<ZohoCrmGetRelatedRecordsResponse<T>>;
202
+ /**
203
+ * Creates a ZohoCrmGetRelatedRecordsFunctionFactory, which can be used to create ZohoCrmGetRelatedRecordsFunction<T> that targets retrieving related records of a given type.
204
+ *
205
+ * https://www.zoho.com/crm/developer-guide/apiv2/get-related-records.html
206
+ *
207
+ * @param context the ZohoCrmContext to use
208
+ * @returns a ZohoCrmGetRelatedRecordsFunctionFactory
209
+ */
210
+ export declare function zohoCrmGetRelatedRecordsFunctionFactory(context: ZohoCrmContext): ZohoCrmGetRelatedRecordsFunctionFactory;
211
+ /**
212
+ * Type filter to use when fetching emails for a record.
213
+ *
214
+ * https://www.zoho.com/crm/developer/docs/api/v8/get-email-rel-list.html
215
+ */
216
+ export type ZohoCrmGetEmailsForRecordTypeFilter = 'sent_from_crm' | 'scheduled_in_crm' | 'drafts' | 'user_emails' | 'all_contacts_sent_crm_emails' | 'all_contacts_scheduled_crm_emails' | 'all_contacts_draft_crm_emails';
217
+ export type ZohoCrmGetEmailsForRecordRequest = ZohoCrmGetRelatedRecordsRequest & {
218
+ /**
219
+ * The type of emails to fetch.
220
+ */
221
+ readonly type?: Maybe<ZohoCrmGetEmailsForRecordTypeFilter>;
222
+ /**
223
+ * The ID of the user whose emails you want to fetch.
224
+ *
225
+ * Note that you can use this parameter only with type=user_emails.
226
+ */
227
+ readonly owner_id?: Maybe<ZohoCrmRecordId>;
228
+ };
229
+ export type ZohoCrmGetEmailsForRecordResponse = ZohoPageResult<ZohoCrmRecordEmailMetadata>;
230
+ export type ZohoCrmGetEmailsForRecordFunction = (input: ZohoCrmGetEmailsForRecordRequest) => Promise<ZohoCrmGetEmailsForRecordResponse>;
231
+ export type ZohoCrmGetEmailsForRecordRawApiResponse = Omit<ZohoCrmGetEmailsForRecordResponse, 'data'> & {
232
+ Emails: ZohoCrmGetEmailsForRecordResponse['data'];
233
+ };
234
+ export declare function zohoCrmGetEmailsForRecord(context: ZohoCrmContext): ZohoCrmGetEmailsForRecordFunction;
235
+ export type ZohoCrmGetEmailsForRecordPageFactory = FetchPageFactory<ZohoCrmGetEmailsForRecordRequest, ZohoCrmGetEmailsForRecordResponse>;
236
+ export declare function zohoCrmGetEmailsForRecordPageFactory(context: ZohoCrmContext): ZohoCrmGetEmailsForRecordPageFactory;
237
+ export type ZohoCrmGetAttachmentsForRecordRequest = ZohoCrmGetRelatedRecordsRequest & ZohoCrmGetRecordsFieldsRef;
238
+ export type ZohoCrmGetAttachmentsForRecordResponse = ZohoPageResult<ZohoCrmRecordAttachmentMetadata>;
239
+ export type ZohoCrmGetAttachmentsForRecordFunction = (input: ZohoCrmGetAttachmentsForRecordRequest) => Promise<ZohoCrmGetAttachmentsForRecordResponse>;
240
+ export declare function zohoCrmGetAttachmentsForRecord(context: ZohoCrmContext): ZohoCrmGetAttachmentsForRecordFunction;
241
+ export type ZohoCrmGetAttachmentsForRecordPageFactory = FetchPageFactory<ZohoCrmGetAttachmentsForRecordRequest, ZohoCrmGetAttachmentsForRecordResponse>;
242
+ export declare function zohoCrmGetAttachmentsForRecordPageFactory(context: ZohoCrmContext): ZohoCrmGetAttachmentsForRecordPageFactory;
243
+ /**
244
+ * Maximum attachment size allowed by Zoho Crm.
245
+ *
246
+ * 20MB
247
+ */
248
+ export declare const ZOHO_CRM_ATTACHMENT_MAX_SIZE: number;
249
+ export interface ZohoCrmUploadAttachmentForRecordRequest extends ZohoCrmGetRecordByIdInput {
250
+ /**
251
+ * Requires the use of a FormData object.
252
+ *
253
+ * Max of 20MB are allowed
254
+ *
255
+ * @deprecated Use attachmentUrl instead for now.
256
+ */
257
+ readonly formData?: FormData;
258
+ /**
259
+ * File url to pull the file from.
260
+ *
261
+ * Either this or formData must be provided.
262
+ */
263
+ readonly attachmentUrl?: WebsiteUrlWithPrefix;
264
+ /**
265
+ * The category id(s) of the attachment.
266
+ *
267
+ * Either this or attachments_category must be provided.
268
+ */
269
+ readonly attachmentCategoryId?: ArrayOrValue<ZohoCrmAttachmentCategoryId>;
270
+ /**
271
+ * The category name(s) of the attachment.
272
+ *
273
+ * Either this or attachments_category_id must be provided.
274
+ *
275
+ * Example: "Resume"
276
+ */
277
+ readonly attachmentCategoryName?: ArrayOrValue<KnownZohoCrmAttachmentCategoryName>;
278
+ }
279
+ export type ZohoCrmUploadAttachmentForRecordResponse = Response;
280
+ export type ZohoCrmUploadAttachmentForRecordFunction = (input: ZohoCrmUploadAttachmentForRecordRequest) => Promise<ZohoCrmUploadAttachmentForRecordResponse>;
281
+ /**
282
+ * Uploads an attachment to a record.
283
+ *
284
+ * https://www.zoho.com/crm/developer-guide/apiv2/upload-attachment.html
285
+ *
286
+ * @param context
287
+ * @returns
288
+ */
289
+ export declare function zohoCrmUploadAttachmentForRecord(context: ZohoCrmContext): ZohoCrmUploadAttachmentForRecordFunction;
290
+ export interface ZohoCrmDownloadAttachmentForRecordRequest extends ZohoCrmGetRecordByIdInput {
291
+ readonly attachment_id: ZohoCrmAttachmentRecordId;
292
+ }
293
+ export type ZohoCrmDownloadAttachmentForRecordResponse = FetchFileResponse;
294
+ export type ZohoCrmDownloadAttachmentForRecordFunction = (input: ZohoCrmDownloadAttachmentForRecordRequest) => Promise<ZohoCrmDownloadAttachmentForRecordResponse>;
295
+ /**
296
+ * Downloads an attachment from a record.
297
+ *
298
+ * https://www.zoho.com/crm/developer-guide/apiv2/download-attachments.html
299
+ *
300
+ * @param context
301
+ * @returns
302
+ */
303
+ export declare function zohoCrmDownloadAttachmentForRecord(context: ZohoCrmContext): ZohoCrmDownloadAttachmentForRecordFunction;
304
+ export interface ZohoCrmDeleteAttachmentFromRecordRequest extends ZohoCrmGetRecordByIdInput {
305
+ readonly attachment_id: ZohoCrmAttachmentRecordId;
306
+ }
307
+ export type ZohoCrmDeleteAttachmentFromRecordResponse = Response;
308
+ export type ZohoCrmDeleteAttachmentFromRecordFunction = (input: ZohoCrmDeleteAttachmentFromRecordRequest) => Promise<ZohoCrmDeleteAttachmentFromRecordResponse>;
309
+ /**
310
+ * Deletes an attachment from a record.
311
+ *
312
+ * https://www.zoho.com/crm/developer-guide/apiv2/delete-attachments.html
313
+ *
314
+ * @param context
315
+ * @returns
316
+ */
317
+ export declare function zohoCrmDeleteAttachmentFromRecord(context: ZohoCrmContext): ZohoCrmDeleteAttachmentFromRecordFunction;
318
+ export type ZohoCrmExecuteRestApiFunctionRequest = ZohoCrmExecuteRestApiFunctionNormalRequest | ZohoCrmExecuteRestApiFunctionApiSpecificRequest;
319
+ export interface ZohoCrmExecuteRestApiFunctionNormalRequest {
320
+ readonly functionName: ZohoCrmRestFunctionApiName;
321
+ readonly params?: Maybe<ZohoCrmExecuteRestApiFunctionParams>;
322
+ }
323
+ export interface ZohoCrmExecuteRestApiFunctionApiSpecificRequest extends ZohoCrmExecuteRestApiFunctionNormalRequest {
324
+ /**
325
+ * If provided the function will use the API key provided instead of the internal oauth
326
+ */
327
+ readonly apiKey: Maybe<ZohoCrmRestFunctionApiKey>;
328
+ /**
329
+ * If provided, the function will target the given API and not the default. Only used when apiKey is provided.
330
+ *
331
+ * Careful when using this, as it might indicate that the target is not environment specific/aware.
332
+ */
333
+ readonly apiUrl?: ZohoCrmConfigApiUrlInput;
334
+ }
335
+ export type ZohoCrmRestFunctionApiKey = string;
336
+ export type ZohoCrmExecuteRestApiFunctionParams = Record<string, string | number | boolean | ZohoDateTimeString>;
337
+ export type ZohoCrmExecuteRestApiFunctionResponse = ZohoCrmExecuteRestApiFunctionSuccessResponse | ZohoCrmExecuteRestApiFunctionErrorResponse;
338
+ export interface ZohoCrmExecuteRestApiFunctionSuccessResponse {
339
+ readonly code: 'success';
340
+ readonly details: ZohoCrmExecuteRestApiFunctionSuccessDetails;
341
+ readonly message: string;
342
+ }
343
+ export interface ZohoCrmExecuteRestApiFunctionSuccessDetails {
344
+ readonly userMessage: string[];
345
+ readonly output_type: string;
346
+ readonly id: ZohoCrmUserId;
347
+ }
348
+ export interface ZohoCrmExecuteRestApiFunctionErrorResponse {
349
+ readonly code: string;
350
+ readonly details: unknown;
351
+ readonly message: string;
352
+ }
353
+ export declare class ZohoCrmExecuteRestApiFunctionError extends BaseError {
354
+ readonly error: ZohoCrmExecuteRestApiFunctionErrorResponse;
355
+ constructor(error: ZohoCrmExecuteRestApiFunctionErrorResponse);
356
+ }
357
+ /**
358
+ * Executes the Zoho Crm function based on the input.
359
+ *
360
+ * If the function fails execution a ZohoCrmExecuteRestApiFunctionError will be thrown. Other API errors may still be thrown.
361
+ */
362
+ export type ZohoCrmExecuteRestApiFunctionFunction = (input: ZohoCrmExecuteRestApiFunctionRequest) => Promise<ZohoCrmExecuteRestApiFunctionSuccessDetails>;
363
+ /**
364
+ * Creates a ZohoCrmExecuteRestApiFunctionFunction
365
+ *
366
+ * OAuth Details:
367
+ * - https://www.zoho.com/crm/developer/docs/functions/serverless-fn-oauth.html#OAuth2
368
+ * - There is no documentation for ZohoCrm specifically, but it seems to behave the same way
369
+ * - You will need the following scopes: ZohoCrm.functions.execute.READ,ZohoCrm.functions.execute.CREATE
370
+ *
371
+ * @param context
372
+ * @returns
373
+ */
374
+ export declare function zohoCrmExecuteRestApiFunction(context: ZohoCrmContext): ZohoCrmExecuteRestApiFunctionFunction;
375
+ export declare function zohoCrmUrlSearchParamsMinusModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
376
+ export declare function zohoCrmUrlSearchParamsMinusIdAndModule(...input: Maybe<object | Record<string, string | number>>[]): URLSearchParams;
377
+ /**
378
+ * @deprecated use makeUrlSearchParams instead.
379
+ */
380
+ export declare const zohoCrmUrlSearchParams: typeof makeUrlSearchParams;
381
+ export declare function zohoCrmApiFetchJsonInput(method: string, body?: Maybe<FetchJsonBody>): FetchJsonInput;
382
+ /**
383
+ * Catches ZohoServerFetchResponseDataArrayError and returns the error data array as the response data, as each data element will have the error details.
384
+ *
385
+ * Use to catch errors from functions that return ZohoCrmChangeObjectLikeResponse and pass the result to zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs.
386
+ */
387
+ export declare function zohoCrmCatchZohoCrmChangeObjectLikeResponseError<R extends ZohoCrmChangeObjectLikeResponse<any>>(e: unknown): R;
388
+ export type ZohoCrmChangeObjectLikeResponse<T extends ZohoCrmChangeObjectLikeResponseEntry = ZohoCrmChangeObjectLikeResponseEntry> = ZohoDataArrayResultRef<T>;
389
+ export type ZohoCrmChangeObjectLikeResponseEntry<E extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta = ZohoCrmChangeObjectLikeResponseSuccessEntryMeta> = E | ZohoCrmChangeObjectResponseErrorEntry;
390
+ export type ZohoCrmChangeObjectLikeResponseSuccessEntryType<T extends ZohoCrmChangeObjectLikeResponseEntry> = T extends ZohoCrmChangeObjectLikeResponseEntry<infer E> ? E : never;
391
+ export interface ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
392
+ readonly code: ZohoServerSuccessCode;
393
+ readonly status: ZohoServerSuccessStatus;
394
+ readonly message: string;
395
+ }
396
+ export type ZohoCrmChangeObjectLikeResponseSuccessAndErrorPairs<T extends ZohoCrmChangeObjectLikeResponseEntry> = ZohoCrmChangeObjectLikeResponse<T> & {
397
+ readonly successItems: ZohoCrmChangeObjectLikeResponseSuccessEntryType<T>[];
398
+ readonly errorItems: ZohoCrmChangeObjectResponseErrorEntry[];
399
+ };
400
+ export declare function zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs<T extends ZohoCrmChangeObjectLikeResponseEntry>(response: ZohoCrmChangeObjectLikeResponse<T>): ZohoCrmChangeObjectLikeResponseSuccessAndErrorPairs<T>;
401
+ export type ZohoCrmChangeObjectResponse<T extends ZohoCrmChangeObjectResponseEntry = ZohoCrmChangeObjectResponseEntry> = ZohoCrmChangeObjectLikeResponse<T>;
402
+ export type ZohoCrmChangeObjectResponseEntry<E extends ZohoCrmChangeObjectResponseSuccessEntry = ZohoCrmChangeObjectResponseSuccessEntry> = ZohoCrmChangeObjectLikeResponseEntry<E>;
403
+ export interface ZohoCrmChangeObjectResponseSuccessEntry<D extends ZohoCrmChangeObjectDetails = ZohoCrmChangeObjectDetails> extends ZohoCrmChangeObjectLikeResponseSuccessEntryMeta {
404
+ readonly details: D;
405
+ }
406
+ export interface ZohoCrmChangeObjectResponseErrorEntry extends ZohoServerErrorDataWithDetails {
407
+ readonly status: ZohoServerErrorStatus;
408
+ }
409
+ export interface ZohoCrmMultiRecordResult<I, OS, OE> {
410
+ readonly successItems: ZohoCrmMultiRecordResultEntry<I, OS>[];
411
+ readonly errorItems: ZohoCrmMultiRecordResultEntry<I, OE>[];
412
+ }
413
+ export interface ZohoCrmMultiRecordResultItem {
414
+ readonly status: ZohoServerSuccessStatus | ZohoServerErrorStatus;
415
+ }
416
+ export declare function zohoCrmMultiRecordResult<I, OS extends ZohoCrmMultiRecordResultItem, OE extends ZohoCrmMultiRecordResultItem>(input: I[], results: (OS | OE)[]): ZohoCrmMultiRecordResult<I, OS, OE>;
417
+ export interface ZohoCrmMultiRecordResultEntry<I, O> {
418
+ /**
419
+ * Input record/data.
420
+ */
421
+ readonly input: I;
422
+ /**
423
+ * The result of the insert.
424
+ */
425
+ readonly result: O;
426
+ }
427
+ /**
428
+ * @deprecated use ZohoCrmGetRelatedRecordsPageFilter instead.
429
+ */
430
+ export type ZohoCrmGetNotesPageFilter = ZohoCrmGetRelatedRecordsPageFilter;