@dereekb/zoho 13.8.0 → 13.10.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/cli/LICENSE +21 -0
- package/cli/index.js +8 -0
- package/cli/package.json +20 -0
- package/index.cjs.js +2537 -228
- package/index.esm.js +2474 -229
- package/nestjs/index.cjs.js +852 -191
- package/nestjs/index.esm.js +849 -193
- package/nestjs/package.json +5 -5
- package/nestjs/src/lib/desk/desk.api.d.ts +213 -0
- package/nestjs/src/lib/desk/desk.config.d.ts +27 -0
- package/nestjs/src/lib/desk/desk.module.d.ts +62 -0
- package/nestjs/src/lib/desk/index.d.ts +3 -0
- package/nestjs/src/lib/index.d.ts +1 -0
- package/package.json +12 -5
- package/src/lib/desk/desk.agent.d.ts +45 -0
- package/src/lib/desk/desk.api.activities.d.ts +43 -0
- package/src/lib/desk/desk.api.agents.d.ts +91 -0
- package/src/lib/desk/desk.api.attachments.d.ts +47 -0
- package/src/lib/desk/desk.api.comments.d.ts +86 -0
- package/src/lib/desk/desk.api.contacts.d.ts +81 -0
- package/src/lib/desk/desk.api.departments.d.ts +47 -0
- package/src/lib/desk/desk.api.followers.d.ts +57 -0
- package/src/lib/desk/desk.api.page.d.ts +72 -0
- package/src/lib/desk/desk.api.tags.d.ts +102 -0
- package/src/lib/desk/desk.api.threads.d.ts +60 -0
- package/src/lib/desk/desk.api.tickets.d.ts +227 -0
- package/src/lib/desk/desk.api.time.d.ts +109 -0
- package/src/lib/desk/desk.config.d.ts +75 -0
- package/src/lib/desk/desk.contact.d.ts +50 -0
- package/src/lib/desk/desk.d.ts +44 -0
- package/src/lib/desk/desk.department.d.ts +27 -0
- package/src/lib/desk/desk.error.api.d.ts +33 -0
- package/src/lib/desk/desk.factory.d.ts +47 -0
- package/src/lib/desk/desk.limit.d.ts +39 -0
- package/src/lib/desk/desk.ticket.d.ts +308 -0
- package/src/lib/desk/index.d.ts +21 -0
- package/src/lib/index.d.ts +1 -0
- package/src/lib/zoho.limit.d.ts +66 -10
package/nestjs/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/zoho/nestjs",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/nestjs": "13.
|
|
6
|
-
"@dereekb/rxjs": "13.
|
|
7
|
-
"@dereekb/util": "13.
|
|
8
|
-
"@dereekb/zoho": "13.
|
|
5
|
+
"@dereekb/nestjs": "13.10.0",
|
|
6
|
+
"@dereekb/rxjs": "13.10.0",
|
|
7
|
+
"@dereekb/util": "13.10.0",
|
|
8
|
+
"@dereekb/zoho": "13.10.0",
|
|
9
9
|
"@nestjs/common": "^11.1.17",
|
|
10
10
|
"@nestjs/config": "^4.0.4",
|
|
11
11
|
"express": "^5.0.0"
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { type ZohoDesk, type ZohoDeskContext } from '@dereekb/zoho';
|
|
2
|
+
import { ZohoDeskServiceConfig } from './desk.config';
|
|
3
|
+
import { ZohoAccountsApi } from '../accounts/accounts.api';
|
|
4
|
+
/**
|
|
5
|
+
* NestJS injectable service that wraps the Zoho Desk API.
|
|
6
|
+
*
|
|
7
|
+
* Provides convenient accessor getters for all Desk operations (tickets, departments, contacts),
|
|
8
|
+
* each bound to the authenticated Desk context created during construction.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ZohoDeskApi {
|
|
11
|
+
readonly config: ZohoDeskServiceConfig;
|
|
12
|
+
readonly zohoAccountsApi: ZohoAccountsApi;
|
|
13
|
+
/**
|
|
14
|
+
* Underlying Zoho Desk client instance, initialized from the injected config and accounts context.
|
|
15
|
+
*/
|
|
16
|
+
readonly zohoDesk: ZohoDesk;
|
|
17
|
+
/**
|
|
18
|
+
* The authenticated Desk context used by all operation accessors.
|
|
19
|
+
*
|
|
20
|
+
* @returns the Desk context from the underlying client
|
|
21
|
+
*/
|
|
22
|
+
get deskContext(): ZohoDeskContext;
|
|
23
|
+
/**
|
|
24
|
+
* Rate limiter shared across all Desk requests to respect Zoho API quotas.
|
|
25
|
+
*
|
|
26
|
+
* @returns the shared rate limiter instance
|
|
27
|
+
*/
|
|
28
|
+
get zohoRateLimiter(): import("@dereekb/util").ResetPeriodPromiseRateLimiter;
|
|
29
|
+
/**
|
|
30
|
+
* Initializes the Desk client by combining the service config with the
|
|
31
|
+
* accounts context for OAuth token management.
|
|
32
|
+
*
|
|
33
|
+
* @param config - Zoho Desk service configuration
|
|
34
|
+
* @param zohoAccountsApi - accounts API used for OAuth token management
|
|
35
|
+
*/
|
|
36
|
+
constructor(config: ZohoDeskServiceConfig, zohoAccountsApi: ZohoAccountsApi);
|
|
37
|
+
/**
|
|
38
|
+
* Configured pass-through for {@link zohoDeskGetTickets}.
|
|
39
|
+
*/
|
|
40
|
+
get getTickets(): import("@dereekb/zoho").ZohoDeskGetTicketsFunction;
|
|
41
|
+
/**
|
|
42
|
+
* Configured pass-through for {@link zohoDeskGetTicketById}.
|
|
43
|
+
*/
|
|
44
|
+
get getTicketById(): import("@dereekb/zoho").ZohoDeskGetTicketByIdFunction;
|
|
45
|
+
/**
|
|
46
|
+
* Configured pass-through for {@link zohoDeskSearchTickets}.
|
|
47
|
+
*/
|
|
48
|
+
get searchTickets(): import("@dereekb/zoho").ZohoDeskSearchTicketsFunction;
|
|
49
|
+
/**
|
|
50
|
+
* Configured pass-through for {@link zohoDeskGetTicketsForContact}.
|
|
51
|
+
*/
|
|
52
|
+
get getTicketsForContact(): import("@dereekb/zoho").ZohoDeskGetTicketsForContactFunction;
|
|
53
|
+
/**
|
|
54
|
+
* Configured pass-through for {@link zohoDeskGetTicketsForProduct}.
|
|
55
|
+
*/
|
|
56
|
+
get getTicketsForProduct(): import("@dereekb/zoho").ZohoDeskGetTicketsForProductFunction;
|
|
57
|
+
/**
|
|
58
|
+
* Configured pass-through for {@link zohoDeskGetTicketMetrics}.
|
|
59
|
+
*/
|
|
60
|
+
get getTicketMetrics(): import("@dereekb/zoho").ZohoDeskGetTicketMetricsFunction;
|
|
61
|
+
/**
|
|
62
|
+
* Configured pass-through for {@link zohoDeskGetAgentsTicketsCount}.
|
|
63
|
+
*/
|
|
64
|
+
get getAgentsTicketsCount(): import("@dereekb/zoho").ZohoDeskGetAgentsTicketsCountFunction;
|
|
65
|
+
/**
|
|
66
|
+
* Configured pass-through for {@link zohoDeskGetTicketsPageFactory}.
|
|
67
|
+
*/
|
|
68
|
+
get getTicketsPageFactory(): import("@dereekb/zoho").ZohoDeskGetTicketsPageFactory;
|
|
69
|
+
/**
|
|
70
|
+
* Configured pass-through for {@link zohoDeskSearchTicketsPageFactory}.
|
|
71
|
+
*/
|
|
72
|
+
get searchTicketsPageFactory(): import("@dereekb/zoho").ZohoDeskSearchTicketsPageFactory;
|
|
73
|
+
/**
|
|
74
|
+
* Configured pass-through for {@link zohoDeskGetDepartments}.
|
|
75
|
+
*/
|
|
76
|
+
get getDepartments(): import("@dereekb/zoho").ZohoDeskGetDepartmentsFunction;
|
|
77
|
+
/**
|
|
78
|
+
* Configured pass-through for {@link zohoDeskGetDepartmentById}.
|
|
79
|
+
*/
|
|
80
|
+
get getDepartmentById(): import("@dereekb/zoho").ZohoDeskGetDepartmentByIdFunction;
|
|
81
|
+
/**
|
|
82
|
+
* Configured pass-through for {@link zohoDeskGetContacts}.
|
|
83
|
+
*/
|
|
84
|
+
get getContacts(): import("@dereekb/zoho").ZohoDeskGetContactsFunction;
|
|
85
|
+
/**
|
|
86
|
+
* Configured pass-through for {@link zohoDeskGetContactById}.
|
|
87
|
+
*/
|
|
88
|
+
get getContactById(): import("@dereekb/zoho").ZohoDeskGetContactByIdFunction;
|
|
89
|
+
/**
|
|
90
|
+
* Configured pass-through for {@link zohoDeskGetContactsByIds}.
|
|
91
|
+
*/
|
|
92
|
+
get getContactsByIds(): import("@dereekb/zoho").ZohoDeskGetContactsByIdsFunction;
|
|
93
|
+
/**
|
|
94
|
+
* Configured pass-through for {@link zohoDeskGetContactsPageFactory}.
|
|
95
|
+
*/
|
|
96
|
+
get getContactsPageFactory(): import("@dereekb/zoho").ZohoDeskGetContactsPageFactory;
|
|
97
|
+
/**
|
|
98
|
+
* Configured pass-through for {@link zohoDeskGetTicketTags}.
|
|
99
|
+
*/
|
|
100
|
+
get getTicketTags(): import("@dereekb/zoho").ZohoDeskGetTicketTagsFunction;
|
|
101
|
+
/**
|
|
102
|
+
* Configured pass-through for {@link zohoDeskAssociateTicketTags}.
|
|
103
|
+
*/
|
|
104
|
+
get associateTicketTags(): import("@dereekb/zoho").ZohoDeskAssociateTicketTagsFunction;
|
|
105
|
+
/**
|
|
106
|
+
* Configured pass-through for {@link zohoDeskDissociateTicketTag}.
|
|
107
|
+
*/
|
|
108
|
+
get dissociateTicketTag(): import("@dereekb/zoho").ZohoDeskDissociateTicketTagFunction;
|
|
109
|
+
/**
|
|
110
|
+
* Configured pass-through for {@link zohoDeskSearchTags}.
|
|
111
|
+
*/
|
|
112
|
+
get searchTags(): import("@dereekb/zoho").ZohoDeskSearchTagsFunction;
|
|
113
|
+
/**
|
|
114
|
+
* Configured pass-through for {@link zohoDeskGetAllTags}.
|
|
115
|
+
*/
|
|
116
|
+
get getAllTags(): import("@dereekb/zoho").ZohoDeskGetAllTagsFunction;
|
|
117
|
+
/**
|
|
118
|
+
* Configured pass-through for {@link zohoDeskGetTicketFollowers}.
|
|
119
|
+
*/
|
|
120
|
+
get getTicketFollowers(): import("@dereekb/zoho").ZohoDeskGetTicketFollowersFunction;
|
|
121
|
+
/**
|
|
122
|
+
* Configured pass-through for {@link zohoDeskAddTicketFollowers}.
|
|
123
|
+
*/
|
|
124
|
+
get addTicketFollowers(): import("@dereekb/zoho").ZohoDeskAddTicketFollowersFunction;
|
|
125
|
+
/**
|
|
126
|
+
* Configured pass-through for {@link zohoDeskRemoveTicketFollowers}.
|
|
127
|
+
*/
|
|
128
|
+
get removeTicketFollowers(): import("@dereekb/zoho").ZohoDeskRemoveTicketFollowersFunction;
|
|
129
|
+
/**
|
|
130
|
+
* Configured pass-through for {@link zohoDeskGetTicketAttachments}.
|
|
131
|
+
*/
|
|
132
|
+
get getTicketAttachments(): import("@dereekb/zoho").ZohoDeskGetTicketAttachmentsFunction;
|
|
133
|
+
/**
|
|
134
|
+
* Configured pass-through for {@link zohoDeskDeleteTicketAttachment}.
|
|
135
|
+
*/
|
|
136
|
+
get deleteTicketAttachment(): import("@dereekb/zoho").ZohoDeskDeleteTicketAttachmentFunction;
|
|
137
|
+
/**
|
|
138
|
+
* Configured pass-through for {@link zohoDeskGetTicketComments}.
|
|
139
|
+
*/
|
|
140
|
+
get getTicketComments(): import("@dereekb/zoho").ZohoDeskGetTicketCommentsFunction;
|
|
141
|
+
/**
|
|
142
|
+
* Configured pass-through for {@link zohoDeskGetTicketCommentById}.
|
|
143
|
+
*/
|
|
144
|
+
get getTicketCommentById(): import("@dereekb/zoho").ZohoDeskGetTicketCommentByIdFunction;
|
|
145
|
+
/**
|
|
146
|
+
* Configured pass-through for {@link zohoDeskCreateTicketComment}.
|
|
147
|
+
*/
|
|
148
|
+
get createTicketComment(): import("@dereekb/zoho").ZohoDeskCreateTicketCommentFunction;
|
|
149
|
+
/**
|
|
150
|
+
* Configured pass-through for {@link zohoDeskDeleteTicketComment}.
|
|
151
|
+
*/
|
|
152
|
+
get deleteTicketComment(): import("@dereekb/zoho").ZohoDeskDeleteTicketCommentFunction;
|
|
153
|
+
/**
|
|
154
|
+
* Configured pass-through for {@link zohoDeskGetTicketTimer}.
|
|
155
|
+
*/
|
|
156
|
+
get getTicketTimer(): import("@dereekb/zoho").ZohoDeskGetTicketTimerFunction;
|
|
157
|
+
/**
|
|
158
|
+
* Configured pass-through for {@link zohoDeskPerformTicketTimerAction}.
|
|
159
|
+
*/
|
|
160
|
+
get performTicketTimerAction(): import("@dereekb/zoho").ZohoDeskPerformTicketTimerActionFunction;
|
|
161
|
+
/**
|
|
162
|
+
* Configured pass-through for {@link zohoDeskGetTicketTimeEntries}.
|
|
163
|
+
*/
|
|
164
|
+
get getTicketTimeEntries(): import("@dereekb/zoho").ZohoDeskGetTicketTimeEntriesFunction;
|
|
165
|
+
/**
|
|
166
|
+
* Configured pass-through for {@link zohoDeskGetTicketTimeEntryById}.
|
|
167
|
+
*/
|
|
168
|
+
get getTicketTimeEntryById(): import("@dereekb/zoho").ZohoDeskGetTicketTimeEntryByIdFunction;
|
|
169
|
+
/**
|
|
170
|
+
* Configured pass-through for {@link zohoDeskGetTicketTimeEntrySummation}.
|
|
171
|
+
*/
|
|
172
|
+
get getTicketTimeEntrySummation(): import("@dereekb/zoho").ZohoDeskGetTicketTimeEntrySummationFunction;
|
|
173
|
+
/**
|
|
174
|
+
* Configured pass-through for {@link zohoDeskGetTicketThreads}.
|
|
175
|
+
*/
|
|
176
|
+
get getTicketThreads(): import("@dereekb/zoho").ZohoDeskGetTicketThreadsFunction;
|
|
177
|
+
/**
|
|
178
|
+
* Configured pass-through for {@link zohoDeskGetTicketThreadById}.
|
|
179
|
+
*/
|
|
180
|
+
get getTicketThreadById(): import("@dereekb/zoho").ZohoDeskGetTicketThreadByIdFunction;
|
|
181
|
+
/**
|
|
182
|
+
* Configured pass-through for {@link zohoDeskGetTicketThreadsPageFactory}.
|
|
183
|
+
*/
|
|
184
|
+
get getTicketThreadsPageFactory(): import("@dereekb/zoho").ZohoDeskGetTicketThreadsPageFactory;
|
|
185
|
+
/**
|
|
186
|
+
* Configured pass-through for {@link zohoDeskGetTicketActivities}.
|
|
187
|
+
*/
|
|
188
|
+
get getTicketActivities(): import("@dereekb/zoho").ZohoDeskGetTicketActivitiesFunction;
|
|
189
|
+
/**
|
|
190
|
+
* Configured pass-through for {@link zohoDeskGetTicketActivitiesPageFactory}.
|
|
191
|
+
*/
|
|
192
|
+
get getTicketActivitiesPageFactory(): import("@dereekb/zoho").ZohoDeskGetTicketActivitiesPageFactory;
|
|
193
|
+
/**
|
|
194
|
+
* Configured pass-through for {@link zohoDeskGetAgents}.
|
|
195
|
+
*/
|
|
196
|
+
get getAgents(): import("@dereekb/zoho").ZohoDeskGetAgentsFunction;
|
|
197
|
+
/**
|
|
198
|
+
* Configured pass-through for {@link zohoDeskGetAgentById}.
|
|
199
|
+
*/
|
|
200
|
+
get getAgentById(): import("@dereekb/zoho").ZohoDeskGetAgentByIdFunction;
|
|
201
|
+
/**
|
|
202
|
+
* Configured pass-through for {@link zohoDeskGetAgentsByIds}.
|
|
203
|
+
*/
|
|
204
|
+
get getAgentsByIds(): import("@dereekb/zoho").ZohoDeskGetAgentsByIdsFunction;
|
|
205
|
+
/**
|
|
206
|
+
* Configured pass-through for {@link zohoDeskGetMyInfo}.
|
|
207
|
+
*/
|
|
208
|
+
get getMyInfo(): import("@dereekb/zoho").ZohoDeskGetMyInfoFunction;
|
|
209
|
+
/**
|
|
210
|
+
* Configured pass-through for {@link zohoDeskGetAgentsPageFactory}.
|
|
211
|
+
*/
|
|
212
|
+
get getAgentsPageFactory(): import("@dereekb/zoho").ZohoDeskGetAgentsPageFactory;
|
|
213
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ZohoDeskConfig, type ZohoDeskFactoryConfig } from '@dereekb/zoho';
|
|
2
|
+
/**
|
|
3
|
+
* API configuration for connecting to the Zoho Desk service endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export type ZohoDeskServiceApiConfig = ZohoDeskConfig;
|
|
6
|
+
/**
|
|
7
|
+
* Abstract configuration class for the NestJS Zoho Desk service.
|
|
8
|
+
*
|
|
9
|
+
* Used as a DI token so that applications can provide their own config values
|
|
10
|
+
* while keeping the expected shape consistent.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class ZohoDeskServiceConfig {
|
|
13
|
+
/**
|
|
14
|
+
* Zoho Desk API connection settings (endpoint URL, org ID, etc.).
|
|
15
|
+
*/
|
|
16
|
+
readonly zohoDesk: ZohoDeskServiceApiConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Optional factory-level overrides applied when creating the underlying Desk client.
|
|
19
|
+
*/
|
|
20
|
+
readonly factoryConfig?: ZohoDeskFactoryConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Validates that the required Zoho Desk connection fields are present and well-formed.
|
|
23
|
+
*
|
|
24
|
+
* @param config - the Desk service config to validate
|
|
25
|
+
*/
|
|
26
|
+
static assertValidConfig(config: ZohoDeskServiceConfig): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { ConfigService } from '@nestjs/config';
|
|
3
|
+
import { ZohoDeskServiceConfig } from './desk.config';
|
|
4
|
+
import { ZohoAccountsServiceConfig } from '../accounts/accounts.config';
|
|
5
|
+
import { type Maybe } from '@dereekb/util';
|
|
6
|
+
/**
|
|
7
|
+
* Config key suffix for the Zoho Desk organization ID.
|
|
8
|
+
* Resolves to `ZOHO_DESK_ORG_ID` or `ZOHO_ORG_ID`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ZOHO_ORG_ID_CONFIG_KEY = "ORG_ID";
|
|
11
|
+
/**
|
|
12
|
+
* Reads Zoho Desk connection settings from the NestJS ConfigService
|
|
13
|
+
* and returns a validated service config.
|
|
14
|
+
*
|
|
15
|
+
* Resolves the API URL via environment variables following the naming convention
|
|
16
|
+
* `ZOHO_DESK_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
17
|
+
* The organization ID is read from `ZOHO_DESK_ORG_ID` or `ZOHO_ORG_ID`.
|
|
18
|
+
*
|
|
19
|
+
* @param configService - NestJS config service populated with Zoho environment variables
|
|
20
|
+
* @returns Validated Zoho Desk service configuration
|
|
21
|
+
* @throws {Error} If required config values (API URL or orgId) are missing
|
|
22
|
+
*/
|
|
23
|
+
export declare function zohoDeskServiceConfigFactory(configService: ConfigService): ZohoDeskServiceConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Reads Zoho Accounts (OAuth) settings scoped to the Desk service from
|
|
26
|
+
* the NestJS ConfigService and returns an accounts service config.
|
|
27
|
+
*
|
|
28
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
29
|
+
* @returns Zoho Accounts service config scoped to the Desk service access token
|
|
30
|
+
*/
|
|
31
|
+
export declare function zohoDeskAccountServiceConfigFactory(configService: ConfigService): ZohoAccountsServiceConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Configuration for generating the application-level Zoho Desk NestJS module metadata.
|
|
34
|
+
*
|
|
35
|
+
* Extends standard NestJS {@link ModuleMetadata} fields (`imports`, `exports`, `providers`)
|
|
36
|
+
* so additional providers or modules can be merged into the generated metadata.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProvideAppZohoDeskMetadataConfig extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> {
|
|
39
|
+
/**
|
|
40
|
+
* Module that exports the required dependencies for this module.
|
|
41
|
+
* When provided, this module is automatically included in the generated `imports` array.
|
|
42
|
+
*/
|
|
43
|
+
readonly dependencyModule?: Maybe<Required<ModuleMetadata>['imports']['0']>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Desk stack
|
|
47
|
+
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
48
|
+
*
|
|
49
|
+
* The generated module requires the following dependencies in order to initialize properly:
|
|
50
|
+
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
51
|
+
*
|
|
52
|
+
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
53
|
+
*
|
|
54
|
+
* The returned metadata registers {@link ZohoDeskServiceConfig}, {@link ZohoDeskApi},
|
|
55
|
+
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
56
|
+
* exports {@link ZohoDeskApi} by default. Additional imports, exports, and providers
|
|
57
|
+
* from the config are merged in.
|
|
58
|
+
*
|
|
59
|
+
* @param config - Module configuration with optional dependency module and extra metadata
|
|
60
|
+
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
61
|
+
*/
|
|
62
|
+
export declare function appZohoDeskModuleMetadata(config: ProvideAppZohoDeskMetadataConfig): ModuleMetadata;
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/zoho",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.10.0",
|
|
4
|
+
"bin": {
|
|
5
|
+
"zoho-cli": "./cli/index.js"
|
|
6
|
+
},
|
|
4
7
|
"exports": {
|
|
5
8
|
"./nestjs": {
|
|
6
9
|
"module": "./nestjs/index.esm.js",
|
|
@@ -8,6 +11,9 @@
|
|
|
8
11
|
"import": "./nestjs/index.cjs.mjs",
|
|
9
12
|
"default": "./nestjs/index.cjs.js"
|
|
10
13
|
},
|
|
14
|
+
"./cli": {
|
|
15
|
+
"default": "./cli/index.js"
|
|
16
|
+
},
|
|
11
17
|
"./package.json": "./package.json",
|
|
12
18
|
".": {
|
|
13
19
|
"module": "./index.esm.js",
|
|
@@ -17,13 +23,14 @@
|
|
|
17
23
|
}
|
|
18
24
|
},
|
|
19
25
|
"peerDependencies": {
|
|
20
|
-
"@dereekb/nestjs": "13.
|
|
21
|
-
"@dereekb/rxjs": "13.
|
|
22
|
-
"@dereekb/util": "13.
|
|
26
|
+
"@dereekb/nestjs": "13.10.0",
|
|
27
|
+
"@dereekb/rxjs": "13.10.0",
|
|
28
|
+
"@dereekb/util": "13.10.0",
|
|
23
29
|
"@nestjs/common": "^11.1.17",
|
|
24
30
|
"@nestjs/config": "^4.0.4",
|
|
25
31
|
"express": "^5.0.0",
|
|
26
|
-
"make-error": "^1.3.0"
|
|
32
|
+
"make-error": "^1.3.0",
|
|
33
|
+
"yargs": "^18.0.0"
|
|
27
34
|
},
|
|
28
35
|
"devDependencies": {
|
|
29
36
|
"@nestjs/testing": "^11.1.14",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Maybe } from '@dereekb/util';
|
|
2
|
+
import { type ZohoDeskAgentId } from './desk';
|
|
3
|
+
/**
|
|
4
|
+
* Agent status in Zoho Desk.
|
|
5
|
+
*/
|
|
6
|
+
export type ZohoDeskAgentStatus = 'ACTIVE' | 'DISABLED';
|
|
7
|
+
/**
|
|
8
|
+
* Agent role permission type in Zoho Desk.
|
|
9
|
+
*/
|
|
10
|
+
export type ZohoDeskAgentRolePermissionType = 'Light' | 'AgentPublic' | 'Custom' | 'AgentPersonal' | 'Admin' | string;
|
|
11
|
+
/**
|
|
12
|
+
* Related entities that can be expanded when fetching agents.
|
|
13
|
+
*/
|
|
14
|
+
export type ZohoDeskAgentInclude = 'associatedChatDepartments' | 'role' | 'profile' | 'associatedDepartments';
|
|
15
|
+
/**
|
|
16
|
+
* An agent (support staff member) in Zoho Desk.
|
|
17
|
+
*/
|
|
18
|
+
export interface ZohoDeskAgent {
|
|
19
|
+
readonly id: ZohoDeskAgentId;
|
|
20
|
+
readonly name?: Maybe<string>;
|
|
21
|
+
readonly firstName?: Maybe<string>;
|
|
22
|
+
readonly lastName?: Maybe<string>;
|
|
23
|
+
readonly emailId?: Maybe<string>;
|
|
24
|
+
readonly phone?: Maybe<string>;
|
|
25
|
+
readonly mobile?: Maybe<string>;
|
|
26
|
+
readonly extn?: Maybe<string>;
|
|
27
|
+
readonly photoURL?: Maybe<string>;
|
|
28
|
+
readonly timeZone?: Maybe<string>;
|
|
29
|
+
readonly langCode?: Maybe<string>;
|
|
30
|
+
readonly countryCode?: Maybe<string>;
|
|
31
|
+
readonly aboutInfo?: Maybe<string>;
|
|
32
|
+
readonly channelExpert?: Maybe<string>;
|
|
33
|
+
readonly roleId?: Maybe<string>;
|
|
34
|
+
readonly profileId?: Maybe<string>;
|
|
35
|
+
readonly zuid?: Maybe<string>;
|
|
36
|
+
readonly isConfirmed?: Maybe<boolean>;
|
|
37
|
+
readonly status?: Maybe<ZohoDeskAgentStatus>;
|
|
38
|
+
readonly rolePermissionType?: Maybe<ZohoDeskAgentRolePermissionType>;
|
|
39
|
+
readonly associatedDepartmentIds?: Maybe<string[]>;
|
|
40
|
+
readonly associatedChatDepartmentIds?: Maybe<string[]>;
|
|
41
|
+
readonly role?: Maybe<Record<string, unknown>>;
|
|
42
|
+
readonly profile?: Maybe<Record<string, unknown>>;
|
|
43
|
+
readonly associatedDepartments?: Maybe<Record<string, unknown>[]>;
|
|
44
|
+
readonly associatedChatDepartments?: Maybe<Record<string, unknown>[]>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Maybe, type ArrayOrValue } from '@dereekb/util';
|
|
2
|
+
import { type FetchPage, type FetchPageFactoryOptions } from '@dereekb/util/fetch';
|
|
3
|
+
import { type ZohoDeskContext } from './desk.config';
|
|
4
|
+
import { type ZohoDeskTicketId } from './desk';
|
|
5
|
+
import { type ZohoDeskTicketActivity, type ZohoDeskActivityInclude } from './desk.ticket';
|
|
6
|
+
import { type ZohoDeskPageFilter, type ZohoDeskPageResult } from './desk.api.page';
|
|
7
|
+
/**
|
|
8
|
+
* Input parameters for listing activities on a ticket via `GET /tickets/{ticketId}/activities`.
|
|
9
|
+
*/
|
|
10
|
+
export interface ZohoDeskGetTicketActivitiesInput extends ZohoDeskPageFilter {
|
|
11
|
+
readonly ticketId: ZohoDeskTicketId;
|
|
12
|
+
readonly include?: ArrayOrValue<ZohoDeskActivityInclude>;
|
|
13
|
+
readonly isSpam?: boolean;
|
|
14
|
+
readonly isCompleted?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Response from listing ticket activities.
|
|
18
|
+
*/
|
|
19
|
+
export type ZohoDeskGetTicketActivitiesResponse = ZohoDeskPageResult<ZohoDeskTicketActivity>;
|
|
20
|
+
/**
|
|
21
|
+
* Function that retrieves activities for a specific ticket.
|
|
22
|
+
*/
|
|
23
|
+
export type ZohoDeskGetTicketActivitiesFunction = (input: ZohoDeskGetTicketActivitiesInput) => Promise<ZohoDeskGetTicketActivitiesResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a {@link ZohoDeskGetTicketActivitiesFunction} bound to the given context.
|
|
26
|
+
*
|
|
27
|
+
* Retrieves a paginated list of activities (tasks, events, calls) associated with a ticket.
|
|
28
|
+
*
|
|
29
|
+
* @param context - Authenticated Zoho Desk context
|
|
30
|
+
* @returns Function that retrieves activities for a ticket
|
|
31
|
+
*/
|
|
32
|
+
export declare function zohoDeskGetTicketActivities(context: ZohoDeskContext): ZohoDeskGetTicketActivitiesFunction;
|
|
33
|
+
/**
|
|
34
|
+
* Factory that creates paginated iterators for ticket activity queries.
|
|
35
|
+
*/
|
|
36
|
+
export type ZohoDeskGetTicketActivitiesPageFactory = (input: ZohoDeskGetTicketActivitiesInput, options?: Maybe<FetchPageFactoryOptions<ZohoDeskGetTicketActivitiesInput, ZohoDeskGetTicketActivitiesResponse>>) => FetchPage<ZohoDeskGetTicketActivitiesInput, ZohoDeskGetTicketActivitiesResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a {@link ZohoDeskGetTicketActivitiesPageFactory} bound to the given context.
|
|
39
|
+
*
|
|
40
|
+
* @param context - Authenticated Zoho Desk context
|
|
41
|
+
* @returns Page factory for iterating over activity results
|
|
42
|
+
*/
|
|
43
|
+
export declare function zohoDeskGetTicketActivitiesPageFactory(context: ZohoDeskContext): ZohoDeskGetTicketActivitiesPageFactory;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type Maybe, type ArrayOrValue } from '@dereekb/util';
|
|
2
|
+
import { type FetchPage, type FetchPageFactoryOptions } from '@dereekb/util/fetch';
|
|
3
|
+
import { type ZohoDeskContext } from './desk.config';
|
|
4
|
+
import { type ZohoDeskAgentId, type ZohoDeskDepartmentId } from './desk';
|
|
5
|
+
import { type ZohoDeskAgent, type ZohoDeskAgentInclude, type ZohoDeskAgentStatus } from './desk.agent';
|
|
6
|
+
import { type ZohoDeskPageFilter, type ZohoDeskPageResult } from './desk.api.page';
|
|
7
|
+
/**
|
|
8
|
+
* Input parameters for listing agents via `GET /agents`.
|
|
9
|
+
*/
|
|
10
|
+
export interface ZohoDeskGetAgentsInput extends ZohoDeskPageFilter {
|
|
11
|
+
readonly include?: ArrayOrValue<ZohoDeskAgentInclude>;
|
|
12
|
+
readonly departmentId?: ZohoDeskDepartmentId;
|
|
13
|
+
readonly status?: ZohoDeskAgentStatus;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Response from listing agents.
|
|
17
|
+
*/
|
|
18
|
+
export type ZohoDeskGetAgentsResponse = ZohoDeskPageResult<ZohoDeskAgent>;
|
|
19
|
+
/**
|
|
20
|
+
* Function that retrieves a paginated list of agents.
|
|
21
|
+
*/
|
|
22
|
+
export type ZohoDeskGetAgentsFunction = (input: ZohoDeskGetAgentsInput) => Promise<ZohoDeskGetAgentsResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a {@link ZohoDeskGetAgentsFunction} bound to the given context.
|
|
25
|
+
*
|
|
26
|
+
* Retrieves a paginated list of agents, with optional filtering by department and status,
|
|
27
|
+
* and inline expansion of related entities (role, profile, departments).
|
|
28
|
+
*
|
|
29
|
+
* @param context - Authenticated Zoho Desk context
|
|
30
|
+
* @returns Function that retrieves paginated agents
|
|
31
|
+
*/
|
|
32
|
+
export declare function zohoDeskGetAgents(context: ZohoDeskContext): ZohoDeskGetAgentsFunction;
|
|
33
|
+
/**
|
|
34
|
+
* Input parameters for retrieving a single agent via `GET /agents/{agentId}`.
|
|
35
|
+
*/
|
|
36
|
+
export interface ZohoDeskGetAgentByIdInput {
|
|
37
|
+
readonly agentId: ZohoDeskAgentId;
|
|
38
|
+
readonly include?: ArrayOrValue<ZohoDeskAgentInclude>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Function that retrieves a single agent by ID.
|
|
42
|
+
*/
|
|
43
|
+
export type ZohoDeskGetAgentByIdFunction = (input: ZohoDeskGetAgentByIdInput) => Promise<ZohoDeskAgent>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a {@link ZohoDeskGetAgentByIdFunction} bound to the given context.
|
|
46
|
+
*
|
|
47
|
+
* @param context - Authenticated Zoho Desk context
|
|
48
|
+
* @returns Function that retrieves a single agent
|
|
49
|
+
*/
|
|
50
|
+
export declare function zohoDeskGetAgentById(context: ZohoDeskContext): ZohoDeskGetAgentByIdFunction;
|
|
51
|
+
/**
|
|
52
|
+
* Input parameters for retrieving multiple agents by their IDs via `GET /agentsByIds`.
|
|
53
|
+
*/
|
|
54
|
+
export interface ZohoDeskGetAgentsByIdsInput {
|
|
55
|
+
readonly agentIds: ArrayOrValue<ZohoDeskAgentId>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Function that retrieves multiple agents by their IDs.
|
|
59
|
+
*/
|
|
60
|
+
export type ZohoDeskGetAgentsByIdsFunction = (input: ZohoDeskGetAgentsByIdsInput) => Promise<ZohoDeskAgent[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a {@link ZohoDeskGetAgentsByIdsFunction} bound to the given context.
|
|
63
|
+
*
|
|
64
|
+
* @param context - Authenticated Zoho Desk context
|
|
65
|
+
* @returns Function that retrieves agents by IDs
|
|
66
|
+
*/
|
|
67
|
+
export declare function zohoDeskGetAgentsByIds(context: ZohoDeskContext): ZohoDeskGetAgentsByIdsFunction;
|
|
68
|
+
/**
|
|
69
|
+
* Function that retrieves the current authenticated agent's profile.
|
|
70
|
+
*/
|
|
71
|
+
export type ZohoDeskGetMyInfoFunction = () => Promise<ZohoDeskAgent>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a {@link ZohoDeskGetMyInfoFunction} bound to the given context.
|
|
74
|
+
*
|
|
75
|
+
* Retrieves the profile of the agent associated with the current OAuth token.
|
|
76
|
+
*
|
|
77
|
+
* @param context - Authenticated Zoho Desk context
|
|
78
|
+
* @returns Function that retrieves the current agent's info
|
|
79
|
+
*/
|
|
80
|
+
export declare function zohoDeskGetMyInfo(context: ZohoDeskContext): ZohoDeskGetMyInfoFunction;
|
|
81
|
+
/**
|
|
82
|
+
* Factory that creates paginated iterators for agent list queries.
|
|
83
|
+
*/
|
|
84
|
+
export type ZohoDeskGetAgentsPageFactory = (input: ZohoDeskGetAgentsInput, options?: Maybe<FetchPageFactoryOptions<ZohoDeskGetAgentsInput, ZohoDeskGetAgentsResponse>>) => FetchPage<ZohoDeskGetAgentsInput, ZohoDeskGetAgentsResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* Creates a {@link ZohoDeskGetAgentsPageFactory} bound to the given context.
|
|
87
|
+
*
|
|
88
|
+
* @param context - Authenticated Zoho Desk context
|
|
89
|
+
* @returns Page factory for iterating over agent results
|
|
90
|
+
*/
|
|
91
|
+
export declare function zohoDeskGetAgentsPageFactory(context: ZohoDeskContext): ZohoDeskGetAgentsPageFactory;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type ArrayOrValue } from '@dereekb/util';
|
|
2
|
+
import { type ZohoDeskContext } from './desk.config';
|
|
3
|
+
import { type ZohoDeskTicketId } from './desk';
|
|
4
|
+
import { type ZohoDeskTicketAttachment, type ZohoDeskAttachmentSortBy, type ZohoDeskAttachmentInclude } from './desk.ticket';
|
|
5
|
+
import { type ZohoDeskPageFilter, type ZohoDeskPageResult } from './desk.api.page';
|
|
6
|
+
/**
|
|
7
|
+
* Input parameters for listing attachments on a ticket via `GET /tickets/{ticketId}/attachments`.
|
|
8
|
+
*/
|
|
9
|
+
export interface ZohoDeskGetTicketAttachmentsInput extends ZohoDeskPageFilter {
|
|
10
|
+
readonly ticketId: ZohoDeskTicketId;
|
|
11
|
+
readonly sortBy?: ZohoDeskAttachmentSortBy;
|
|
12
|
+
readonly include?: ArrayOrValue<ZohoDeskAttachmentInclude>;
|
|
13
|
+
readonly isPublic?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Response from listing ticket attachments.
|
|
17
|
+
*/
|
|
18
|
+
export type ZohoDeskGetTicketAttachmentsResponse = ZohoDeskPageResult<ZohoDeskTicketAttachment>;
|
|
19
|
+
/**
|
|
20
|
+
* Function that retrieves attachments for a specific ticket.
|
|
21
|
+
*/
|
|
22
|
+
export type ZohoDeskGetTicketAttachmentsFunction = (input: ZohoDeskGetTicketAttachmentsInput) => Promise<ZohoDeskGetTicketAttachmentsResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a {@link ZohoDeskGetTicketAttachmentsFunction} bound to the given context.
|
|
25
|
+
*
|
|
26
|
+
* @param context - Authenticated Zoho Desk context
|
|
27
|
+
* @returns Function that retrieves attachments for a ticket
|
|
28
|
+
*/
|
|
29
|
+
export declare function zohoDeskGetTicketAttachments(context: ZohoDeskContext): ZohoDeskGetTicketAttachmentsFunction;
|
|
30
|
+
/**
|
|
31
|
+
* Input parameters for deleting an attachment from a ticket via `DELETE /tickets/{ticketId}/attachments/{attachmentId}`.
|
|
32
|
+
*/
|
|
33
|
+
export interface ZohoDeskDeleteTicketAttachmentInput {
|
|
34
|
+
readonly ticketId: ZohoDeskTicketId;
|
|
35
|
+
readonly attachmentId: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Function that deletes an attachment from a ticket.
|
|
39
|
+
*/
|
|
40
|
+
export type ZohoDeskDeleteTicketAttachmentFunction = (input: ZohoDeskDeleteTicketAttachmentInput) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a {@link ZohoDeskDeleteTicketAttachmentFunction} bound to the given context.
|
|
43
|
+
*
|
|
44
|
+
* @param context - Authenticated Zoho Desk context
|
|
45
|
+
* @returns Function that deletes a ticket attachment
|
|
46
|
+
*/
|
|
47
|
+
export declare function zohoDeskDeleteTicketAttachment(context: ZohoDeskContext): ZohoDeskDeleteTicketAttachmentFunction;
|