@dereekb/zoho 13.11.14 → 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
|
@@ -10,9 +10,9 @@ import { type Maybe } from '@dereekb/util';
|
|
|
10
10
|
* Resolves the API URL via environment variables following the naming convention
|
|
11
11
|
* `ZOHO_RECRUIT_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
12
12
|
*
|
|
13
|
-
* @param configService - NestJS config service populated with Zoho environment variables
|
|
14
|
-
* @returns Validated Zoho Recruit service configuration
|
|
15
|
-
* @throws {Error} If required config values (e.g. API URL) are missing
|
|
13
|
+
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
14
|
+
* @returns Validated Zoho Recruit service configuration.
|
|
15
|
+
* @throws {Error} If required config values (e.g. API URL) are missing.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
@@ -28,8 +28,8 @@ export declare function zohoRecruitServiceConfigFactory(configService: ConfigSer
|
|
|
28
28
|
* Reads Zoho Accounts (OAuth) settings scoped to the Recruit service from
|
|
29
29
|
* the NestJS ConfigService and returns an accounts service config.
|
|
30
30
|
*
|
|
31
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
32
|
-
* @returns Zoho Accounts service config scoped to the Recruit service access token
|
|
31
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
32
|
+
* @returns Zoho Accounts service config scoped to the Recruit service access token.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```typescript
|
|
@@ -68,14 +68,10 @@ export interface ProvideAppZohoRecruitMetadataConfig extends Pick<ModuleMetadata
|
|
|
68
68
|
* exports {@link ZohoRecruitApi} by default. Additional imports, exports, and providers
|
|
69
69
|
* from the config are merged in.
|
|
70
70
|
*
|
|
71
|
-
* @param config - Module configuration with optional dependency module and extra metadata
|
|
71
|
+
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
72
72
|
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
73
73
|
*
|
|
74
|
-
* @
|
|
75
|
-
* ```typescript
|
|
76
|
-
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
77
|
-
*
|
|
78
|
-
* @Module({
|
|
74
|
+
* @Module ({
|
|
79
75
|
* providers: [
|
|
80
76
|
* {
|
|
81
77
|
* provide: ZohoAccountsAccessTokenCacheService,
|
|
@@ -85,9 +81,12 @@ export interface ProvideAppZohoRecruitMetadataConfig extends Pick<ModuleMetadata
|
|
|
85
81
|
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
86
82
|
* })
|
|
87
83
|
* export class ZohoRecruitDependencyModule {}
|
|
88
|
-
*
|
|
89
|
-
* @Module(appZohoRecruitModuleMetadata({ dependencyModule: ZohoRecruitDependencyModule }))
|
|
84
|
+
* @Module (appZohoRecruitModuleMetadata({ dependencyModule: ZohoRecruitDependencyModule }))
|
|
90
85
|
* export class AppZohoRecruitModule {}
|
|
91
86
|
* ```
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
92
91
|
*/
|
|
93
92
|
export declare function appZohoRecruitModuleMetadata(config: ProvideAppZohoRecruitMetadataConfig): ModuleMetadata;
|
|
@@ -17,93 +17,93 @@ export declare class ZohoSignApi {
|
|
|
17
17
|
/**
|
|
18
18
|
* The authenticated Sign context used by all operation accessors.
|
|
19
19
|
*
|
|
20
|
-
* @returns
|
|
20
|
+
* @returns The Sign context from the underlying client.
|
|
21
21
|
*/
|
|
22
22
|
get signContext(): ZohoSignContext;
|
|
23
23
|
/**
|
|
24
24
|
* Rate limiter shared across all Sign requests to respect Zoho API quotas.
|
|
25
25
|
*
|
|
26
|
-
* @returns
|
|
26
|
+
* @returns The shared rate limiter instance.
|
|
27
27
|
*/
|
|
28
28
|
get zohoRateLimiter(): import("@dereekb/util").ResetPeriodPromiseRateLimiter;
|
|
29
29
|
/**
|
|
30
30
|
* Initializes the Sign client by combining the service config with the
|
|
31
31
|
* accounts context for OAuth token management.
|
|
32
32
|
*
|
|
33
|
-
* @param config - Zoho Sign service configuration
|
|
34
|
-
* @param zohoAccountsApi -
|
|
33
|
+
* @param config - Zoho Sign service configuration.
|
|
34
|
+
* @param zohoAccountsApi - Accounts API used for OAuth token management.
|
|
35
35
|
*/
|
|
36
36
|
constructor(config: ZohoSignServiceConfig, zohoAccountsApi: ZohoAccountsApi);
|
|
37
37
|
/**
|
|
38
38
|
* Configured pass-through for {@link zohoSignGetDocument}.
|
|
39
39
|
*
|
|
40
|
-
* @returns
|
|
40
|
+
* @returns Bound get document function.
|
|
41
41
|
*/
|
|
42
42
|
get getDocument(): import("@dereekb/zoho").ZohoSignGetDocumentFunction;
|
|
43
43
|
/**
|
|
44
44
|
* Configured pass-through for {@link zohoSignGetDocuments}.
|
|
45
45
|
*
|
|
46
|
-
* @returns
|
|
46
|
+
* @returns Bound get documents function.
|
|
47
47
|
*/
|
|
48
48
|
get getDocuments(): import("@dereekb/zoho").ZohoSignGetDocumentsFunction;
|
|
49
49
|
/**
|
|
50
50
|
* Configured pass-through for {@link zohoSignGetDocumentsPageFactory}.
|
|
51
51
|
*
|
|
52
|
-
* @returns
|
|
52
|
+
* @returns Bound get documents page factory function.
|
|
53
53
|
*/
|
|
54
54
|
get getDocumentsPageFactory(): import("@dereekb/util/fetch").FetchPageFactory<import("@dereekb/zoho").ZohoSignGetDocumentsInput, import("@dereekb/zoho").ZohoSignGetDocumentsResponse>;
|
|
55
55
|
/**
|
|
56
56
|
* Configured pass-through for {@link zohoSignGetDocumentFormData}.
|
|
57
57
|
*
|
|
58
|
-
* @returns
|
|
58
|
+
* @returns Bound get document form data function.
|
|
59
59
|
*/
|
|
60
60
|
get getDocumentFormData(): import("@dereekb/zoho").ZohoSignGetDocumentFormDataFunction;
|
|
61
61
|
/**
|
|
62
62
|
* Configured pass-through for {@link zohoSignRetrieveFieldTypes}.
|
|
63
63
|
*
|
|
64
|
-
* @returns
|
|
64
|
+
* @returns Bound retrieve field types function.
|
|
65
65
|
*/
|
|
66
66
|
get retrieveFieldTypes(): import("@dereekb/zoho").ZohoSignRetrieveFieldTypesFunction;
|
|
67
67
|
/**
|
|
68
68
|
* Configured pass-through for {@link zohoSignDownloadPdf}.
|
|
69
69
|
*
|
|
70
|
-
* @returns
|
|
70
|
+
* @returns Bound download PDF function.
|
|
71
71
|
*/
|
|
72
72
|
get downloadPdf(): import("@dereekb/zoho").ZohoSignDownloadPdfFunction;
|
|
73
73
|
/**
|
|
74
74
|
* Configured pass-through for {@link zohoSignDownloadCompletionCertificate}.
|
|
75
75
|
*
|
|
76
|
-
* @returns
|
|
76
|
+
* @returns Bound download completion certificate function.
|
|
77
77
|
*/
|
|
78
78
|
get downloadCompletionCertificate(): import("@dereekb/zoho").ZohoSignDownloadCompletionCertificateFunction;
|
|
79
79
|
/**
|
|
80
80
|
* Configured pass-through for {@link zohoSignCreateDocument}.
|
|
81
81
|
*
|
|
82
|
-
* @returns
|
|
82
|
+
* @returns Bound create document function.
|
|
83
83
|
*/
|
|
84
84
|
get createDocument(): import("@dereekb/zoho").ZohoSignCreateDocumentFunction;
|
|
85
85
|
/**
|
|
86
86
|
* Configured pass-through for {@link zohoSignUpdateDocument}.
|
|
87
87
|
*
|
|
88
|
-
* @returns
|
|
88
|
+
* @returns Bound update document function.
|
|
89
89
|
*/
|
|
90
90
|
get updateDocument(): import("@dereekb/zoho").ZohoSignUpdateDocumentFunction;
|
|
91
91
|
/**
|
|
92
92
|
* Configured pass-through for {@link zohoSignSendDocumentForSignature}.
|
|
93
93
|
*
|
|
94
|
-
* @returns
|
|
94
|
+
* @returns Bound send document for signature function.
|
|
95
95
|
*/
|
|
96
96
|
get sendDocumentForSignature(): import("@dereekb/zoho").ZohoSignSendDocumentForSignatureFunction;
|
|
97
97
|
/**
|
|
98
98
|
* Configured pass-through for {@link zohoSignExtendDocument}.
|
|
99
99
|
*
|
|
100
|
-
* @returns
|
|
100
|
+
* @returns Bound extend document function.
|
|
101
101
|
*/
|
|
102
102
|
get extendDocument(): import("@dereekb/zoho").ZohoSignExtendDocumentFunction;
|
|
103
103
|
/**
|
|
104
104
|
* Configured pass-through for {@link zohoSignDeleteDocument}.
|
|
105
105
|
*
|
|
106
|
-
* @returns
|
|
106
|
+
* @returns Bound delete document function.
|
|
107
107
|
*/
|
|
108
108
|
get deleteDocument(): import("@dereekb/zoho").ZohoSignDeleteDocumentFunction;
|
|
109
109
|
}
|
|
@@ -10,9 +10,9 @@ import { type Maybe } from '@dereekb/util';
|
|
|
10
10
|
* Resolves the API URL via environment variables following the naming convention
|
|
11
11
|
* `ZOHO_SIGN_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
12
12
|
*
|
|
13
|
-
* @param configService - NestJS config service populated with Zoho environment variables
|
|
14
|
-
* @returns Validated Zoho Sign service configuration
|
|
15
|
-
* @throws {Error} If required config values (e.g. API URL) are missing
|
|
13
|
+
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
14
|
+
* @returns Validated Zoho Sign service configuration.
|
|
15
|
+
* @throws {Error} If required config values (e.g. API URL) are missing.
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
@@ -29,8 +29,8 @@ export declare function zohoSignServiceConfigFactory(configService: ConfigServic
|
|
|
29
29
|
* Reads Zoho Accounts (OAuth) settings scoped to the Sign service from
|
|
30
30
|
* the NestJS ConfigService and returns an accounts service config.
|
|
31
31
|
*
|
|
32
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
33
|
-
* @returns Zoho Accounts service config scoped to the Sign service access token
|
|
32
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
33
|
+
* @returns Zoho Accounts service config scoped to the Sign service access token.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```typescript
|
|
@@ -69,14 +69,10 @@ export interface ProvideAppZohoSignMetadataConfig extends Pick<ModuleMetadata, '
|
|
|
69
69
|
* exports {@link ZohoSignApi} by default. Additional imports, exports, and providers
|
|
70
70
|
* from the config are merged in.
|
|
71
71
|
*
|
|
72
|
-
* @param config - Module configuration with optional dependency module and extra metadata
|
|
72
|
+
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
73
73
|
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
74
74
|
*
|
|
75
|
-
* @
|
|
76
|
-
* ```typescript
|
|
77
|
-
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
78
|
-
*
|
|
79
|
-
* @Module({
|
|
75
|
+
* @Module ({
|
|
80
76
|
* providers: [
|
|
81
77
|
* {
|
|
82
78
|
* provide: ZohoAccountsAccessTokenCacheService,
|
|
@@ -86,9 +82,12 @@ export interface ProvideAppZohoSignMetadataConfig extends Pick<ModuleMetadata, '
|
|
|
86
82
|
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
87
83
|
* })
|
|
88
84
|
* export class ZohoSignDependencyModule {}
|
|
89
|
-
*
|
|
90
|
-
* @Module(appZohoSignModuleMetadata({ dependencyModule: ZohoSignDependencyModule }))
|
|
85
|
+
* @Module (appZohoSignModuleMetadata({ dependencyModule: ZohoSignDependencyModule }))
|
|
91
86
|
* export class AppZohoSignModule {}
|
|
92
87
|
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
93
92
|
*/
|
|
94
93
|
export declare function appZohoSignModuleMetadata(config: ProvideAppZohoSignMetadataConfig): ModuleMetadata;
|
|
@@ -107,8 +107,8 @@ export type ZohoSignWebhookEvent<T extends ZohoSignWebhookOperationType = ZohoSi
|
|
|
107
107
|
/**
|
|
108
108
|
* Creates a {@link ZohoSignWebhookEvent} from a raw payload.
|
|
109
109
|
*
|
|
110
|
-
* @param payload -
|
|
111
|
-
* @returns
|
|
110
|
+
* @param payload - The raw Zoho Sign webhook payload to convert.
|
|
111
|
+
* @returns A webhook event with the operation type extracted for convenience.
|
|
112
112
|
*/
|
|
113
113
|
export declare function zohoSignWebhookEvent(payload: ZohoSignWebhookPayload): ZohoSignWebhookEvent;
|
|
114
114
|
export type ZohoSignEventHandler = Handler<ZohoSignWebhookEvent, ZohoSignWebhookOperationType>;
|
|
@@ -4,9 +4,9 @@ import { ConfigService } from '@nestjs/config';
|
|
|
4
4
|
* Reads the Zoho Sign webhook secret from the NestJS ConfigService
|
|
5
5
|
* and returns a validated webhook service config.
|
|
6
6
|
*
|
|
7
|
-
* @param configService - NestJS config service populated with webhook environment variables
|
|
8
|
-
* @returns Validated Zoho Sign webhook service configuration
|
|
9
|
-
* @throws {Error} If the webhook secret is not configured
|
|
7
|
+
* @param configService - NestJS config service populated with webhook environment variables.
|
|
8
|
+
* @returns Validated Zoho Sign webhook service configuration.
|
|
9
|
+
* @throws {Error} If the webhook secret is not configured.
|
|
10
10
|
*/
|
|
11
11
|
export declare function zohoSignWebhookServiceConfigFactory(configService: ConfigService): ZohoSignWebhookServiceConfig;
|
|
12
12
|
export declare class ZohoSignWebhookModule {
|
|
@@ -29,8 +29,8 @@ export type ZohoSignWebhookEventVerifier = (req: Request, rawBody: Buffer) => Pr
|
|
|
29
29
|
* in the `X-ZS-WEBHOOK-SIGNATURE` header. This verifier recomputes the signature
|
|
30
30
|
* from the raw request body and compares using timing-safe equality.
|
|
31
31
|
*
|
|
32
|
-
* @param config - Configuration containing the webhook secret key
|
|
33
|
-
* @returns
|
|
32
|
+
* @param config - Configuration containing the webhook secret key.
|
|
33
|
+
* @returns Verifies webhook requests.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```typescript
|
|
@@ -46,6 +46,7 @@ export declare function readZohoConfigFromConfigService(configService: ConfigSer
|
|
|
46
46
|
/**
|
|
47
47
|
* Asserts that the provided ZohoConfig has a valid API URL configured.
|
|
48
48
|
*
|
|
49
|
-
* @param config -
|
|
49
|
+
* @param config - The Zoho config to validate.
|
|
50
|
+
* @throws {Error} When `config.apiUrl` is missing.
|
|
50
51
|
*/
|
|
51
52
|
export declare function assertValidZohoConfig(config: ZohoConfig): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/zoho",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"bin": {
|
|
5
5
|
"zoho-cli": "cli/index.js"
|
|
6
6
|
},
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@dereekb/date": "13.11.
|
|
27
|
-
"@dereekb/dbx-cli": "13.11.
|
|
28
|
-
"@dereekb/firebase": "13.11.
|
|
29
|
-
"@dereekb/model": "13.11.
|
|
30
|
-
"@dereekb/nestjs": "13.11.
|
|
31
|
-
"@dereekb/rxjs": "13.11.
|
|
32
|
-
"@dereekb/util": "13.11.
|
|
26
|
+
"@dereekb/date": "13.11.15",
|
|
27
|
+
"@dereekb/dbx-cli": "13.11.15",
|
|
28
|
+
"@dereekb/firebase": "13.11.15",
|
|
29
|
+
"@dereekb/model": "13.11.15",
|
|
30
|
+
"@dereekb/nestjs": "13.11.15",
|
|
31
|
+
"@dereekb/rxjs": "13.11.15",
|
|
32
|
+
"@dereekb/util": "13.11.15",
|
|
33
33
|
"@nestjs/common": "^11.1.19",
|
|
34
34
|
"@nestjs/config": "^4.0.4",
|
|
35
35
|
"express": "^5.2.1",
|
|
@@ -60,8 +60,10 @@ export interface ZohoAccountsAccessTokenErrorResponse {
|
|
|
60
60
|
* The returned function accepts optional overrides for client credentials and refresh token.
|
|
61
61
|
* When omitted, values are read from the {@link ZohoAccountsContext}'s config.
|
|
62
62
|
*
|
|
63
|
-
* @param context - Authenticated Zoho Accounts context providing fetch and config
|
|
64
|
-
* @returns Function that exchanges a refresh token for an access token
|
|
63
|
+
* @param context - Authenticated Zoho Accounts context providing fetch and config.
|
|
64
|
+
* @returns Function that exchanges a refresh token for an access token.
|
|
65
|
+
*
|
|
66
|
+
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token-expiry.html
|
|
65
67
|
*
|
|
66
68
|
* @example
|
|
67
69
|
* ```typescript
|
|
@@ -76,8 +78,6 @@ export interface ZohoAccountsAccessTokenErrorResponse {
|
|
|
76
78
|
* refreshToken: 'other-refresh-token'
|
|
77
79
|
* });
|
|
78
80
|
* ```
|
|
79
|
-
*
|
|
80
|
-
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token-expiry.html
|
|
81
81
|
*/
|
|
82
82
|
export declare function zohoAccountsAccessToken(context: ZohoAccountsContext): (input?: ZohoAccountsAccessTokenInput) => Promise<ZohoAccountsAccessTokenResponse>;
|
|
83
83
|
/**
|
|
@@ -152,7 +152,9 @@ export type ZohoAccountsRefreshTokenFromAuthorizationCodeFunction = (input: Zoho
|
|
|
152
152
|
* the initial authorization request.
|
|
153
153
|
*
|
|
154
154
|
* @param context - Zoho Accounts context providing fetch and config (clientId/clientSecret)
|
|
155
|
-
* @returns Function that exchanges an authorization code for tokens
|
|
155
|
+
* @returns Function that exchanges an authorization code for tokens.
|
|
156
|
+
*
|
|
157
|
+
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token.html
|
|
156
158
|
*
|
|
157
159
|
* @example
|
|
158
160
|
* ```typescript
|
|
@@ -163,15 +165,13 @@ export type ZohoAccountsRefreshTokenFromAuthorizationCodeFunction = (input: Zoho
|
|
|
163
165
|
* redirectUri: 'https://myapp.example.com/oauth/callback'
|
|
164
166
|
* });
|
|
165
167
|
* ```
|
|
166
|
-
*
|
|
167
|
-
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token.html
|
|
168
168
|
*/
|
|
169
169
|
export declare function zohoAccountsRefreshTokenFromAuthorizationCode(context: ZohoAccountsContext): ZohoAccountsRefreshTokenFromAuthorizationCodeFunction;
|
|
170
170
|
/**
|
|
171
171
|
* Constructs a standard {@link FetchJsonInput} for Zoho Accounts API calls with the given HTTP method and optional body.
|
|
172
172
|
*
|
|
173
|
-
* @param method - HTTP method to use for the request
|
|
174
|
-
* @param body - Optional request body to include
|
|
175
|
-
* @returns Configured fetch input for the Zoho Accounts API call
|
|
173
|
+
* @param method - HTTP method to use for the request.
|
|
174
|
+
* @param body - Optional request body to include.
|
|
175
|
+
* @returns Configured fetch input for the Zoho Accounts API call.
|
|
176
176
|
*/
|
|
177
177
|
export declare function zohoAccountsApiFetchJsonInput(method: string, body?: FetchJsonBody): FetchJsonInput;
|
|
@@ -19,8 +19,8 @@ export type ZohoAccountsConfigApiUrlInput = ZohoAccountsApiUrlKey | ZohoAccounts
|
|
|
19
19
|
/**
|
|
20
20
|
* Resolves a Zoho Accounts API URL input to the full base URL. The 'us' key maps to the US datacenter; custom URLs pass through unchanged.
|
|
21
21
|
*
|
|
22
|
-
* @param input - A well-known datacenter key or a custom Zoho Accounts API URL
|
|
23
|
-
* @returns The resolved full Zoho Accounts API base URL
|
|
22
|
+
* @param input - A well-known datacenter key or a custom Zoho Accounts API URL.
|
|
23
|
+
* @returns The resolved full Zoho Accounts API base URL.
|
|
24
24
|
*/
|
|
25
25
|
export declare function zohoAccountsConfigApiUrl(input: ZohoAccountsConfigApiUrlInput): ZohoApiUrl;
|
|
26
26
|
/**
|
|
@@ -81,8 +81,9 @@ export type ZohoAccessTokenStringFactory = () => Promise<ZohoAccessTokenString>;
|
|
|
81
81
|
/**
|
|
82
82
|
* Generates a new ZohoAccessTokenStringFactory.
|
|
83
83
|
*
|
|
84
|
-
* @param zohoAccessTokenFactory - Factory that produces ZohoAccessToken instances
|
|
85
|
-
* @returns A factory function that resolves to the access token string
|
|
84
|
+
* @param zohoAccessTokenFactory - Factory that produces ZohoAccessToken instances.
|
|
85
|
+
* @returns A factory function that resolves to the access token string.
|
|
86
|
+
*
|
|
86
87
|
* @__NO_SIDE_EFFECTS__
|
|
87
88
|
*/
|
|
88
89
|
export declare function zohoAccessTokenStringFactory(zohoAccessTokenFactory: ZohoAccessTokenFactory): ZohoAccessTokenStringFactory;
|
|
@@ -25,16 +25,16 @@ export declare const logZohoAccountsErrorToConsole: import("..").LogZohoServerEr
|
|
|
25
25
|
/**
|
|
26
26
|
* Parses a fetch response error into a typed Zoho Accounts server error by extracting and interpreting the JSON error body.
|
|
27
27
|
*
|
|
28
|
-
* @param responseError - The fetch response error to parse
|
|
29
|
-
* @returns The parsed Zoho server error, or undefined if the response could not be parsed
|
|
28
|
+
* @param responseError - The fetch response error to parse.
|
|
29
|
+
* @returns The parsed Zoho server error, or undefined if the response could not be parsed.
|
|
30
30
|
*/
|
|
31
31
|
export declare function parseZohoAccountsError(responseError: FetchResponseError): Promise<ParsedZohoServerError>;
|
|
32
32
|
/**
|
|
33
33
|
* Parses a Zoho Accounts error response body into a typed error. Handles account-specific error codes before falling back to the generic Zoho error parser.
|
|
34
34
|
*
|
|
35
|
-
* @param errorResponseData - The raw error response data from the Zoho Accounts API
|
|
36
|
-
* @param responseError - The original fetch response error for context
|
|
37
|
-
* @returns The parsed Zoho server error, or undefined if the error could not be classified
|
|
35
|
+
* @param errorResponseData - The raw error response data from the Zoho Accounts API.
|
|
36
|
+
* @param responseError - The original fetch response error for context.
|
|
37
|
+
* @returns The parsed Zoho server error, or undefined if the error could not be classified.
|
|
38
38
|
*/
|
|
39
39
|
export declare function parseZohoAccountsServerErrorResponseData(errorResponseData: ZohoServerErrorResponseData, responseError: FetchResponseError): ParsedZohoServerError;
|
|
40
40
|
export declare const interceptZohoAccounts200StatusWithErrorResponse: import("@dereekb/util/fetch").FetchJsonInterceptJsonResponseFunction;
|
|
@@ -37,9 +37,9 @@ export type ZohoAccountsFactory = (config: ZohoAccountsConfig) => ZohoAccounts;
|
|
|
37
37
|
* The Accounts client is the foundation for CRM, Recruit, and Sign clients, as it provides
|
|
38
38
|
* the {@link ZohoAccountsContext} needed for OAuth token management.
|
|
39
39
|
*
|
|
40
|
-
* @param factoryConfig - Configuration providing optional fetch and logging overrides
|
|
41
|
-
* @returns A factory function that creates authenticated Zoho Accounts clients
|
|
42
|
-
* @throws {Error} If `refreshToken`, `clientId`, or `clientSecret` are missing from the config
|
|
40
|
+
* @param factoryConfig - Configuration providing optional fetch and logging overrides.
|
|
41
|
+
* @returns A factory function that creates authenticated Zoho Accounts clients.
|
|
42
|
+
* @throws {Error} If `refreshToken`, `clientId`, or `clientSecret` are missing from the config.
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```typescript
|
|
@@ -57,6 +57,7 @@ export type ZohoAccountsFactory = (config: ZohoAccountsConfig) => ZohoAccounts;
|
|
|
57
57
|
* accountsContext: zohoAccounts.accountsContext
|
|
58
58
|
* });
|
|
59
59
|
* ```
|
|
60
|
+
*
|
|
60
61
|
* @__NO_SIDE_EFFECTS__
|
|
61
62
|
*/
|
|
62
63
|
export declare function zohoAccountsFactory(factoryConfig: ZohoAccountsFactoryConfig): ZohoAccountsFactory;
|
|
@@ -95,9 +96,10 @@ export interface ZohoAccountsZohoAccessTokenFactoryConfig {
|
|
|
95
96
|
* The returned function also exposes a `resetAccessToken()` method to invalidate
|
|
96
97
|
* the current cached token, typically called on {@link ZohoInvalidTokenError}.
|
|
97
98
|
*
|
|
98
|
-
* @param config - Token refresh, caching, and expiration buffer configuration
|
|
99
|
-
* @returns A token factory function with `resetAccessToken` for cache invalidation
|
|
100
|
-
* @throws {ZohoAccountsAuthFailureError} If the token refresher fails
|
|
99
|
+
* @param config - Token refresh, caching, and expiration buffer configuration.
|
|
100
|
+
* @returns A token factory function with `resetAccessToken` for cache invalidation.
|
|
101
|
+
* @throws {ZohoAccountsAuthFailureError} If the token refresher fails.
|
|
102
|
+
*
|
|
101
103
|
* @__NO_SIDE_EFFECTS__
|
|
102
104
|
*/
|
|
103
105
|
export declare function zohoAccountsZohoAccessTokenFactory(config: ZohoAccountsZohoAccessTokenFactoryConfig): ZohoAccessTokenFactory;
|