@dereekb/zoho 13.38.0 → 13.40.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/index.js +7 -5
- package/cli/package.json +7 -7
- package/index.esm.js +3354 -556
- package/nestjs/docs/analytics-testing.md +202 -0
- package/nestjs/index.esm.js +867 -268
- package/nestjs/package.json +10 -10
- package/nestjs/src/lib/analytics/analytics.api.d.ts +236 -0
- package/nestjs/src/lib/analytics/analytics.config.d.ts +24 -0
- package/nestjs/src/lib/analytics/analytics.module.d.ts +65 -0
- package/nestjs/src/lib/analytics/index.d.ts +3 -0
- package/nestjs/src/lib/index.d.ts +1 -0
- package/package.json +15 -16
- package/src/lib/analytics/analytics.api.export.d.ts +167 -0
- package/src/lib/analytics/analytics.api.import.d.ts +252 -0
- package/src/lib/analytics/analytics.api.modeling.d.ts +106 -0
- package/src/lib/analytics/analytics.api.orgs.d.ts +36 -0
- package/src/lib/analytics/analytics.api.rows.d.ts +214 -0
- package/src/lib/analytics/analytics.api.views.d.ts +104 -0
- package/src/lib/analytics/analytics.api.workspaces.d.ts +96 -0
- package/src/lib/analytics/analytics.config.d.ts +92 -0
- package/src/lib/analytics/analytics.d.ts +86 -0
- package/src/lib/analytics/analytics.data.d.ts +74 -0
- package/src/lib/analytics/analytics.diff.d.ts +178 -0
- package/src/lib/analytics/analytics.error.api.d.ts +150 -0
- package/src/lib/analytics/analytics.export.d.ts +91 -0
- package/src/lib/analytics/analytics.factory.d.ts +56 -0
- package/src/lib/analytics/analytics.import.d.ts +176 -0
- package/src/lib/analytics/analytics.job.d.ts +132 -0
- package/src/lib/analytics/analytics.limit.d.ts +55 -0
- package/src/lib/analytics/analytics.org.d.ts +51 -0
- package/src/lib/analytics/analytics.param.d.ts +70 -0
- package/src/lib/analytics/analytics.view.d.ts +99 -0
- package/src/lib/analytics/index.d.ts +20 -0
- package/src/lib/index.d.ts +1 -0
- package/src/lib/zoho.limit.d.ts +14 -1
- package/index.cjs.default.js +0 -1
- package/index.cjs.js +0 -10617
- package/index.cjs.mjs +0 -2
- package/nestjs/index.cjs.default.js +0 -1
- package/nestjs/index.cjs.js +0 -4679
- package/nestjs/index.cjs.mjs +0 -2
package/nestjs/index.cjs.js
DELETED
|
@@ -1,4679 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var common = require('@nestjs/common');
|
|
4
|
-
var zoho = require('@dereekb/zoho');
|
|
5
|
-
var util = require('@dereekb/util');
|
|
6
|
-
var nestjs = require('@dereekb/nestjs');
|
|
7
|
-
var config = require('@nestjs/config');
|
|
8
|
-
var node_crypto = require('node:crypto');
|
|
9
|
-
|
|
10
|
-
function _type_of$1(obj) {
|
|
11
|
-
"@swc/helpers - typeof";
|
|
12
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
13
|
-
}
|
|
14
|
-
function __decorate(decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if ((typeof Reflect === "undefined" ? "undefined" : _type_of$1(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
}
|
|
20
|
-
function __param(paramIndex, decorator) {
|
|
21
|
-
return function(target, key) {
|
|
22
|
-
decorator(target, key, paramIndex);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
26
|
-
var e = new Error(message);
|
|
27
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var ZOHO_API_URL_CONFIG_KEY = 'API_URL';
|
|
31
|
-
function zohoConfigServiceReaderFunction(inputOrKey, inputConfigService) {
|
|
32
|
-
var configService;
|
|
33
|
-
var serviceAccessTokenKey;
|
|
34
|
-
if (typeof inputOrKey === 'string') {
|
|
35
|
-
serviceAccessTokenKey = inputOrKey;
|
|
36
|
-
configService = inputConfigService;
|
|
37
|
-
} else {
|
|
38
|
-
configService = inputOrKey.configService;
|
|
39
|
-
serviceAccessTokenKey = inputOrKey.serviceAccessTokenKey;
|
|
40
|
-
}
|
|
41
|
-
var baseServicePrefix = 'ZOHO_';
|
|
42
|
-
var servicePrefix = serviceAccessTokenKey.toUpperCase(); // "RECRUIT"
|
|
43
|
-
var servicePrefixString = "".concat(baseServicePrefix).concat(servicePrefix, "_"); // "ZOHO_RECRUIT_"
|
|
44
|
-
return function(key) {
|
|
45
|
-
var _configService_get;
|
|
46
|
-
var baseConfigKey = "".concat(baseServicePrefix).concat(key); // "ZOHO_ACCOUNTS_URL"
|
|
47
|
-
var serviceSpecificConfigKey = "".concat(servicePrefixString).concat(key); // "ZOHO_RECRUIT_ACCOUNTS_URL"
|
|
48
|
-
return (_configService_get = configService.get(serviceSpecificConfigKey)) !== null && _configService_get !== void 0 ? _configService_get : configService.get(baseConfigKey);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function readZohoConfigFromConfigService(configOrService, servicePrefix) {
|
|
52
|
-
var assertValid = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
53
|
-
var _configService_get;
|
|
54
|
-
var configService;
|
|
55
|
-
if ('configService' in configOrService) {
|
|
56
|
-
var _configOrService_assertValid;
|
|
57
|
-
configService = configOrService.configService;
|
|
58
|
-
servicePrefix = configOrService.servicePrefix;
|
|
59
|
-
assertValid = (_configOrService_assertValid = configOrService.assertValid) !== null && _configOrService_assertValid !== void 0 ? _configOrService_assertValid : true;
|
|
60
|
-
} else {
|
|
61
|
-
configService = configOrService;
|
|
62
|
-
}
|
|
63
|
-
var servicePrefixString = servicePrefix ? "".concat(servicePrefix, "_") : '';
|
|
64
|
-
var apiUrlConfigKey = "".concat(servicePrefixString).concat(ZOHO_API_URL_CONFIG_KEY);
|
|
65
|
-
var config = {
|
|
66
|
-
apiUrl: (_configService_get = configService.get(apiUrlConfigKey)) !== null && _configService_get !== void 0 ? _configService_get : configService.get(ZOHO_API_URL_CONFIG_KEY)
|
|
67
|
-
};
|
|
68
|
-
if (assertValid && !config.apiUrl) {
|
|
69
|
-
throw new Error('No Zoho API url or type specified for key "'.concat(apiUrlConfigKey, '".'));
|
|
70
|
-
}
|
|
71
|
-
return config;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Asserts that the provided ZohoConfig has a valid API URL configured.
|
|
75
|
-
*
|
|
76
|
-
* @param config - The Zoho config to validate.
|
|
77
|
-
* @throws {Error} When `config.apiUrl` is missing.
|
|
78
|
-
*/ function assertValidZohoConfig(config) {
|
|
79
|
-
if (!config.apiUrl) {
|
|
80
|
-
throw new Error("No Zoho API url or type specified.");
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _class_call_check$g(instance, Constructor) {
|
|
85
|
-
if (!(instance instanceof Constructor)) {
|
|
86
|
-
throw new TypeError("Cannot call a class as a function");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function _defineProperties$e(target, props) {
|
|
90
|
-
for(var i = 0; i < props.length; i++){
|
|
91
|
-
var descriptor = props[i];
|
|
92
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
93
|
-
descriptor.configurable = true;
|
|
94
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
95
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function _create_class$e(Constructor, protoProps, staticProps) {
|
|
99
|
-
if (staticProps) _defineProperties$e(Constructor, staticProps);
|
|
100
|
-
return Constructor;
|
|
101
|
-
}
|
|
102
|
-
function _define_property$g(obj, key, value) {
|
|
103
|
-
if (key in obj) {
|
|
104
|
-
Object.defineProperty(obj, key, {
|
|
105
|
-
value: value,
|
|
106
|
-
enumerable: true,
|
|
107
|
-
configurable: true,
|
|
108
|
-
writable: true
|
|
109
|
-
});
|
|
110
|
-
} else {
|
|
111
|
-
obj[key] = value;
|
|
112
|
-
}
|
|
113
|
-
return obj;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Configuration for ZohoService
|
|
117
|
-
*/ var ZohoAccountsServiceConfig = /*#__PURE__*/ function() {
|
|
118
|
-
function ZohoAccountsServiceConfig() {
|
|
119
|
-
_class_call_check$g(this, ZohoAccountsServiceConfig);
|
|
120
|
-
_define_property$g(this, "zohoAccounts", void 0);
|
|
121
|
-
_define_property$g(this, "factoryConfig", void 0);
|
|
122
|
-
}
|
|
123
|
-
_create_class$e(ZohoAccountsServiceConfig, null, [
|
|
124
|
-
{
|
|
125
|
-
key: "assertValidConfig",
|
|
126
|
-
value: function assertValidConfig(config) {
|
|
127
|
-
var zohoAccounts = config.zohoAccounts;
|
|
128
|
-
if (zohoAccounts) {
|
|
129
|
-
if (!zohoAccounts.serviceAccessTokenKey) {
|
|
130
|
-
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.serviceAccessTokenKey is required');
|
|
131
|
-
} else if (!zohoAccounts.refreshToken) {
|
|
132
|
-
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.refreshToken is required');
|
|
133
|
-
} else if (!zohoAccounts.apiUrl) {
|
|
134
|
-
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.apiUrl is required');
|
|
135
|
-
} else if (!zohoAccounts.clientId) {
|
|
136
|
-
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.clientId is required');
|
|
137
|
-
}
|
|
138
|
-
} else {
|
|
139
|
-
throw new Error('ZohoAccountsServiceConfig.zohoAccounts is required');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
]);
|
|
144
|
-
return ZohoAccountsServiceConfig;
|
|
145
|
-
}();
|
|
146
|
-
/**
|
|
147
|
-
* Builds a {@link ZohoAccountsServiceConfig} by reading Zoho Accounts OAuth credentials
|
|
148
|
-
* from a NestJS `ConfigService` (typically backed by environment variables).
|
|
149
|
-
*
|
|
150
|
-
* ## Environment Variable Resolution
|
|
151
|
-
*
|
|
152
|
-
* For each credential, the function first looks for a **service-specific** environment variable
|
|
153
|
-
* (e.g. `ZOHO_CRM_ACCOUNTS_URL`), then falls back to the **shared** variable
|
|
154
|
-
* (e.g. `ZOHO_ACCOUNTS_URL`). The service prefix is derived from `serviceAccessTokenKey`
|
|
155
|
-
* uppercased (e.g. `'crm'` → `ZOHO_CRM_`, `'recruit'` → `ZOHO_RECRUIT_`).
|
|
156
|
-
*
|
|
157
|
-
* | Credential | Shared env var | Service-specific env var (example: CRM) |
|
|
158
|
-
* |------------------|-------------------------------|----------------------------------------------|
|
|
159
|
-
* | Accounts API URL | `ZOHO_ACCOUNTS_URL` | `ZOHO_CRM_ACCOUNTS_URL` |
|
|
160
|
-
* | Refresh Token | `ZOHO_ACCOUNTS_REFRESH_TOKEN` | `ZOHO_CRM_ACCOUNTS_REFRESH_TOKEN` |
|
|
161
|
-
* | Client ID | `ZOHO_ACCOUNTS_CLIENT_ID` | `ZOHO_CRM_ACCOUNTS_CLIENT_ID` |
|
|
162
|
-
* | Client Secret | `ZOHO_ACCOUNTS_CLIENT_SECRET` | `ZOHO_CRM_ACCOUNTS_CLIENT_SECRET` |
|
|
163
|
-
*
|
|
164
|
-
* When using Zoho Recruit, replace `CRM` with `RECRUIT` in the service-specific variable names.
|
|
165
|
-
*
|
|
166
|
-
* @param input - The {@link ZohoAccountsServiceConfigFromConfigServiceInput} containing the
|
|
167
|
-
* `ConfigService` and the `serviceAccessTokenKey` for the target Zoho service.
|
|
168
|
-
* @returns A validated {@link ZohoAccountsServiceConfig} ready for use with `ZohoAccountsApi`.
|
|
169
|
-
* @throws {Error} If any required credential (apiUrl, refreshToken, clientId) is missing.
|
|
170
|
-
*/ function zohoAccountsServiceConfigFromConfigService(input) {
|
|
171
|
-
var serviceAccessTokenKey = input.serviceAccessTokenKey;
|
|
172
|
-
var getFromConfigService = zohoConfigServiceReaderFunction(input);
|
|
173
|
-
var zohoAccounts = {
|
|
174
|
-
serviceAccessTokenKey: serviceAccessTokenKey,
|
|
175
|
-
apiUrl: getFromConfigService('ACCOUNTS_URL'),
|
|
176
|
-
refreshToken: getFromConfigService('ACCOUNTS_REFRESH_TOKEN'),
|
|
177
|
-
clientId: getFromConfigService('ACCOUNTS_CLIENT_ID'),
|
|
178
|
-
clientSecret: getFromConfigService('ACCOUNTS_CLIENT_SECRET') // ZOHO_<SERVICE>_ACCOUNTS_CLIENT_SECRET, ZOHO_ACCOUNTS_CLIENT_SECRET
|
|
179
|
-
};
|
|
180
|
-
var config = {
|
|
181
|
-
zohoAccounts: zohoAccounts
|
|
182
|
-
};
|
|
183
|
-
ZohoAccountsServiceConfig.assertValidConfig(config);
|
|
184
|
-
return config;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function _array_like_to_array$5(arr, len) {
|
|
188
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
189
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
190
|
-
return arr2;
|
|
191
|
-
}
|
|
192
|
-
function _array_with_holes(arr) {
|
|
193
|
-
if (Array.isArray(arr)) return arr;
|
|
194
|
-
}
|
|
195
|
-
function _array_without_holes$5(arr) {
|
|
196
|
-
if (Array.isArray(arr)) return _array_like_to_array$5(arr);
|
|
197
|
-
}
|
|
198
|
-
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
199
|
-
try {
|
|
200
|
-
var info = gen[key](arg);
|
|
201
|
-
var value = info.value;
|
|
202
|
-
} catch (error) {
|
|
203
|
-
reject(error);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
if (info.done) {
|
|
207
|
-
resolve(value);
|
|
208
|
-
} else {
|
|
209
|
-
Promise.resolve(value).then(_next, _throw);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function _async_to_generator$3(fn) {
|
|
213
|
-
return function() {
|
|
214
|
-
var self = this, args = arguments;
|
|
215
|
-
return new Promise(function(resolve, reject) {
|
|
216
|
-
var gen = fn.apply(self, args);
|
|
217
|
-
function _next(value) {
|
|
218
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
219
|
-
}
|
|
220
|
-
function _throw(err) {
|
|
221
|
-
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
222
|
-
}
|
|
223
|
-
_next(undefined);
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
function _class_call_check$f(instance, Constructor) {
|
|
228
|
-
if (!(instance instanceof Constructor)) {
|
|
229
|
-
throw new TypeError("Cannot call a class as a function");
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
function _define_property$f(obj, key, value) {
|
|
233
|
-
if (key in obj) {
|
|
234
|
-
Object.defineProperty(obj, key, {
|
|
235
|
-
value: value,
|
|
236
|
-
enumerable: true,
|
|
237
|
-
configurable: true,
|
|
238
|
-
writable: true
|
|
239
|
-
});
|
|
240
|
-
} else {
|
|
241
|
-
obj[key] = value;
|
|
242
|
-
}
|
|
243
|
-
return obj;
|
|
244
|
-
}
|
|
245
|
-
function _instanceof(left, right) {
|
|
246
|
-
"@swc/helpers - instanceof";
|
|
247
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
248
|
-
return !!right[Symbol.hasInstance](left);
|
|
249
|
-
} else {
|
|
250
|
-
return left instanceof right;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
function _iterable_to_array$5(iter) {
|
|
254
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
255
|
-
}
|
|
256
|
-
function _iterable_to_array_limit(arr, i) {
|
|
257
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
258
|
-
if (_i == null) return;
|
|
259
|
-
var _arr = [];
|
|
260
|
-
var _n = true;
|
|
261
|
-
var _d = false;
|
|
262
|
-
var _s, _e;
|
|
263
|
-
try {
|
|
264
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
265
|
-
_arr.push(_s.value);
|
|
266
|
-
if (i && _arr.length === i) break;
|
|
267
|
-
}
|
|
268
|
-
} catch (err) {
|
|
269
|
-
_d = true;
|
|
270
|
-
_e = err;
|
|
271
|
-
} finally{
|
|
272
|
-
try {
|
|
273
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
274
|
-
} finally{
|
|
275
|
-
if (_d) throw _e;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
return _arr;
|
|
279
|
-
}
|
|
280
|
-
function _non_iterable_rest() {
|
|
281
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
282
|
-
}
|
|
283
|
-
function _non_iterable_spread$5() {
|
|
284
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
285
|
-
}
|
|
286
|
-
function _object_spread$6(target) {
|
|
287
|
-
for(var i = 1; i < arguments.length; i++){
|
|
288
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
289
|
-
var ownKeys = Object.keys(source);
|
|
290
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
291
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
292
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
293
|
-
}));
|
|
294
|
-
}
|
|
295
|
-
ownKeys.forEach(function(key) {
|
|
296
|
-
_define_property$f(target, key, source[key]);
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
return target;
|
|
300
|
-
}
|
|
301
|
-
function ownKeys$5(object, enumerableOnly) {
|
|
302
|
-
var keys = Object.keys(object);
|
|
303
|
-
if (Object.getOwnPropertySymbols) {
|
|
304
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
305
|
-
keys.push.apply(keys, symbols);
|
|
306
|
-
}
|
|
307
|
-
return keys;
|
|
308
|
-
}
|
|
309
|
-
function _object_spread_props$5(target, source) {
|
|
310
|
-
source = source != null ? source : {};
|
|
311
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
312
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
313
|
-
} else {
|
|
314
|
-
ownKeys$5(Object(source)).forEach(function(key) {
|
|
315
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
return target;
|
|
319
|
-
}
|
|
320
|
-
function _sliced_to_array(arr, i) {
|
|
321
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest();
|
|
322
|
-
}
|
|
323
|
-
function _to_consumable_array$5(arr) {
|
|
324
|
-
return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$5();
|
|
325
|
-
}
|
|
326
|
-
function _type_of(obj) {
|
|
327
|
-
"@swc/helpers - typeof";
|
|
328
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
329
|
-
}
|
|
330
|
-
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
331
|
-
if (!o) return;
|
|
332
|
-
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
333
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
334
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
335
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
336
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
337
|
-
}
|
|
338
|
-
function _ts_generator$3(thisArg, body) {
|
|
339
|
-
var f, y, t, _ = {
|
|
340
|
-
label: 0,
|
|
341
|
-
sent: function() {
|
|
342
|
-
if (t[0] & 1) throw t[1];
|
|
343
|
-
return t[1];
|
|
344
|
-
},
|
|
345
|
-
trys: [],
|
|
346
|
-
ops: []
|
|
347
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
348
|
-
return d(g, "next", {
|
|
349
|
-
value: verb(0)
|
|
350
|
-
}), d(g, "throw", {
|
|
351
|
-
value: verb(1)
|
|
352
|
-
}), d(g, "return", {
|
|
353
|
-
value: verb(2)
|
|
354
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
355
|
-
value: function() {
|
|
356
|
-
return this;
|
|
357
|
-
}
|
|
358
|
-
}), g;
|
|
359
|
-
function verb(n) {
|
|
360
|
-
return function(v) {
|
|
361
|
-
return step([
|
|
362
|
-
n,
|
|
363
|
-
v
|
|
364
|
-
]);
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
function step(op) {
|
|
368
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
369
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
370
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
371
|
-
if (y = 0, t) op = [
|
|
372
|
-
op[0] & 2,
|
|
373
|
-
t.value
|
|
374
|
-
];
|
|
375
|
-
switch(op[0]){
|
|
376
|
-
case 0:
|
|
377
|
-
case 1:
|
|
378
|
-
t = op;
|
|
379
|
-
break;
|
|
380
|
-
case 4:
|
|
381
|
-
_.label++;
|
|
382
|
-
return {
|
|
383
|
-
value: op[1],
|
|
384
|
-
done: false
|
|
385
|
-
};
|
|
386
|
-
case 5:
|
|
387
|
-
_.label++;
|
|
388
|
-
y = op[1];
|
|
389
|
-
op = [
|
|
390
|
-
0
|
|
391
|
-
];
|
|
392
|
-
continue;
|
|
393
|
-
case 7:
|
|
394
|
-
op = _.ops.pop();
|
|
395
|
-
_.trys.pop();
|
|
396
|
-
continue;
|
|
397
|
-
default:
|
|
398
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
399
|
-
_ = 0;
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
403
|
-
_.label = op[1];
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
407
|
-
_.label = t[1];
|
|
408
|
-
t = op;
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
if (t && _.label < t[2]) {
|
|
412
|
-
_.label = t[2];
|
|
413
|
-
_.ops.push(op);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
if (t[2]) _.ops.pop();
|
|
417
|
-
_.trys.pop();
|
|
418
|
-
continue;
|
|
419
|
-
}
|
|
420
|
-
op = body.call(thisArg, _);
|
|
421
|
-
} catch (e) {
|
|
422
|
-
op = [
|
|
423
|
-
6,
|
|
424
|
-
e
|
|
425
|
-
];
|
|
426
|
-
y = 0;
|
|
427
|
-
} finally{
|
|
428
|
-
f = t = 0;
|
|
429
|
-
}
|
|
430
|
-
if (op[0] & 5) throw op[1];
|
|
431
|
-
return {
|
|
432
|
-
value: op[0] ? op[1] : void 0,
|
|
433
|
-
done: true
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Service used for retrieving ZohoAccessTokenCache for Zoho services.
|
|
439
|
-
*/ exports.ZohoAccountsAccessTokenCacheService = function ZohoAccountsAccessTokenCacheService() {
|
|
440
|
-
_class_call_check$f(this, ZohoAccountsAccessTokenCacheService);
|
|
441
|
-
};
|
|
442
|
-
exports.ZohoAccountsAccessTokenCacheService = __decorate([
|
|
443
|
-
common.Injectable()
|
|
444
|
-
], exports.ZohoAccountsAccessTokenCacheService);
|
|
445
|
-
function buildZohoReadAdapter(cache) {
|
|
446
|
-
return {
|
|
447
|
-
load: function load() {
|
|
448
|
-
return _async_to_generator$3(function() {
|
|
449
|
-
var value;
|
|
450
|
-
return _ts_generator$3(this, function(_state) {
|
|
451
|
-
switch(_state.label){
|
|
452
|
-
case 0:
|
|
453
|
-
return [
|
|
454
|
-
4,
|
|
455
|
-
cache.loadCachedToken().catch(function() {
|
|
456
|
-
return undefined;
|
|
457
|
-
})
|
|
458
|
-
];
|
|
459
|
-
case 1:
|
|
460
|
-
value = _state.sent();
|
|
461
|
-
return [
|
|
462
|
-
2,
|
|
463
|
-
value != null && !util.isExpired(value) ? value : undefined
|
|
464
|
-
];
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
})();
|
|
468
|
-
},
|
|
469
|
-
update: function update(token) {
|
|
470
|
-
return cache.updateCachedToken(token);
|
|
471
|
-
},
|
|
472
|
-
clear: function clear() {
|
|
473
|
-
return cache.clearCachedToken();
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
function updateZohoCacheCapturingError(cache, accessToken) {
|
|
478
|
-
return cache.updateCachedToken(accessToken).then(function() {
|
|
479
|
-
return null;
|
|
480
|
-
}).catch(function(e) {
|
|
481
|
-
return [
|
|
482
|
-
cache,
|
|
483
|
-
e
|
|
484
|
-
];
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Default error logging function for merged Zoho access token cache services.
|
|
489
|
-
*
|
|
490
|
-
* @param failedUpdates - Array of cache/error tuples that failed during update.
|
|
491
|
-
*/ function logMergeZohoAccountsAccessTokenCacheServiceErrorFunction(failedUpdates) {
|
|
492
|
-
console.warn("mergeZohoAccountsAccessTokenCacheServices(): failed updating ".concat(failedUpdates.length, " caches."));
|
|
493
|
-
failedUpdates.forEach(function(param, i) {
|
|
494
|
-
var _param = _sliced_to_array(param, 2); _param[0]; var e = _param[1];
|
|
495
|
-
console.warn("Cache update failure ".concat(i + 1, ": - ").concat(e));
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Merges the input services in order to use some as a backup source.
|
|
500
|
-
*
|
|
501
|
-
* If once source fails retrieval, the next will be tried.
|
|
502
|
-
*
|
|
503
|
-
* When updating a cached token, it will update the token across all services.
|
|
504
|
-
*
|
|
505
|
-
* Read fall-through is delegated to {@link mergeAsyncValueCaches} after wrapping each
|
|
506
|
-
* underlying cache with an {@link isExpired}-aware filter, so an expired cached token
|
|
507
|
-
* never short-circuits the lookup. Updates and clears run across all services in parallel
|
|
508
|
-
* via `Promise.allSettled`, mirroring the previous behavior, with optional error logging.
|
|
509
|
-
*
|
|
510
|
-
* @param inputServicesToMerge - Cache services to merge in priority order. Must include at least one service.
|
|
511
|
-
* @param logError - Optional error logging toggle or custom logging function.
|
|
512
|
-
* @returns A merged ZohoAccountsAccessTokenCacheService that delegates across all inputs.
|
|
513
|
-
* @throws {Error} When `inputServicesToMerge` is empty.
|
|
514
|
-
*/ function mergeZohoAccountsAccessTokenCacheServices(inputServicesToMerge, logError) {
|
|
515
|
-
var services = _to_consumable_array$5(inputServicesToMerge);
|
|
516
|
-
var logErrorFunction = typeof logError === 'function' ? logError : logError === false ? undefined : logMergeZohoAccountsAccessTokenCacheServiceErrorFunction;
|
|
517
|
-
if (services.length === 0) {
|
|
518
|
-
throw new Error('mergeZohoAccountsAccessTokenCacheServices() input cannot be empty.');
|
|
519
|
-
}
|
|
520
|
-
function loadZohoAccessTokenCache(service) {
|
|
521
|
-
var accessCachesForService = services.map(function(x) {
|
|
522
|
-
return x.loadZohoAccessTokenCache(service);
|
|
523
|
-
});
|
|
524
|
-
// Per-cache adapters with expiry filtering so reads fall through to the next tier when a cache holds an expired token.
|
|
525
|
-
var readAdapters = accessCachesForService.map(buildZohoReadAdapter);
|
|
526
|
-
var merged = util.mergeAsyncValueCaches(readAdapters);
|
|
527
|
-
return {
|
|
528
|
-
loadCachedToken: function loadCachedToken() {
|
|
529
|
-
return merged.load();
|
|
530
|
-
},
|
|
531
|
-
updateCachedToken: function updateCachedToken(accessToken) {
|
|
532
|
-
return _async_to_generator$3(function() {
|
|
533
|
-
var settled, failedUpdates;
|
|
534
|
-
return _ts_generator$3(this, function(_state) {
|
|
535
|
-
switch(_state.label){
|
|
536
|
-
case 0:
|
|
537
|
-
return [
|
|
538
|
-
4,
|
|
539
|
-
Promise.allSettled(accessCachesForService.map(function(cache) {
|
|
540
|
-
return updateZohoCacheCapturingError(cache, accessToken);
|
|
541
|
-
}))
|
|
542
|
-
];
|
|
543
|
-
case 1:
|
|
544
|
-
settled = _state.sent();
|
|
545
|
-
if (logErrorFunction != null) {
|
|
546
|
-
failedUpdates = util.filterMaybeArrayValues(settled.map(function(y) {
|
|
547
|
-
return y.value;
|
|
548
|
-
}));
|
|
549
|
-
if (failedUpdates.length) {
|
|
550
|
-
logErrorFunction(failedUpdates);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return [
|
|
554
|
-
2
|
|
555
|
-
];
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
})();
|
|
559
|
-
},
|
|
560
|
-
clearCachedToken: function clearCachedToken() {
|
|
561
|
-
return _async_to_generator$3(function() {
|
|
562
|
-
return _ts_generator$3(this, function(_state) {
|
|
563
|
-
switch(_state.label){
|
|
564
|
-
case 0:
|
|
565
|
-
return [
|
|
566
|
-
4,
|
|
567
|
-
Promise.allSettled(accessCachesForService.map(function(cache) {
|
|
568
|
-
return cache.clearCachedToken();
|
|
569
|
-
}))
|
|
570
|
-
];
|
|
571
|
-
case 1:
|
|
572
|
-
_state.sent();
|
|
573
|
-
return [
|
|
574
|
-
2
|
|
575
|
-
];
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
})();
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
return {
|
|
583
|
-
loadZohoAccessTokenCache: loadZohoAccessTokenCache
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
// MARK: Memory Access Token Cache
|
|
587
|
-
/**
|
|
588
|
-
* Creates a ZohoAccountsAccessTokenCacheService that uses in-memory storage.
|
|
589
|
-
*
|
|
590
|
-
* Backed by {@link inMemoryAsyncKeyedValueCache} so all per-service caches share the
|
|
591
|
-
* same record instance.
|
|
592
|
-
*
|
|
593
|
-
* @param existingCache - Optional pre-populated token cache record to use as initial state.
|
|
594
|
-
* @param logAccessToConsole - Whether to log cache reads and writes to the console.
|
|
595
|
-
* @returns A ZohoAccountsAccessTokenCacheService backed by in-memory storage.
|
|
596
|
-
*/ function memoryZohoAccountsAccessTokenCacheService(existingCache, logAccessToConsole) {
|
|
597
|
-
var initialEntries = {};
|
|
598
|
-
if (existingCache != null) {
|
|
599
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
600
|
-
try {
|
|
601
|
-
for(var _iterator = Object.keys(existingCache)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
602
|
-
var key = _step.value;
|
|
603
|
-
var value = existingCache[key];
|
|
604
|
-
if (value != null) {
|
|
605
|
-
initialEntries[key] = value;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
} catch (err) {
|
|
609
|
-
_didIteratorError = true;
|
|
610
|
-
_iteratorError = err;
|
|
611
|
-
} finally{
|
|
612
|
-
try {
|
|
613
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
614
|
-
_iterator.return();
|
|
615
|
-
}
|
|
616
|
-
} finally{
|
|
617
|
-
if (_didIteratorError) {
|
|
618
|
-
throw _iteratorError;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
var cache = util.inMemoryAsyncKeyedValueCache(initialEntries);
|
|
624
|
-
function loadZohoAccessTokenCache(service) {
|
|
625
|
-
return {
|
|
626
|
-
loadCachedToken: function loadCachedToken() {
|
|
627
|
-
return _async_to_generator$3(function() {
|
|
628
|
-
var token;
|
|
629
|
-
return _ts_generator$3(this, function(_state) {
|
|
630
|
-
switch(_state.label){
|
|
631
|
-
case 0:
|
|
632
|
-
return [
|
|
633
|
-
4,
|
|
634
|
-
cache.get(service)
|
|
635
|
-
];
|
|
636
|
-
case 1:
|
|
637
|
-
token = _state.sent();
|
|
638
|
-
if (logAccessToConsole) {
|
|
639
|
-
console.log('retrieving access token from memory: ', {
|
|
640
|
-
service: service,
|
|
641
|
-
hit: token != null,
|
|
642
|
-
expiresAt: token === null || token === void 0 ? void 0 : token.expiresAt
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
return [
|
|
646
|
-
2,
|
|
647
|
-
token
|
|
648
|
-
];
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
})();
|
|
652
|
-
},
|
|
653
|
-
updateCachedToken: function updateCachedToken(accessToken) {
|
|
654
|
-
return _async_to_generator$3(function() {
|
|
655
|
-
return _ts_generator$3(this, function(_state) {
|
|
656
|
-
switch(_state.label){
|
|
657
|
-
case 0:
|
|
658
|
-
return [
|
|
659
|
-
4,
|
|
660
|
-
cache.set(service, accessToken)
|
|
661
|
-
];
|
|
662
|
-
case 1:
|
|
663
|
-
_state.sent();
|
|
664
|
-
if (logAccessToConsole) {
|
|
665
|
-
console.log('updating access token in memory: ', {
|
|
666
|
-
service: service,
|
|
667
|
-
expiresAt: accessToken === null || accessToken === void 0 ? void 0 : accessToken.expiresAt
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
return [
|
|
671
|
-
2
|
|
672
|
-
];
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
|
-
})();
|
|
676
|
-
},
|
|
677
|
-
clearCachedToken: function clearCachedToken() {
|
|
678
|
-
return _async_to_generator$3(function() {
|
|
679
|
-
return _ts_generator$3(this, function(_state) {
|
|
680
|
-
switch(_state.label){
|
|
681
|
-
case 0:
|
|
682
|
-
return [
|
|
683
|
-
4,
|
|
684
|
-
cache.remove(service)
|
|
685
|
-
];
|
|
686
|
-
case 1:
|
|
687
|
-
_state.sent();
|
|
688
|
-
if (logAccessToConsole) {
|
|
689
|
-
console.log('clearing access token in memory: ', {
|
|
690
|
-
service: service
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
return [
|
|
694
|
-
2
|
|
695
|
-
];
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
})();
|
|
699
|
-
}
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
loadZohoAccessTokenCache: loadZohoAccessTokenCache
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
// MARK: File System Access Token Cache
|
|
707
|
-
var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-access-tokens.json';
|
|
708
|
-
/**
|
|
709
|
-
* Reviver applied to each cached token entry on load so `expiresAt` is always a `Date`
|
|
710
|
-
* regardless of how it was serialized.
|
|
711
|
-
*
|
|
712
|
-
* @param raw - The raw value loaded from storage; expected to be an object shaped like a ZohoAccessToken with a serialized `expiresAt`
|
|
713
|
-
* @returns The parsed ZohoAccessToken with `expiresAt` coerced to a Date, or undefined when the input is not an object.
|
|
714
|
-
*/ function reviveZohoAccessToken(raw) {
|
|
715
|
-
var result;
|
|
716
|
-
if (raw == null || (typeof raw === "undefined" ? "undefined" : _type_of(raw)) !== 'object') {
|
|
717
|
-
result = undefined;
|
|
718
|
-
} else {
|
|
719
|
-
var value = raw;
|
|
720
|
-
var rawExpiresAt = value.expiresAt;
|
|
721
|
-
var expiresAt = rawExpiresAt != null && !_instanceof(rawExpiresAt, Date) ? new Date(rawExpiresAt) : rawExpiresAt;
|
|
722
|
-
result = _object_spread_props$5(_object_spread$6({}, value), {
|
|
723
|
-
expiresAt: expiresAt
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
return result;
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* Creates a ZohoAccountsAccessTokenCacheService that reads and writes the access token to the file system.
|
|
730
|
-
*
|
|
731
|
-
* Composes {@link createJsonFileAsyncKeyedValueCache} (for the on-disk record) optionally with
|
|
732
|
-
* {@link memoizeAsyncKeyedValueCache} so reads after the first hit memory.
|
|
733
|
-
*
|
|
734
|
-
* Useful for testing.
|
|
735
|
-
*
|
|
736
|
-
* @param filename - Path to the JSON file used for token persistence.
|
|
737
|
-
* @param useMemoryCache - Whether to also cache tokens in memory for faster reads.
|
|
738
|
-
* @returns A FileSystemZohoAccountsAccessTokenCacheService backed by file storage.
|
|
739
|
-
*/ function fileZohoAccountsAccessTokenCacheService() {
|
|
740
|
-
var filename = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH, useMemoryCache = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
741
|
-
var fileCache = nestjs.createJsonFileAsyncKeyedValueCache({
|
|
742
|
-
filePath: filename,
|
|
743
|
-
reviver: reviveZohoAccessToken
|
|
744
|
-
});
|
|
745
|
-
var cache = useMemoryCache ? util.memoizeAsyncKeyedValueCache(fileCache) : fileCache;
|
|
746
|
-
function loadZohoAccessTokenCache(service) {
|
|
747
|
-
return {
|
|
748
|
-
loadCachedToken: function loadCachedToken() {
|
|
749
|
-
return cache.get(service);
|
|
750
|
-
},
|
|
751
|
-
updateCachedToken: function updateCachedToken(accessToken) {
|
|
752
|
-
return _async_to_generator$3(function() {
|
|
753
|
-
var e;
|
|
754
|
-
return _ts_generator$3(this, function(_state) {
|
|
755
|
-
switch(_state.label){
|
|
756
|
-
case 0:
|
|
757
|
-
_state.trys.push([
|
|
758
|
-
0,
|
|
759
|
-
2,
|
|
760
|
-
,
|
|
761
|
-
3
|
|
762
|
-
]);
|
|
763
|
-
return [
|
|
764
|
-
4,
|
|
765
|
-
cache.set(service, accessToken)
|
|
766
|
-
];
|
|
767
|
-
case 1:
|
|
768
|
-
_state.sent();
|
|
769
|
-
return [
|
|
770
|
-
3,
|
|
771
|
-
3
|
|
772
|
-
];
|
|
773
|
-
case 2:
|
|
774
|
-
e = _state.sent();
|
|
775
|
-
console.error('Failed updating access token in file: ', e);
|
|
776
|
-
return [
|
|
777
|
-
3,
|
|
778
|
-
3
|
|
779
|
-
];
|
|
780
|
-
case 3:
|
|
781
|
-
return [
|
|
782
|
-
2
|
|
783
|
-
];
|
|
784
|
-
}
|
|
785
|
-
});
|
|
786
|
-
})();
|
|
787
|
-
},
|
|
788
|
-
clearCachedToken: function clearCachedToken() {
|
|
789
|
-
return _async_to_generator$3(function() {
|
|
790
|
-
var e;
|
|
791
|
-
return _ts_generator$3(this, function(_state) {
|
|
792
|
-
switch(_state.label){
|
|
793
|
-
case 0:
|
|
794
|
-
_state.trys.push([
|
|
795
|
-
0,
|
|
796
|
-
2,
|
|
797
|
-
,
|
|
798
|
-
3
|
|
799
|
-
]);
|
|
800
|
-
return [
|
|
801
|
-
4,
|
|
802
|
-
cache.remove(service)
|
|
803
|
-
];
|
|
804
|
-
case 1:
|
|
805
|
-
_state.sent();
|
|
806
|
-
return [
|
|
807
|
-
3,
|
|
808
|
-
3
|
|
809
|
-
];
|
|
810
|
-
case 2:
|
|
811
|
-
e = _state.sent();
|
|
812
|
-
console.error('Failed clearing access token in file: ', e);
|
|
813
|
-
return [
|
|
814
|
-
3,
|
|
815
|
-
3
|
|
816
|
-
];
|
|
817
|
-
case 3:
|
|
818
|
-
return [
|
|
819
|
-
2
|
|
820
|
-
];
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
})();
|
|
824
|
-
}
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
function readTokenFile() {
|
|
828
|
-
return _async_to_generator$3(function() {
|
|
829
|
-
var raw, result, revived, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, key;
|
|
830
|
-
return _ts_generator$3(this, function(_state) {
|
|
831
|
-
switch(_state.label){
|
|
832
|
-
case 0:
|
|
833
|
-
return [
|
|
834
|
-
4,
|
|
835
|
-
nestjs.readJsonFile(filename)
|
|
836
|
-
];
|
|
837
|
-
case 1:
|
|
838
|
-
raw = _state.sent();
|
|
839
|
-
if (raw == null) {
|
|
840
|
-
result = undefined;
|
|
841
|
-
} else {
|
|
842
|
-
revived = {};
|
|
843
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
844
|
-
try {
|
|
845
|
-
for(_iterator = Object.keys(raw)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
846
|
-
key = _step.value;
|
|
847
|
-
revived[key] = reviveZohoAccessToken(raw[key]);
|
|
848
|
-
}
|
|
849
|
-
} catch (err) {
|
|
850
|
-
_didIteratorError = true;
|
|
851
|
-
_iteratorError = err;
|
|
852
|
-
} finally{
|
|
853
|
-
try {
|
|
854
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
855
|
-
_iterator.return();
|
|
856
|
-
}
|
|
857
|
-
} finally{
|
|
858
|
-
if (_didIteratorError) {
|
|
859
|
-
throw _iteratorError;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
result = revived;
|
|
864
|
-
}
|
|
865
|
-
return [
|
|
866
|
-
2,
|
|
867
|
-
result
|
|
868
|
-
];
|
|
869
|
-
}
|
|
870
|
-
});
|
|
871
|
-
})();
|
|
872
|
-
}
|
|
873
|
-
// Route the file-mutation helpers through the same `cache` instance used by
|
|
874
|
-
// loadZohoAccessTokenCache so the memoized in-memory layer (when useMemoryCache=true) stays
|
|
875
|
-
// consistent with disk. Direct writeJsonFile / removeFile would otherwise leave the memo
|
|
876
|
-
// holding stale entries that no future read could refresh.
|
|
877
|
-
function writeTokenFile(tokens) {
|
|
878
|
-
return _async_to_generator$3(function() {
|
|
879
|
-
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, value, err;
|
|
880
|
-
return _ts_generator$3(this, function(_state) {
|
|
881
|
-
switch(_state.label){
|
|
882
|
-
case 0:
|
|
883
|
-
return [
|
|
884
|
-
4,
|
|
885
|
-
cache.clear()
|
|
886
|
-
];
|
|
887
|
-
case 1:
|
|
888
|
-
_state.sent();
|
|
889
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
890
|
-
_state.label = 2;
|
|
891
|
-
case 2:
|
|
892
|
-
_state.trys.push([
|
|
893
|
-
2,
|
|
894
|
-
7,
|
|
895
|
-
8,
|
|
896
|
-
9
|
|
897
|
-
]);
|
|
898
|
-
_iterator = Object.entries(tokens)[Symbol.iterator]();
|
|
899
|
-
_state.label = 3;
|
|
900
|
-
case 3:
|
|
901
|
-
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
902
|
-
3,
|
|
903
|
-
6
|
|
904
|
-
];
|
|
905
|
-
_step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
906
|
-
if (!(value != null)) return [
|
|
907
|
-
3,
|
|
908
|
-
5
|
|
909
|
-
];
|
|
910
|
-
return [
|
|
911
|
-
4,
|
|
912
|
-
cache.set(key, value)
|
|
913
|
-
];
|
|
914
|
-
case 4:
|
|
915
|
-
_state.sent();
|
|
916
|
-
_state.label = 5;
|
|
917
|
-
case 5:
|
|
918
|
-
_iteratorNormalCompletion = true;
|
|
919
|
-
return [
|
|
920
|
-
3,
|
|
921
|
-
3
|
|
922
|
-
];
|
|
923
|
-
case 6:
|
|
924
|
-
return [
|
|
925
|
-
3,
|
|
926
|
-
9
|
|
927
|
-
];
|
|
928
|
-
case 7:
|
|
929
|
-
err = _state.sent();
|
|
930
|
-
_didIteratorError = true;
|
|
931
|
-
_iteratorError = err;
|
|
932
|
-
return [
|
|
933
|
-
3,
|
|
934
|
-
9
|
|
935
|
-
];
|
|
936
|
-
case 8:
|
|
937
|
-
try {
|
|
938
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
939
|
-
_iterator.return();
|
|
940
|
-
}
|
|
941
|
-
} finally{
|
|
942
|
-
if (_didIteratorError) {
|
|
943
|
-
throw _iteratorError;
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
return [
|
|
947
|
-
7
|
|
948
|
-
];
|
|
949
|
-
case 9:
|
|
950
|
-
return [
|
|
951
|
-
2
|
|
952
|
-
];
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
})();
|
|
956
|
-
}
|
|
957
|
-
function deleteTokenFile() {
|
|
958
|
-
return _async_to_generator$3(function() {
|
|
959
|
-
return _ts_generator$3(this, function(_state) {
|
|
960
|
-
switch(_state.label){
|
|
961
|
-
case 0:
|
|
962
|
-
return [
|
|
963
|
-
4,
|
|
964
|
-
cache.clear()
|
|
965
|
-
];
|
|
966
|
-
case 1:
|
|
967
|
-
_state.sent();
|
|
968
|
-
return [
|
|
969
|
-
2
|
|
970
|
-
];
|
|
971
|
-
}
|
|
972
|
-
});
|
|
973
|
-
})();
|
|
974
|
-
}
|
|
975
|
-
return {
|
|
976
|
-
loadZohoAccessTokenCache: loadZohoAccessTokenCache,
|
|
977
|
-
readTokenFile: readTokenFile,
|
|
978
|
-
writeTokenFile: writeTokenFile,
|
|
979
|
-
deleteTokenFile: deleteTokenFile
|
|
980
|
-
};
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
function _class_call_check$e(instance, Constructor) {
|
|
984
|
-
if (!(instance instanceof Constructor)) {
|
|
985
|
-
throw new TypeError("Cannot call a class as a function");
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
function _defineProperties$d(target, props) {
|
|
989
|
-
for(var i = 0; i < props.length; i++){
|
|
990
|
-
var descriptor = props[i];
|
|
991
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
992
|
-
descriptor.configurable = true;
|
|
993
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
994
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
function _create_class$d(Constructor, protoProps, staticProps) {
|
|
998
|
-
if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
|
|
999
|
-
return Constructor;
|
|
1000
|
-
}
|
|
1001
|
-
function _define_property$e(obj, key, value) {
|
|
1002
|
-
if (key in obj) {
|
|
1003
|
-
Object.defineProperty(obj, key, {
|
|
1004
|
-
value: value,
|
|
1005
|
-
enumerable: true,
|
|
1006
|
-
configurable: true,
|
|
1007
|
-
writable: true
|
|
1008
|
-
});
|
|
1009
|
-
} else {
|
|
1010
|
-
obj[key] = value;
|
|
1011
|
-
}
|
|
1012
|
-
return obj;
|
|
1013
|
-
}
|
|
1014
|
-
function _object_spread$5(target) {
|
|
1015
|
-
for(var i = 1; i < arguments.length; i++){
|
|
1016
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1017
|
-
var ownKeys = Object.keys(source);
|
|
1018
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1019
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1020
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1021
|
-
}));
|
|
1022
|
-
}
|
|
1023
|
-
ownKeys.forEach(function(key) {
|
|
1024
|
-
_define_property$e(target, key, source[key]);
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
return target;
|
|
1028
|
-
}
|
|
1029
|
-
exports.ZohoAccountsApi = /*#__PURE__*/ function() {
|
|
1030
|
-
function ZohoAccountsApi(config, cacheService) {
|
|
1031
|
-
_class_call_check$e(this, ZohoAccountsApi);
|
|
1032
|
-
var _config_zohoAccounts_accessTokenCache, _config_factoryConfig;
|
|
1033
|
-
_define_property$e(this, "config", void 0);
|
|
1034
|
-
_define_property$e(this, "cacheService", void 0);
|
|
1035
|
-
_define_property$e(this, "zohoAccounts", void 0);
|
|
1036
|
-
this.config = config;
|
|
1037
|
-
this.cacheService = cacheService;
|
|
1038
|
-
var accessTokenCache = (_config_zohoAccounts_accessTokenCache = config.zohoAccounts.accessTokenCache) !== null && _config_zohoAccounts_accessTokenCache !== void 0 ? _config_zohoAccounts_accessTokenCache : cacheService.loadZohoAccessTokenCache(config.zohoAccounts.serviceAccessTokenKey);
|
|
1039
|
-
this.zohoAccounts = zoho.zohoAccountsFactory((_config_factoryConfig = config.factoryConfig) !== null && _config_factoryConfig !== void 0 ? _config_factoryConfig : {})(_object_spread$5({
|
|
1040
|
-
accessTokenCache: accessTokenCache
|
|
1041
|
-
}, config.zohoAccounts));
|
|
1042
|
-
}
|
|
1043
|
-
_create_class$d(ZohoAccountsApi, [
|
|
1044
|
-
{
|
|
1045
|
-
key: "accountsContext",
|
|
1046
|
-
get: function get() {
|
|
1047
|
-
return this.zohoAccounts.accountsContext;
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
key: "accessToken",
|
|
1052
|
-
get: // MARK: Accessors
|
|
1053
|
-
function get() {
|
|
1054
|
-
return zoho.zohoAccountsAccessToken(this.accountsContext);
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
]);
|
|
1058
|
-
return ZohoAccountsApi;
|
|
1059
|
-
}();
|
|
1060
|
-
exports.ZohoAccountsApi = __decorate([
|
|
1061
|
-
common.Injectable(),
|
|
1062
|
-
__param(0, common.Inject(ZohoAccountsServiceConfig)),
|
|
1063
|
-
__param(1, common.Inject(exports.ZohoAccountsAccessTokenCacheService))
|
|
1064
|
-
], exports.ZohoAccountsApi);
|
|
1065
|
-
|
|
1066
|
-
function _class_call_check$d(instance, Constructor) {
|
|
1067
|
-
if (!(instance instanceof Constructor)) {
|
|
1068
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
function _defineProperties$c(target, props) {
|
|
1072
|
-
for(var i = 0; i < props.length; i++){
|
|
1073
|
-
var descriptor = props[i];
|
|
1074
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1075
|
-
descriptor.configurable = true;
|
|
1076
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1077
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
function _create_class$c(Constructor, protoProps, staticProps) {
|
|
1081
|
-
if (staticProps) _defineProperties$c(Constructor, staticProps);
|
|
1082
|
-
return Constructor;
|
|
1083
|
-
}
|
|
1084
|
-
function _define_property$d(obj, key, value) {
|
|
1085
|
-
if (key in obj) {
|
|
1086
|
-
Object.defineProperty(obj, key, {
|
|
1087
|
-
value: value,
|
|
1088
|
-
enumerable: true,
|
|
1089
|
-
configurable: true,
|
|
1090
|
-
writable: true
|
|
1091
|
-
});
|
|
1092
|
-
} else {
|
|
1093
|
-
obj[key] = value;
|
|
1094
|
-
}
|
|
1095
|
-
return obj;
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
* Environment key naming the Zoho Accounts datacenter (or a full accounts URL) to authorize against.
|
|
1099
|
-
*/ var ZOHO_ACCOUNTS_URL_CONFIG_KEY = 'ZOHO_ACCOUNTS_URL';
|
|
1100
|
-
/**
|
|
1101
|
-
* Environment key holding the Zoho OAuth client id.
|
|
1102
|
-
*/ var ZOHO_ACCOUNTS_CLIENT_ID_CONFIG_KEY = 'ZOHO_ACCOUNTS_CLIENT_ID';
|
|
1103
|
-
/**
|
|
1104
|
-
* Environment key holding the Zoho OAuth client secret.
|
|
1105
|
-
*/ var ZOHO_ACCOUNTS_CLIENT_SECRET_CONFIG_KEY = 'ZOHO_ACCOUNTS_CLIENT_SECRET';
|
|
1106
|
-
/**
|
|
1107
|
-
* Configuration for {@link ZohoAccountsOAuthApi}.
|
|
1108
|
-
*
|
|
1109
|
-
* Read from the three existing flat `ZOHO_ACCOUNTS_*` keys rather than composed through
|
|
1110
|
-
* `zohoConfigServiceReaderFunction`, which requires a `serviceAccessTokenKey` a per-user OAuth
|
|
1111
|
-
* client does not have. Notably absent: `ZOHO_ACCOUNTS_REFRESH_TOKEN` (a per-user flow has no
|
|
1112
|
-
* server refresh token) and any scope variable (scopes are declared in code).
|
|
1113
|
-
*/ var ZohoAccountsOAuthServiceConfig = /*#__PURE__*/ function() {
|
|
1114
|
-
function ZohoAccountsOAuthServiceConfig() {
|
|
1115
|
-
_class_call_check$d(this, ZohoAccountsOAuthServiceConfig);
|
|
1116
|
-
_define_property$d(this, "zohoAccountsOAuth", void 0);
|
|
1117
|
-
_define_property$d(this, "factoryConfig", void 0);
|
|
1118
|
-
}
|
|
1119
|
-
_create_class$c(ZohoAccountsOAuthServiceConfig, null, [
|
|
1120
|
-
{
|
|
1121
|
-
key: "assertValidConfig",
|
|
1122
|
-
value: function assertValidConfig(config) {
|
|
1123
|
-
var zohoAccountsOAuth = config.zohoAccountsOAuth;
|
|
1124
|
-
if (!zohoAccountsOAuth) {
|
|
1125
|
-
throw new Error('ZohoAccountsOAuthServiceConfig.zohoAccountsOAuth is required');
|
|
1126
|
-
}
|
|
1127
|
-
if (!zohoAccountsOAuth.clientId) {
|
|
1128
|
-
throw new Error("ZohoAccountsOAuthServiceConfig requires a clientId (".concat(ZOHO_ACCOUNTS_CLIENT_ID_CONFIG_KEY, ")."));
|
|
1129
|
-
}
|
|
1130
|
-
if (!zohoAccountsOAuth.clientSecret) {
|
|
1131
|
-
throw new Error("ZohoAccountsOAuthServiceConfig requires a clientSecret (".concat(ZOHO_ACCOUNTS_CLIENT_SECRET_CONFIG_KEY, ")."));
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
]);
|
|
1136
|
-
return ZohoAccountsOAuthServiceConfig;
|
|
1137
|
-
}();
|
|
1138
|
-
/**
|
|
1139
|
-
* Factory function that creates a {@link ZohoAccountsOAuthServiceConfig} from NestJS ConfigService
|
|
1140
|
-
* environment variables.
|
|
1141
|
-
*
|
|
1142
|
-
* @param configService - The NestJS ConfigService instance.
|
|
1143
|
-
* @returns A validated ZohoAccountsOAuthServiceConfig.
|
|
1144
|
-
* @throws {Error} When the client id or client secret is not configured.
|
|
1145
|
-
*/ function zohoAccountsOAuthServiceConfigFactory(configService) {
|
|
1146
|
-
var clientId = configService.get(ZOHO_ACCOUNTS_CLIENT_ID_CONFIG_KEY);
|
|
1147
|
-
var clientSecret = configService.get(ZOHO_ACCOUNTS_CLIENT_SECRET_CONFIG_KEY);
|
|
1148
|
-
var apiUrl = configService.get(ZOHO_ACCOUNTS_URL_CONFIG_KEY);
|
|
1149
|
-
var config = {
|
|
1150
|
-
zohoAccountsOAuth: {
|
|
1151
|
-
clientId: clientId || undefined,
|
|
1152
|
-
clientSecret: clientSecret || undefined,
|
|
1153
|
-
apiUrl: apiUrl || undefined
|
|
1154
|
-
}
|
|
1155
|
-
};
|
|
1156
|
-
ZohoAccountsOAuthServiceConfig.assertValidConfig(config);
|
|
1157
|
-
return config;
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
function _class_call_check$c(instance, Constructor) {
|
|
1161
|
-
if (!(instance instanceof Constructor)) {
|
|
1162
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
function _defineProperties$b(target, props) {
|
|
1166
|
-
for(var i = 0; i < props.length; i++){
|
|
1167
|
-
var descriptor = props[i];
|
|
1168
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1169
|
-
descriptor.configurable = true;
|
|
1170
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1171
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
function _create_class$b(Constructor, protoProps, staticProps) {
|
|
1175
|
-
if (protoProps) _defineProperties$b(Constructor.prototype, protoProps);
|
|
1176
|
-
return Constructor;
|
|
1177
|
-
}
|
|
1178
|
-
function _define_property$c(obj, key, value) {
|
|
1179
|
-
if (key in obj) {
|
|
1180
|
-
Object.defineProperty(obj, key, {
|
|
1181
|
-
value: value,
|
|
1182
|
-
enumerable: true,
|
|
1183
|
-
configurable: true,
|
|
1184
|
-
writable: true
|
|
1185
|
-
});
|
|
1186
|
-
} else {
|
|
1187
|
-
obj[key] = value;
|
|
1188
|
-
}
|
|
1189
|
-
return obj;
|
|
1190
|
-
}
|
|
1191
|
-
/**
|
|
1192
|
-
* The Zoho Accounts endpoints a per-user connect flow needs: the authorization-code exchange, the
|
|
1193
|
-
* per-user token refresh, and the identity lookup that labels the connection.
|
|
1194
|
-
*
|
|
1195
|
-
* Deliberately separate from {@link ZohoAccountsApi}, which requires a server refresh token and a
|
|
1196
|
-
* token cache. A per-user handoff has neither — the handoff is how a refresh token is obtained.
|
|
1197
|
-
*/ exports.ZohoAccountsOAuthApi = /*#__PURE__*/ function() {
|
|
1198
|
-
function ZohoAccountsOAuthApi(config) {
|
|
1199
|
-
_class_call_check$c(this, ZohoAccountsOAuthApi);
|
|
1200
|
-
var _config_factoryConfig;
|
|
1201
|
-
_define_property$c(this, "config", void 0);
|
|
1202
|
-
_define_property$c(this, "_clientFactory", void 0);
|
|
1203
|
-
/**
|
|
1204
|
-
* Per-host clients, memoized so a repeated datacenter reuses one client rather than rebuilding
|
|
1205
|
-
* its fetch stack per callback.
|
|
1206
|
-
*/ _define_property$c(this, "_clients", new Map());
|
|
1207
|
-
/**
|
|
1208
|
-
* The accounts host configured for this app.
|
|
1209
|
-
*/ _define_property$c(this, "apiUrl", void 0);
|
|
1210
|
-
/**
|
|
1211
|
-
* The OAuth client id the authorize request is composed with.
|
|
1212
|
-
*/ _define_property$c(this, "clientId", void 0);
|
|
1213
|
-
_define_property$c(this, "_clientSecret", void 0);
|
|
1214
|
-
this.config = config;
|
|
1215
|
-
// asserted here rather than trusted, so a config assembled in code (not through the env factory,
|
|
1216
|
-
// which already asserts) cannot reach the consent screen with an undefined client id
|
|
1217
|
-
ZohoAccountsOAuthServiceConfig.assertValidConfig(config);
|
|
1218
|
-
var _config_zohoAccountsOAuth = config.zohoAccountsOAuth, apiUrl = _config_zohoAccountsOAuth.apiUrl, clientId = _config_zohoAccountsOAuth.clientId, clientSecret = _config_zohoAccountsOAuth.clientSecret;
|
|
1219
|
-
this.apiUrl = zoho.zohoAccountsConfigApiUrl(apiUrl !== null && apiUrl !== void 0 ? apiUrl : 'us');
|
|
1220
|
-
this.clientId = clientId;
|
|
1221
|
-
this._clientSecret = clientSecret;
|
|
1222
|
-
this._clientFactory = zoho.zohoAccountsOAuthClientFactory((_config_factoryConfig = config.factoryConfig) !== null && _config_factoryConfig !== void 0 ? _config_factoryConfig : {});
|
|
1223
|
-
}
|
|
1224
|
-
_create_class$b(ZohoAccountsOAuthApi, [
|
|
1225
|
-
{
|
|
1226
|
-
key: "oauthClientContext",
|
|
1227
|
-
get: /**
|
|
1228
|
-
* The client for the configured datacenter.
|
|
1229
|
-
*/ function get() {
|
|
1230
|
-
return this.oauthClientContextForApiUrl(this.apiUrl);
|
|
1231
|
-
}
|
|
1232
|
-
},
|
|
1233
|
-
{
|
|
1234
|
-
/**
|
|
1235
|
-
* The client for a specific accounts host, memoized per host.
|
|
1236
|
-
*
|
|
1237
|
-
* Zoho echoes the issuing datacenter back as `accounts-server` on the callback, and a code issued
|
|
1238
|
-
* by one datacenter cannot be exchanged at another. Callers MUST have checked the host against
|
|
1239
|
-
* `isKnownZohoAccountsApiUrl` first — this method will happily build a client for any URL, and the
|
|
1240
|
-
* client secret travels to whatever host it is given.
|
|
1241
|
-
*
|
|
1242
|
-
* @param apiUrl - The datacenter key or full accounts URL to build a client for.
|
|
1243
|
-
* @returns The memoized client context for that host.
|
|
1244
|
-
*/ key: "oauthClientContextForApiUrl",
|
|
1245
|
-
value: function oauthClientContextForApiUrl(apiUrl) {
|
|
1246
|
-
var resolvedApiUrl = zoho.zohoAccountsConfigApiUrl(apiUrl);
|
|
1247
|
-
var context = this._clients.get(resolvedApiUrl);
|
|
1248
|
-
if (context == null) {
|
|
1249
|
-
context = this._clientFactory({
|
|
1250
|
-
clientId: this.clientId,
|
|
1251
|
-
clientSecret: this._clientSecret,
|
|
1252
|
-
apiUrl: resolvedApiUrl
|
|
1253
|
-
}).oauthClientContext;
|
|
1254
|
-
this._clients.set(resolvedApiUrl, context);
|
|
1255
|
-
}
|
|
1256
|
-
return context;
|
|
1257
|
-
}
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
// MARK: Accessors
|
|
1261
|
-
/**
|
|
1262
|
-
* Exchanges a single-use authorization code for tokens.
|
|
1263
|
-
*
|
|
1264
|
-
* @param input - The code, the redirect URI it was issued against, and the optional accounts host.
|
|
1265
|
-
* @returns The Zoho token response. `refresh_token` may be absent on a re-consent.
|
|
1266
|
-
*/ key: "exchangeAuthorizationCode",
|
|
1267
|
-
value: function exchangeAuthorizationCode(input) {
|
|
1268
|
-
var code = input.code, redirectUri = input.redirectUri, accountsApiUrl = input.accountsApiUrl;
|
|
1269
|
-
var context = this.oauthClientContextForApiUrl(accountsApiUrl !== null && accountsApiUrl !== void 0 ? accountsApiUrl : this.apiUrl);
|
|
1270
|
-
return zoho.zohoAccountsRefreshTokenFromAuthorizationCode(context)({
|
|
1271
|
-
code: code,
|
|
1272
|
-
redirectUri: redirectUri
|
|
1273
|
-
});
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
{
|
|
1277
|
-
/**
|
|
1278
|
-
* Exchanges a user's refresh token for a new access token.
|
|
1279
|
-
*
|
|
1280
|
-
* Zoho does not rotate refresh tokens, so the token passed in stays valid and the response carries
|
|
1281
|
-
* no replacement — the caller keeps the one it already has. The response DOES carry `api_domain`,
|
|
1282
|
-
* which is the host the new access token is usable against, so persist it.
|
|
1283
|
-
*
|
|
1284
|
-
* @param input - The user's refresh token and the optional accounts host.
|
|
1285
|
-
* @returns The Zoho access token response.
|
|
1286
|
-
*/ key: "refreshUserAccessToken",
|
|
1287
|
-
value: function refreshUserAccessToken(input) {
|
|
1288
|
-
var refreshToken = input.refreshToken, accountsApiUrl = input.accountsApiUrl;
|
|
1289
|
-
var context = this.oauthClientContextForApiUrl(accountsApiUrl !== null && accountsApiUrl !== void 0 ? accountsApiUrl : this.apiUrl);
|
|
1290
|
-
return zoho.zohoAccountsUserAccessToken(context)({
|
|
1291
|
-
refreshToken: refreshToken
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
},
|
|
1295
|
-
{
|
|
1296
|
-
/**
|
|
1297
|
-
* Reads the Zoho identity an access token was issued to.
|
|
1298
|
-
*
|
|
1299
|
-
* @param input - The access token and the optional accounts host.
|
|
1300
|
-
* @returns The user info response.
|
|
1301
|
-
*/ key: "userInfo",
|
|
1302
|
-
value: function userInfo(input) {
|
|
1303
|
-
var accessToken = input.accessToken, accountsApiUrl = input.accountsApiUrl;
|
|
1304
|
-
var context = this.oauthClientContextForApiUrl(accountsApiUrl !== null && accountsApiUrl !== void 0 ? accountsApiUrl : this.apiUrl);
|
|
1305
|
-
return zoho.zohoAccountsUserInfo(context)({
|
|
1306
|
-
accessToken: accessToken
|
|
1307
|
-
});
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
]);
|
|
1311
|
-
return ZohoAccountsOAuthApi;
|
|
1312
|
-
}();
|
|
1313
|
-
exports.ZohoAccountsOAuthApi = __decorate([
|
|
1314
|
-
common.Injectable(),
|
|
1315
|
-
__param(0, common.Inject(ZohoAccountsOAuthServiceConfig))
|
|
1316
|
-
], exports.ZohoAccountsOAuthApi);
|
|
1317
|
-
|
|
1318
|
-
function _array_like_to_array$4(arr, len) {
|
|
1319
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
1320
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1321
|
-
return arr2;
|
|
1322
|
-
}
|
|
1323
|
-
function _array_without_holes$4(arr) {
|
|
1324
|
-
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
1325
|
-
}
|
|
1326
|
-
function _iterable_to_array$4(iter) {
|
|
1327
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1328
|
-
}
|
|
1329
|
-
function _non_iterable_spread$4() {
|
|
1330
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1331
|
-
}
|
|
1332
|
-
function _to_consumable_array$4(arr) {
|
|
1333
|
-
return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$4();
|
|
1334
|
-
}
|
|
1335
|
-
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
1336
|
-
if (!o) return;
|
|
1337
|
-
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
1338
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1339
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1340
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1341
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
1342
|
-
}
|
|
1343
|
-
/**
|
|
1344
|
-
* Convenience function used to generate ModuleMetadata for an app's ZohoAccountsOAuthModule.
|
|
1345
|
-
*
|
|
1346
|
-
* Unlike `appZohoCrmModuleMetadata`, this needs no `ZohoAccountsAccessTokenCacheService` and
|
|
1347
|
-
* therefore no dependency module: a per-user connect flow has no server token to cache.
|
|
1348
|
-
*
|
|
1349
|
-
* @param config - The module metadata configuration including an optional config factory.
|
|
1350
|
-
* @returns NestJS ModuleMetadata for registering the ZohoAccountsOAuthApi.
|
|
1351
|
-
*/ function appZohoAccountsOAuthModuleMetadata(config$1) {
|
|
1352
|
-
var _config_zohoAccountsOAuthServiceConfigFactory;
|
|
1353
|
-
var imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
1354
|
-
return {
|
|
1355
|
-
imports: [
|
|
1356
|
-
config.ConfigModule
|
|
1357
|
-
].concat(_to_consumable_array$4(imports !== null && imports !== void 0 ? imports : [])),
|
|
1358
|
-
exports: [
|
|
1359
|
-
exports.ZohoAccountsOAuthApi
|
|
1360
|
-
].concat(_to_consumable_array$4(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
1361
|
-
providers: [
|
|
1362
|
-
{
|
|
1363
|
-
provide: ZohoAccountsOAuthServiceConfig,
|
|
1364
|
-
inject: [
|
|
1365
|
-
config.ConfigService
|
|
1366
|
-
],
|
|
1367
|
-
useFactory: (_config_zohoAccountsOAuthServiceConfigFactory = config$1.zohoAccountsOAuthServiceConfigFactory) !== null && _config_zohoAccountsOAuthServiceConfigFactory !== void 0 ? _config_zohoAccountsOAuthServiceConfigFactory : zohoAccountsOAuthServiceConfigFactory
|
|
1368
|
-
},
|
|
1369
|
-
exports.ZohoAccountsOAuthApi
|
|
1370
|
-
].concat(_to_consumable_array$4(providers !== null && providers !== void 0 ? providers : []))
|
|
1371
|
-
};
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
function _class_call_check$b(instance, Constructor) {
|
|
1375
|
-
if (!(instance instanceof Constructor)) {
|
|
1376
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
function _defineProperties$a(target, props) {
|
|
1380
|
-
for(var i = 0; i < props.length; i++){
|
|
1381
|
-
var descriptor = props[i];
|
|
1382
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1383
|
-
descriptor.configurable = true;
|
|
1384
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1385
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
function _create_class$a(Constructor, protoProps, staticProps) {
|
|
1389
|
-
if (staticProps) _defineProperties$a(Constructor, staticProps);
|
|
1390
|
-
return Constructor;
|
|
1391
|
-
}
|
|
1392
|
-
function _define_property$b(obj, key, value) {
|
|
1393
|
-
if (key in obj) {
|
|
1394
|
-
Object.defineProperty(obj, key, {
|
|
1395
|
-
value: value,
|
|
1396
|
-
enumerable: true,
|
|
1397
|
-
configurable: true,
|
|
1398
|
-
writable: true
|
|
1399
|
-
});
|
|
1400
|
-
} else {
|
|
1401
|
-
obj[key] = value;
|
|
1402
|
-
}
|
|
1403
|
-
return obj;
|
|
1404
|
-
}
|
|
1405
|
-
/**
|
|
1406
|
-
* Abstract configuration class for the NestJS Zoho CRM service.
|
|
1407
|
-
*
|
|
1408
|
-
* Used as a DI token so that applications can provide their own config values
|
|
1409
|
-
* while keeping the expected shape consistent.
|
|
1410
|
-
*/ var ZohoCrmServiceConfig = /*#__PURE__*/ function() {
|
|
1411
|
-
function ZohoCrmServiceConfig() {
|
|
1412
|
-
_class_call_check$b(this, ZohoCrmServiceConfig);
|
|
1413
|
-
/**
|
|
1414
|
-
* Zoho CRM API connection settings (endpoint URL, etc.).
|
|
1415
|
-
*/ _define_property$b(this, "zohoCrm", void 0);
|
|
1416
|
-
/**
|
|
1417
|
-
* Optional factory-level overrides applied when creating the underlying CRM client.
|
|
1418
|
-
*/ _define_property$b(this, "factoryConfig", void 0);
|
|
1419
|
-
}
|
|
1420
|
-
_create_class$a(ZohoCrmServiceConfig, null, [
|
|
1421
|
-
{
|
|
1422
|
-
key: "assertValidConfig",
|
|
1423
|
-
value: /**
|
|
1424
|
-
* Validates that the required Zoho CRM connection fields are present and well-formed.
|
|
1425
|
-
*
|
|
1426
|
-
* @param config - The CRM service config to validate.
|
|
1427
|
-
*/ function assertValidConfig(config) {
|
|
1428
|
-
assertValidZohoConfig(config.zohoCrm);
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
]);
|
|
1432
|
-
return ZohoCrmServiceConfig;
|
|
1433
|
-
}
|
|
1434
|
-
();
|
|
1435
|
-
|
|
1436
|
-
function _class_call_check$a(instance, Constructor) {
|
|
1437
|
-
if (!(instance instanceof Constructor)) {
|
|
1438
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
function _defineProperties$9(target, props) {
|
|
1442
|
-
for(var i = 0; i < props.length; i++){
|
|
1443
|
-
var descriptor = props[i];
|
|
1444
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1445
|
-
descriptor.configurable = true;
|
|
1446
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1447
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
function _create_class$9(Constructor, protoProps, staticProps) {
|
|
1451
|
-
if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
|
|
1452
|
-
return Constructor;
|
|
1453
|
-
}
|
|
1454
|
-
function _define_property$a(obj, key, value) {
|
|
1455
|
-
if (key in obj) {
|
|
1456
|
-
Object.defineProperty(obj, key, {
|
|
1457
|
-
value: value,
|
|
1458
|
-
enumerable: true,
|
|
1459
|
-
configurable: true,
|
|
1460
|
-
writable: true
|
|
1461
|
-
});
|
|
1462
|
-
} else {
|
|
1463
|
-
obj[key] = value;
|
|
1464
|
-
}
|
|
1465
|
-
return obj;
|
|
1466
|
-
}
|
|
1467
|
-
function _object_spread$4(target) {
|
|
1468
|
-
for(var i = 1; i < arguments.length; i++){
|
|
1469
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1470
|
-
var ownKeys = Object.keys(source);
|
|
1471
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1472
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1473
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1474
|
-
}));
|
|
1475
|
-
}
|
|
1476
|
-
ownKeys.forEach(function(key) {
|
|
1477
|
-
_define_property$a(target, key, source[key]);
|
|
1478
|
-
});
|
|
1479
|
-
}
|
|
1480
|
-
return target;
|
|
1481
|
-
}
|
|
1482
|
-
function ownKeys$4(object, enumerableOnly) {
|
|
1483
|
-
var keys = Object.keys(object);
|
|
1484
|
-
if (Object.getOwnPropertySymbols) {
|
|
1485
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1486
|
-
keys.push.apply(keys, symbols);
|
|
1487
|
-
}
|
|
1488
|
-
return keys;
|
|
1489
|
-
}
|
|
1490
|
-
function _object_spread_props$4(target, source) {
|
|
1491
|
-
source = source != null ? source : {};
|
|
1492
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
1493
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1494
|
-
} else {
|
|
1495
|
-
ownKeys$4(Object(source)).forEach(function(key) {
|
|
1496
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
return target;
|
|
1500
|
-
}
|
|
1501
|
-
/**
|
|
1502
|
-
* NestJS injectable service that wraps the Zoho CRM API.
|
|
1503
|
-
*
|
|
1504
|
-
* Provides convenient accessor getters for all CRM operations, each bound
|
|
1505
|
-
* to the authenticated CRM context created during construction.
|
|
1506
|
-
*/ exports.ZohoCrmApi = /*#__PURE__*/ function() {
|
|
1507
|
-
function ZohoCrmApi(config, zohoAccountsApi) {
|
|
1508
|
-
_class_call_check$a(this, ZohoCrmApi);
|
|
1509
|
-
_define_property$a(this, "config", void 0);
|
|
1510
|
-
_define_property$a(this, "zohoAccountsApi", void 0);
|
|
1511
|
-
/**
|
|
1512
|
-
* Underlying Zoho CRM client instance, initialized from the injected config and accounts context.
|
|
1513
|
-
*/ _define_property$a(this, "zohoCrm", void 0);
|
|
1514
|
-
this.config = config;
|
|
1515
|
-
this.zohoAccountsApi = zohoAccountsApi;
|
|
1516
|
-
this.zohoCrm = zoho.zohoCrmFactory(_object_spread_props$4(_object_spread$4({}, config.factoryConfig), {
|
|
1517
|
-
accountsContext: zohoAccountsApi.accountsContext
|
|
1518
|
-
}))(config.zohoCrm);
|
|
1519
|
-
}
|
|
1520
|
-
_create_class$9(ZohoCrmApi, [
|
|
1521
|
-
{
|
|
1522
|
-
key: "crmContext",
|
|
1523
|
-
get: /**
|
|
1524
|
-
* The authenticated CRM context used by all operation accessors.
|
|
1525
|
-
*
|
|
1526
|
-
* @returns The CRM context from the underlying client.
|
|
1527
|
-
*/ function get() {
|
|
1528
|
-
return this.zohoCrm.crmContext;
|
|
1529
|
-
}
|
|
1530
|
-
},
|
|
1531
|
-
{
|
|
1532
|
-
key: "zohoRateLimiter",
|
|
1533
|
-
get: /**
|
|
1534
|
-
* Rate limiter shared across all CRM requests to respect Zoho API quotas.
|
|
1535
|
-
*
|
|
1536
|
-
* @returns The shared rate limiter instance.
|
|
1537
|
-
*/ function get() {
|
|
1538
|
-
return this.zohoCrm.crmContext.zohoRateLimiter;
|
|
1539
|
-
}
|
|
1540
|
-
},
|
|
1541
|
-
{
|
|
1542
|
-
key: "insertRecord",
|
|
1543
|
-
get: // MARK: Accessors
|
|
1544
|
-
/**
|
|
1545
|
-
* Configured pass-through for {@link zohoCrmInsertRecord}.
|
|
1546
|
-
*
|
|
1547
|
-
* @returns Bound insert record function.
|
|
1548
|
-
*/ function get() {
|
|
1549
|
-
return zoho.zohoCrmInsertRecord(this.crmContext);
|
|
1550
|
-
}
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
key: "upsertRecord",
|
|
1554
|
-
get: /**
|
|
1555
|
-
* Configured pass-through for {@link zohoCrmUpsertRecord}.
|
|
1556
|
-
*
|
|
1557
|
-
* @returns Bound upsert record function.
|
|
1558
|
-
*/ function get() {
|
|
1559
|
-
return zoho.zohoCrmUpsertRecord(this.crmContext);
|
|
1560
|
-
}
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
key: "updateRecord",
|
|
1564
|
-
get: /**
|
|
1565
|
-
* Configured pass-through for {@link zohoCrmUpdateRecord}.
|
|
1566
|
-
*
|
|
1567
|
-
* @returns Bound update record function.
|
|
1568
|
-
*/ function get() {
|
|
1569
|
-
return zoho.zohoCrmUpdateRecord(this.crmContext);
|
|
1570
|
-
}
|
|
1571
|
-
},
|
|
1572
|
-
{
|
|
1573
|
-
key: "deleteRecord",
|
|
1574
|
-
get: /**
|
|
1575
|
-
* Configured pass-through for {@link zohoCrmDeleteRecord}.
|
|
1576
|
-
*
|
|
1577
|
-
* @returns Bound delete record function.
|
|
1578
|
-
*/ function get() {
|
|
1579
|
-
return zoho.zohoCrmDeleteRecord(this.crmContext);
|
|
1580
|
-
}
|
|
1581
|
-
},
|
|
1582
|
-
{
|
|
1583
|
-
key: "getRecordById",
|
|
1584
|
-
get: /**
|
|
1585
|
-
* Configured pass-through for {@link zohoCrmGetRecordById}.
|
|
1586
|
-
*
|
|
1587
|
-
* @returns Bound get record by ID function.
|
|
1588
|
-
*/ function get() {
|
|
1589
|
-
return zoho.zohoCrmGetRecordById(this.crmContext);
|
|
1590
|
-
}
|
|
1591
|
-
},
|
|
1592
|
-
{
|
|
1593
|
-
key: "getRecords",
|
|
1594
|
-
get: /**
|
|
1595
|
-
* Configured pass-through for {@link zohoCrmGetRecords}.
|
|
1596
|
-
*
|
|
1597
|
-
* @returns Bound get records function.
|
|
1598
|
-
*/ function get() {
|
|
1599
|
-
return zoho.zohoCrmGetRecords(this.crmContext);
|
|
1600
|
-
}
|
|
1601
|
-
},
|
|
1602
|
-
{
|
|
1603
|
-
key: "searchRecords",
|
|
1604
|
-
get: /**
|
|
1605
|
-
* Configured pass-through for {@link zohoCrmSearchRecords}.
|
|
1606
|
-
*
|
|
1607
|
-
* @returns Bound search records function.
|
|
1608
|
-
*/ function get() {
|
|
1609
|
-
return zoho.zohoCrmSearchRecords(this.crmContext);
|
|
1610
|
-
}
|
|
1611
|
-
},
|
|
1612
|
-
{
|
|
1613
|
-
key: "searchRecordsPageFactory",
|
|
1614
|
-
get: /**
|
|
1615
|
-
* Configured pass-through for {@link zohoCrmSearchRecordsPageFactory}.
|
|
1616
|
-
*
|
|
1617
|
-
* @returns Bound search records page factory function.
|
|
1618
|
-
*/ function get() {
|
|
1619
|
-
return zoho.zohoCrmSearchRecordsPageFactory(this.crmContext);
|
|
1620
|
-
}
|
|
1621
|
-
},
|
|
1622
|
-
{
|
|
1623
|
-
key: "getRelatedRecordsFunctionFactory",
|
|
1624
|
-
get: /**
|
|
1625
|
-
* Configured pass-through for {@link zohoCrmGetRelatedRecordsFunctionFactory}.
|
|
1626
|
-
*
|
|
1627
|
-
* @returns Bound get related records factory function.
|
|
1628
|
-
*/ function get() {
|
|
1629
|
-
return zoho.zohoCrmGetRelatedRecordsFunctionFactory(this.crmContext);
|
|
1630
|
-
}
|
|
1631
|
-
},
|
|
1632
|
-
{
|
|
1633
|
-
key: "getEmailsForRecord",
|
|
1634
|
-
get: /**
|
|
1635
|
-
* Configured pass-through for {@link zohoCrmGetEmailsForRecord}.
|
|
1636
|
-
*
|
|
1637
|
-
* @returns Bound get emails for record function.
|
|
1638
|
-
*/ function get() {
|
|
1639
|
-
return zoho.zohoCrmGetEmailsForRecord(this.crmContext);
|
|
1640
|
-
}
|
|
1641
|
-
},
|
|
1642
|
-
{
|
|
1643
|
-
key: "getEmailsForRecordPageFactory",
|
|
1644
|
-
get: /**
|
|
1645
|
-
* Configured pass-through for {@link zohoCrmGetEmailsForRecordPageFactory}.
|
|
1646
|
-
*
|
|
1647
|
-
* @returns Bound get emails page factory function.
|
|
1648
|
-
*/ function get() {
|
|
1649
|
-
return zoho.zohoCrmGetEmailsForRecordPageFactory(this.crmContext);
|
|
1650
|
-
}
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
key: "getAttachmentsForRecord",
|
|
1654
|
-
get: /**
|
|
1655
|
-
* Configured pass-through for {@link zohoCrmGetAttachmentsForRecord}.
|
|
1656
|
-
*
|
|
1657
|
-
* @returns Bound get attachments for record function.
|
|
1658
|
-
*/ function get() {
|
|
1659
|
-
return zoho.zohoCrmGetAttachmentsForRecord(this.crmContext);
|
|
1660
|
-
}
|
|
1661
|
-
},
|
|
1662
|
-
{
|
|
1663
|
-
key: "getAttachmentsForRecordPageFactory",
|
|
1664
|
-
get: /**
|
|
1665
|
-
* Configured pass-through for {@link zohoCrmGetAttachmentsForRecordPageFactory}.
|
|
1666
|
-
*
|
|
1667
|
-
* @returns Bound get attachments page factory function.
|
|
1668
|
-
*/ function get() {
|
|
1669
|
-
return zoho.zohoCrmGetAttachmentsForRecordPageFactory(this.crmContext);
|
|
1670
|
-
}
|
|
1671
|
-
},
|
|
1672
|
-
{
|
|
1673
|
-
key: "uploadAttachmentForRecord",
|
|
1674
|
-
get: /**
|
|
1675
|
-
* Configured pass-through for {@link zohoCrmUploadAttachmentForRecord}.
|
|
1676
|
-
*
|
|
1677
|
-
* @returns Bound upload attachment function.
|
|
1678
|
-
*/ function get() {
|
|
1679
|
-
return zoho.zohoCrmUploadAttachmentForRecord(this.crmContext);
|
|
1680
|
-
}
|
|
1681
|
-
},
|
|
1682
|
-
{
|
|
1683
|
-
key: "downloadAttachmentForRecord",
|
|
1684
|
-
get: /**
|
|
1685
|
-
* Configured pass-through for {@link zohoCrmDownloadAttachmentForRecord}.
|
|
1686
|
-
*
|
|
1687
|
-
* @returns Bound download attachment function.
|
|
1688
|
-
*/ function get() {
|
|
1689
|
-
return zoho.zohoCrmDownloadAttachmentForRecord(this.crmContext);
|
|
1690
|
-
}
|
|
1691
|
-
},
|
|
1692
|
-
{
|
|
1693
|
-
key: "deleteAttachmentFromRecord",
|
|
1694
|
-
get: /**
|
|
1695
|
-
* Configured pass-through for {@link zohoCrmDeleteAttachmentFromRecord}.
|
|
1696
|
-
*
|
|
1697
|
-
* @returns Bound delete attachment function.
|
|
1698
|
-
*/ function get() {
|
|
1699
|
-
return zoho.zohoCrmDeleteAttachmentFromRecord(this.crmContext);
|
|
1700
|
-
}
|
|
1701
|
-
},
|
|
1702
|
-
{
|
|
1703
|
-
key: "createNotes",
|
|
1704
|
-
get: /**
|
|
1705
|
-
* Configured pass-through for {@link zohoCrmCreateNotes}.
|
|
1706
|
-
*
|
|
1707
|
-
* @returns Bound create notes function.
|
|
1708
|
-
*/ function get() {
|
|
1709
|
-
return zoho.zohoCrmCreateNotes(this.crmContext);
|
|
1710
|
-
}
|
|
1711
|
-
},
|
|
1712
|
-
{
|
|
1713
|
-
key: "deleteNotes",
|
|
1714
|
-
get: /**
|
|
1715
|
-
* Configured pass-through for {@link zohoCrmDeleteNotes}.
|
|
1716
|
-
*
|
|
1717
|
-
* @returns Bound delete notes function.
|
|
1718
|
-
*/ function get() {
|
|
1719
|
-
return zoho.zohoCrmDeleteNotes(this.crmContext);
|
|
1720
|
-
}
|
|
1721
|
-
},
|
|
1722
|
-
{
|
|
1723
|
-
key: "createNotesForRecord",
|
|
1724
|
-
get: /**
|
|
1725
|
-
* Configured pass-through for {@link zohoCrmCreateNotesForRecord}.
|
|
1726
|
-
*
|
|
1727
|
-
* @returns Bound create notes for record function.
|
|
1728
|
-
*/ function get() {
|
|
1729
|
-
return zoho.zohoCrmCreateNotesForRecord(this.crmContext);
|
|
1730
|
-
}
|
|
1731
|
-
},
|
|
1732
|
-
{
|
|
1733
|
-
key: "getNotesForRecord",
|
|
1734
|
-
get: /**
|
|
1735
|
-
* Configured pass-through for {@link zohoCrmGetNotesForRecord}.
|
|
1736
|
-
*
|
|
1737
|
-
* @returns Bound get notes for record function.
|
|
1738
|
-
*/ function get() {
|
|
1739
|
-
return zoho.zohoCrmGetNotesForRecord(this.crmContext);
|
|
1740
|
-
}
|
|
1741
|
-
},
|
|
1742
|
-
{
|
|
1743
|
-
key: "getNotesForRecordPageFactory",
|
|
1744
|
-
get: /**
|
|
1745
|
-
* Configured pass-through for {@link zohoCrmGetNotesForRecordPageFactory}.
|
|
1746
|
-
*
|
|
1747
|
-
* @returns Bound get notes page factory function.
|
|
1748
|
-
*/ function get() {
|
|
1749
|
-
return zoho.zohoCrmGetNotesForRecordPageFactory(this.crmContext);
|
|
1750
|
-
}
|
|
1751
|
-
},
|
|
1752
|
-
{
|
|
1753
|
-
key: "executeRestApiFunction",
|
|
1754
|
-
get: /**
|
|
1755
|
-
* Configured pass-through for {@link zohoCrmExecuteRestApiFunction}.
|
|
1756
|
-
*
|
|
1757
|
-
* @returns Bound execute REST API function.
|
|
1758
|
-
*/ function get() {
|
|
1759
|
-
return zoho.zohoCrmExecuteRestApiFunction(this.crmContext);
|
|
1760
|
-
}
|
|
1761
|
-
},
|
|
1762
|
-
{
|
|
1763
|
-
key: "createTagsForModule",
|
|
1764
|
-
get: /**
|
|
1765
|
-
* Configured pass-through for {@link zohoCrmCreateTagsForModule}.
|
|
1766
|
-
*
|
|
1767
|
-
* @returns Bound create tags for module function.
|
|
1768
|
-
*/ function get() {
|
|
1769
|
-
return zoho.zohoCrmCreateTagsForModule(this.crmContext);
|
|
1770
|
-
}
|
|
1771
|
-
},
|
|
1772
|
-
{
|
|
1773
|
-
key: "deleteTag",
|
|
1774
|
-
get: /**
|
|
1775
|
-
* Configured pass-through for {@link zohoCrmDeleteTag}.
|
|
1776
|
-
*
|
|
1777
|
-
* @returns Bound delete tag function.
|
|
1778
|
-
*/ function get() {
|
|
1779
|
-
return zoho.zohoCrmDeleteTag(this.crmContext);
|
|
1780
|
-
}
|
|
1781
|
-
},
|
|
1782
|
-
{
|
|
1783
|
-
key: "getTagsForModule",
|
|
1784
|
-
get: /**
|
|
1785
|
-
* Configured pass-through for {@link zohoCrmGetTagsForModule}.
|
|
1786
|
-
*
|
|
1787
|
-
* @returns Bound get tags for module function.
|
|
1788
|
-
*/ function get() {
|
|
1789
|
-
return zoho.zohoCrmGetTagsForModule(this.crmContext);
|
|
1790
|
-
}
|
|
1791
|
-
},
|
|
1792
|
-
{
|
|
1793
|
-
key: "addTagsToRecords",
|
|
1794
|
-
get: /**
|
|
1795
|
-
* Configured pass-through for {@link zohoCrmAddTagsToRecords}.
|
|
1796
|
-
*
|
|
1797
|
-
* @returns Bound add tags to records function.
|
|
1798
|
-
*/ function get() {
|
|
1799
|
-
return zoho.zohoCrmAddTagsToRecords(this.crmContext);
|
|
1800
|
-
}
|
|
1801
|
-
},
|
|
1802
|
-
{
|
|
1803
|
-
key: "removeTagsFromRecords",
|
|
1804
|
-
get: /**
|
|
1805
|
-
* Configured pass-through for {@link zohoCrmRemoveTagsFromRecords}.
|
|
1806
|
-
*
|
|
1807
|
-
* @returns Bound remove tags from records function.
|
|
1808
|
-
*/ function get() {
|
|
1809
|
-
return zoho.zohoCrmRemoveTagsFromRecords(this.crmContext);
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
]);
|
|
1813
|
-
return ZohoCrmApi;
|
|
1814
|
-
}();
|
|
1815
|
-
exports.ZohoCrmApi = __decorate([
|
|
1816
|
-
common.Injectable(),
|
|
1817
|
-
__param(0, common.Inject(ZohoCrmServiceConfig)),
|
|
1818
|
-
__param(1, common.Inject(exports.ZohoAccountsApi))
|
|
1819
|
-
], exports.ZohoCrmApi);
|
|
1820
|
-
|
|
1821
|
-
function _array_like_to_array$3(arr, len) {
|
|
1822
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
1823
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1824
|
-
return arr2;
|
|
1825
|
-
}
|
|
1826
|
-
function _array_without_holes$3(arr) {
|
|
1827
|
-
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
1828
|
-
}
|
|
1829
|
-
function _iterable_to_array$3(iter) {
|
|
1830
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1831
|
-
}
|
|
1832
|
-
function _non_iterable_spread$3() {
|
|
1833
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1834
|
-
}
|
|
1835
|
-
function _to_consumable_array$3(arr) {
|
|
1836
|
-
return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$3();
|
|
1837
|
-
}
|
|
1838
|
-
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
1839
|
-
if (!o) return;
|
|
1840
|
-
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
1841
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1842
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1843
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1844
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
1845
|
-
}
|
|
1846
|
-
// MARK: Provider Factories
|
|
1847
|
-
/**
|
|
1848
|
-
* Reads Zoho CRM connection settings from the NestJS ConfigService
|
|
1849
|
-
* and returns a validated service config.
|
|
1850
|
-
*
|
|
1851
|
-
* Resolves the API URL via environment variables following the naming convention
|
|
1852
|
-
* `ZOHO_CRM_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
1853
|
-
*
|
|
1854
|
-
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
1855
|
-
* @returns Validated Zoho CRM service configuration.
|
|
1856
|
-
* @throws {Error} If required config values (e.g. API URL) are missing.
|
|
1857
|
-
*
|
|
1858
|
-
* @example
|
|
1859
|
-
* ```typescript
|
|
1860
|
-
* {
|
|
1861
|
-
* provide: ZohoCrmServiceConfig,
|
|
1862
|
-
* inject: [ConfigService],
|
|
1863
|
-
* useFactory: zohoCrmServiceConfigFactory
|
|
1864
|
-
* }
|
|
1865
|
-
* ```
|
|
1866
|
-
*/ function zohoCrmServiceConfigFactory(configService) {
|
|
1867
|
-
var getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_CRM_SERVICE_NAME, configService);
|
|
1868
|
-
var config = {
|
|
1869
|
-
zohoCrm: {
|
|
1870
|
-
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
|
-
ZohoCrmServiceConfig.assertValidConfig(config);
|
|
1874
|
-
return config;
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* Reads Zoho Accounts (OAuth) settings scoped to the CRM service from
|
|
1878
|
-
* the NestJS ConfigService and returns an accounts service config.
|
|
1879
|
-
*
|
|
1880
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
1881
|
-
* @returns Zoho Accounts service config scoped to the CRM service access token.
|
|
1882
|
-
*
|
|
1883
|
-
* @example
|
|
1884
|
-
* ```typescript
|
|
1885
|
-
* {
|
|
1886
|
-
* provide: ZohoAccountsServiceConfig,
|
|
1887
|
-
* inject: [ConfigService],
|
|
1888
|
-
* useFactory: zohoCrmAccountServiceConfigFactory
|
|
1889
|
-
* }
|
|
1890
|
-
* ```
|
|
1891
|
-
*/ function zohoCrmAccountServiceConfigFactory(configService) {
|
|
1892
|
-
return zohoAccountsServiceConfigFromConfigService({
|
|
1893
|
-
configService: configService,
|
|
1894
|
-
serviceAccessTokenKey: zoho.ZOHO_CRM_SERVICE_NAME
|
|
1895
|
-
});
|
|
1896
|
-
}
|
|
1897
|
-
/**
|
|
1898
|
-
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho CRM stack
|
|
1899
|
-
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
1900
|
-
*
|
|
1901
|
-
* The generated module requires the following dependencies in order to initialize properly:
|
|
1902
|
-
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
1903
|
-
*
|
|
1904
|
-
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
1905
|
-
*
|
|
1906
|
-
* The returned metadata registers {@link ZohoCrmServiceConfig}, {@link ZohoCrmApi},
|
|
1907
|
-
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
1908
|
-
* exports {@link ZohoCrmApi} by default. Additional imports, exports, and providers
|
|
1909
|
-
* from the config are merged in.
|
|
1910
|
-
*
|
|
1911
|
-
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
1912
|
-
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
1913
|
-
*
|
|
1914
|
-
* @Module ({
|
|
1915
|
-
* providers: [
|
|
1916
|
-
* {
|
|
1917
|
-
* provide: ZohoAccountsAccessTokenCacheService,
|
|
1918
|
-
* useValue: cacheService
|
|
1919
|
-
* }
|
|
1920
|
-
* ],
|
|
1921
|
-
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
1922
|
-
* })
|
|
1923
|
-
* export class ZohoCrmDependencyModule {}
|
|
1924
|
-
* @Module (appZohoCrmModuleMetadata({ dependencyModule: ZohoCrmDependencyModule }))
|
|
1925
|
-
* export class AppZohoCrmModule {}
|
|
1926
|
-
* ```
|
|
1927
|
-
*
|
|
1928
|
-
* @example
|
|
1929
|
-
* ```typescript
|
|
1930
|
-
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
1931
|
-
*/ function appZohoCrmModuleMetadata(config$1) {
|
|
1932
|
-
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
1933
|
-
var dependencyModuleImport = dependencyModule ? [
|
|
1934
|
-
dependencyModule
|
|
1935
|
-
] : [];
|
|
1936
|
-
return {
|
|
1937
|
-
imports: [
|
|
1938
|
-
config.ConfigModule
|
|
1939
|
-
].concat(_to_consumable_array$3(dependencyModuleImport), _to_consumable_array$3(imports !== null && imports !== void 0 ? imports : [])),
|
|
1940
|
-
exports: [
|
|
1941
|
-
exports.ZohoCrmApi
|
|
1942
|
-
].concat(_to_consumable_array$3(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
1943
|
-
providers: [
|
|
1944
|
-
{
|
|
1945
|
-
provide: ZohoCrmServiceConfig,
|
|
1946
|
-
inject: [
|
|
1947
|
-
config.ConfigService
|
|
1948
|
-
],
|
|
1949
|
-
useFactory: zohoCrmServiceConfigFactory
|
|
1950
|
-
},
|
|
1951
|
-
exports.ZohoCrmApi,
|
|
1952
|
-
// Accounts
|
|
1953
|
-
{
|
|
1954
|
-
provide: ZohoAccountsServiceConfig,
|
|
1955
|
-
inject: [
|
|
1956
|
-
config.ConfigService
|
|
1957
|
-
],
|
|
1958
|
-
useFactory: zohoCrmAccountServiceConfigFactory
|
|
1959
|
-
},
|
|
1960
|
-
exports.ZohoAccountsApi
|
|
1961
|
-
].concat(_to_consumable_array$3(providers !== null && providers !== void 0 ? providers : []))
|
|
1962
|
-
};
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
function _class_call_check$9(instance, Constructor) {
|
|
1966
|
-
if (!(instance instanceof Constructor)) {
|
|
1967
|
-
throw new TypeError("Cannot call a class as a function");
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
function _defineProperties$8(target, props) {
|
|
1971
|
-
for(var i = 0; i < props.length; i++){
|
|
1972
|
-
var descriptor = props[i];
|
|
1973
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
1974
|
-
descriptor.configurable = true;
|
|
1975
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
1976
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
function _create_class$8(Constructor, protoProps, staticProps) {
|
|
1980
|
-
if (staticProps) _defineProperties$8(Constructor, staticProps);
|
|
1981
|
-
return Constructor;
|
|
1982
|
-
}
|
|
1983
|
-
function _define_property$9(obj, key, value) {
|
|
1984
|
-
if (key in obj) {
|
|
1985
|
-
Object.defineProperty(obj, key, {
|
|
1986
|
-
value: value,
|
|
1987
|
-
enumerable: true,
|
|
1988
|
-
configurable: true,
|
|
1989
|
-
writable: true
|
|
1990
|
-
});
|
|
1991
|
-
} else {
|
|
1992
|
-
obj[key] = value;
|
|
1993
|
-
}
|
|
1994
|
-
return obj;
|
|
1995
|
-
}
|
|
1996
|
-
/**
|
|
1997
|
-
* Abstract configuration class for the NestJS Zoho Recruit service.
|
|
1998
|
-
*
|
|
1999
|
-
* Used as a DI token so that applications can provide their own config values
|
|
2000
|
-
* while keeping the expected shape consistent.
|
|
2001
|
-
*/ var ZohoRecruitServiceConfig = /*#__PURE__*/ function() {
|
|
2002
|
-
function ZohoRecruitServiceConfig() {
|
|
2003
|
-
_class_call_check$9(this, ZohoRecruitServiceConfig);
|
|
2004
|
-
/**
|
|
2005
|
-
* Zoho Recruit API connection settings (endpoint URL, etc.).
|
|
2006
|
-
*/ _define_property$9(this, "zohoRecruit", void 0);
|
|
2007
|
-
/**
|
|
2008
|
-
* Optional factory-level overrides applied when creating the underlying Recruit client.
|
|
2009
|
-
*/ _define_property$9(this, "factoryConfig", void 0);
|
|
2010
|
-
}
|
|
2011
|
-
_create_class$8(ZohoRecruitServiceConfig, null, [
|
|
2012
|
-
{
|
|
2013
|
-
key: "assertValidConfig",
|
|
2014
|
-
value: /**
|
|
2015
|
-
* Validates that the required Zoho Recruit connection fields are present and well-formed.
|
|
2016
|
-
*
|
|
2017
|
-
* @param config - The Recruit service config to validate.
|
|
2018
|
-
*/ function assertValidConfig(config) {
|
|
2019
|
-
assertValidZohoConfig(config.zohoRecruit);
|
|
2020
|
-
}
|
|
2021
|
-
}
|
|
2022
|
-
]);
|
|
2023
|
-
return ZohoRecruitServiceConfig;
|
|
2024
|
-
}
|
|
2025
|
-
();
|
|
2026
|
-
|
|
2027
|
-
function _class_call_check$8(instance, Constructor) {
|
|
2028
|
-
if (!(instance instanceof Constructor)) {
|
|
2029
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
function _defineProperties$7(target, props) {
|
|
2033
|
-
for(var i = 0; i < props.length; i++){
|
|
2034
|
-
var descriptor = props[i];
|
|
2035
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
2036
|
-
descriptor.configurable = true;
|
|
2037
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
2038
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2039
|
-
}
|
|
2040
|
-
}
|
|
2041
|
-
function _create_class$7(Constructor, protoProps, staticProps) {
|
|
2042
|
-
if (protoProps) _defineProperties$7(Constructor.prototype, protoProps);
|
|
2043
|
-
return Constructor;
|
|
2044
|
-
}
|
|
2045
|
-
function _define_property$8(obj, key, value) {
|
|
2046
|
-
if (key in obj) {
|
|
2047
|
-
Object.defineProperty(obj, key, {
|
|
2048
|
-
value: value,
|
|
2049
|
-
enumerable: true,
|
|
2050
|
-
configurable: true,
|
|
2051
|
-
writable: true
|
|
2052
|
-
});
|
|
2053
|
-
} else {
|
|
2054
|
-
obj[key] = value;
|
|
2055
|
-
}
|
|
2056
|
-
return obj;
|
|
2057
|
-
}
|
|
2058
|
-
function _object_spread$3(target) {
|
|
2059
|
-
for(var i = 1; i < arguments.length; i++){
|
|
2060
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2061
|
-
var ownKeys = Object.keys(source);
|
|
2062
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2063
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2064
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2065
|
-
}));
|
|
2066
|
-
}
|
|
2067
|
-
ownKeys.forEach(function(key) {
|
|
2068
|
-
_define_property$8(target, key, source[key]);
|
|
2069
|
-
});
|
|
2070
|
-
}
|
|
2071
|
-
return target;
|
|
2072
|
-
}
|
|
2073
|
-
function ownKeys$3(object, enumerableOnly) {
|
|
2074
|
-
var keys = Object.keys(object);
|
|
2075
|
-
if (Object.getOwnPropertySymbols) {
|
|
2076
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2077
|
-
keys.push.apply(keys, symbols);
|
|
2078
|
-
}
|
|
2079
|
-
return keys;
|
|
2080
|
-
}
|
|
2081
|
-
function _object_spread_props$3(target, source) {
|
|
2082
|
-
source = source != null ? source : {};
|
|
2083
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
2084
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2085
|
-
} else {
|
|
2086
|
-
ownKeys$3(Object(source)).forEach(function(key) {
|
|
2087
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2088
|
-
});
|
|
2089
|
-
}
|
|
2090
|
-
return target;
|
|
2091
|
-
}
|
|
2092
|
-
/**
|
|
2093
|
-
* NestJS injectable service that wraps the Zoho Recruit API.
|
|
2094
|
-
*
|
|
2095
|
-
* Provides convenient accessor getters for all Recruit operations, each bound
|
|
2096
|
-
* to the authenticated Recruit context created during construction.
|
|
2097
|
-
*/ exports.ZohoRecruitApi = /*#__PURE__*/ function() {
|
|
2098
|
-
function ZohoRecruitApi(config, zohoAccountsApi) {
|
|
2099
|
-
_class_call_check$8(this, ZohoRecruitApi);
|
|
2100
|
-
_define_property$8(this, "config", void 0);
|
|
2101
|
-
_define_property$8(this, "zohoAccountsApi", void 0);
|
|
2102
|
-
/**
|
|
2103
|
-
* Underlying Zoho Recruit client instance, initialized from the injected config and accounts context.
|
|
2104
|
-
*/ _define_property$8(this, "zohoRecruit", void 0);
|
|
2105
|
-
this.config = config;
|
|
2106
|
-
this.zohoAccountsApi = zohoAccountsApi;
|
|
2107
|
-
this.zohoRecruit = zoho.zohoRecruitFactory(_object_spread_props$3(_object_spread$3({}, config.factoryConfig), {
|
|
2108
|
-
accountsContext: zohoAccountsApi.accountsContext
|
|
2109
|
-
}))(config.zohoRecruit);
|
|
2110
|
-
}
|
|
2111
|
-
_create_class$7(ZohoRecruitApi, [
|
|
2112
|
-
{
|
|
2113
|
-
key: "recruitContext",
|
|
2114
|
-
get: /**
|
|
2115
|
-
* The authenticated Recruit context used by all operation accessors.
|
|
2116
|
-
*
|
|
2117
|
-
* @returns The Recruit context from the underlying client.
|
|
2118
|
-
*/ function get() {
|
|
2119
|
-
return this.zohoRecruit.recruitContext;
|
|
2120
|
-
}
|
|
2121
|
-
},
|
|
2122
|
-
{
|
|
2123
|
-
key: "zohoRateLimiter",
|
|
2124
|
-
get: /**
|
|
2125
|
-
* Rate limiter shared across all Recruit requests to respect Zoho API quotas.
|
|
2126
|
-
*
|
|
2127
|
-
* @returns The shared rate limiter instance.
|
|
2128
|
-
*/ function get() {
|
|
2129
|
-
return this.zohoRecruit.recruitContext.zohoRateLimiter;
|
|
2130
|
-
}
|
|
2131
|
-
},
|
|
2132
|
-
{
|
|
2133
|
-
key: "insertRecord",
|
|
2134
|
-
get: // MARK: Accessors
|
|
2135
|
-
/**
|
|
2136
|
-
* Configured pass-through for {@link zohoRecruitInsertRecord}.
|
|
2137
|
-
*
|
|
2138
|
-
* @returns Bound insert record function.
|
|
2139
|
-
*/ function get() {
|
|
2140
|
-
return zoho.zohoRecruitInsertRecord(this.recruitContext);
|
|
2141
|
-
}
|
|
2142
|
-
},
|
|
2143
|
-
{
|
|
2144
|
-
key: "upsertRecord",
|
|
2145
|
-
get: /**
|
|
2146
|
-
* Configured pass-through for {@link zohoRecruitUpsertRecord}.
|
|
2147
|
-
*
|
|
2148
|
-
* @returns Bound upsert record function.
|
|
2149
|
-
*/ function get() {
|
|
2150
|
-
return zoho.zohoRecruitUpsertRecord(this.recruitContext);
|
|
2151
|
-
}
|
|
2152
|
-
},
|
|
2153
|
-
{
|
|
2154
|
-
key: "updateRecord",
|
|
2155
|
-
get: /**
|
|
2156
|
-
* Configured pass-through for {@link zohoRecruitUpdateRecord}.
|
|
2157
|
-
*
|
|
2158
|
-
* @returns Bound update record function.
|
|
2159
|
-
*/ function get() {
|
|
2160
|
-
return zoho.zohoRecruitUpdateRecord(this.recruitContext);
|
|
2161
|
-
}
|
|
2162
|
-
},
|
|
2163
|
-
{
|
|
2164
|
-
key: "deleteRecord",
|
|
2165
|
-
get: /**
|
|
2166
|
-
* Configured pass-through for {@link zohoRecruitDeleteRecord}.
|
|
2167
|
-
*
|
|
2168
|
-
* @returns Bound delete record function.
|
|
2169
|
-
*/ function get() {
|
|
2170
|
-
return zoho.zohoRecruitDeleteRecord(this.recruitContext);
|
|
2171
|
-
}
|
|
2172
|
-
},
|
|
2173
|
-
{
|
|
2174
|
-
key: "getRecordById",
|
|
2175
|
-
get: /**
|
|
2176
|
-
* Configured pass-through for {@link zohoRecruitGetRecordById}.
|
|
2177
|
-
*
|
|
2178
|
-
* @returns Bound get record by ID function.
|
|
2179
|
-
*/ function get() {
|
|
2180
|
-
return zoho.zohoRecruitGetRecordById(this.recruitContext);
|
|
2181
|
-
}
|
|
2182
|
-
},
|
|
2183
|
-
{
|
|
2184
|
-
key: "getRecords",
|
|
2185
|
-
get: /**
|
|
2186
|
-
* Configured pass-through for {@link zohoRecruitGetRecords}.
|
|
2187
|
-
*
|
|
2188
|
-
* @returns Bound get records function.
|
|
2189
|
-
*/ function get() {
|
|
2190
|
-
return zoho.zohoRecruitGetRecords(this.recruitContext);
|
|
2191
|
-
}
|
|
2192
|
-
},
|
|
2193
|
-
{
|
|
2194
|
-
key: "searchRecords",
|
|
2195
|
-
get: /**
|
|
2196
|
-
* Configured pass-through for {@link zohoRecruitSearchRecords}.
|
|
2197
|
-
*
|
|
2198
|
-
* @returns Bound search records function.
|
|
2199
|
-
*/ function get() {
|
|
2200
|
-
return zoho.zohoRecruitSearchRecords(this.recruitContext);
|
|
2201
|
-
}
|
|
2202
|
-
},
|
|
2203
|
-
{
|
|
2204
|
-
key: "searchRecordsPageFactory",
|
|
2205
|
-
get: /**
|
|
2206
|
-
* Configured pass-through for {@link zohoRecruitSearchRecordsPageFactory}.
|
|
2207
|
-
*
|
|
2208
|
-
* @returns Bound search records page factory function.
|
|
2209
|
-
*/ function get() {
|
|
2210
|
-
return zoho.zohoRecruitSearchRecordsPageFactory(this.recruitContext);
|
|
2211
|
-
}
|
|
2212
|
-
},
|
|
2213
|
-
{
|
|
2214
|
-
key: "getRelatedRecordsFunctionFactory",
|
|
2215
|
-
get: /**
|
|
2216
|
-
* Configured pass-through for {@link zohoRecruitGetRelatedRecordsFunctionFactory}.
|
|
2217
|
-
*
|
|
2218
|
-
* @returns Bound get related records factory function.
|
|
2219
|
-
*/ function get() {
|
|
2220
|
-
return zoho.zohoRecruitGetRelatedRecordsFunctionFactory(this.recruitContext);
|
|
2221
|
-
}
|
|
2222
|
-
},
|
|
2223
|
-
{
|
|
2224
|
-
key: "getEmailsForRecord",
|
|
2225
|
-
get: /**
|
|
2226
|
-
* Configured pass-through for {@link zohoRecruitGetEmailsForRecord}.
|
|
2227
|
-
*
|
|
2228
|
-
* @returns Bound get emails for record function.
|
|
2229
|
-
*/ function get() {
|
|
2230
|
-
return zoho.zohoRecruitGetEmailsForRecord(this.recruitContext);
|
|
2231
|
-
}
|
|
2232
|
-
},
|
|
2233
|
-
{
|
|
2234
|
-
key: "getEmailsForRecordPageFactory",
|
|
2235
|
-
get: /**
|
|
2236
|
-
* Configured pass-through for {@link zohoRecruitGetEmailsForRecordPageFactory}.
|
|
2237
|
-
*
|
|
2238
|
-
* @returns Bound get emails page factory function.
|
|
2239
|
-
*/ function get() {
|
|
2240
|
-
return zoho.zohoRecruitGetEmailsForRecordPageFactory(this.recruitContext);
|
|
2241
|
-
}
|
|
2242
|
-
},
|
|
2243
|
-
{
|
|
2244
|
-
key: "getAttachmentsForRecord",
|
|
2245
|
-
get: /**
|
|
2246
|
-
* Configured pass-through for {@link zohoRecruitGetAttachmentsForRecord}.
|
|
2247
|
-
*
|
|
2248
|
-
* @returns Bound get attachments for record function.
|
|
2249
|
-
*/ function get() {
|
|
2250
|
-
return zoho.zohoRecruitGetAttachmentsForRecord(this.recruitContext);
|
|
2251
|
-
}
|
|
2252
|
-
},
|
|
2253
|
-
{
|
|
2254
|
-
key: "getAttachmentsForRecordPageFactory",
|
|
2255
|
-
get: /**
|
|
2256
|
-
* Configured pass-through for {@link zohoRecruitGetAttachmentsForRecordPageFactory}.
|
|
2257
|
-
*
|
|
2258
|
-
* @returns Bound get attachments page factory function.
|
|
2259
|
-
*/ function get() {
|
|
2260
|
-
return zoho.zohoRecruitGetAttachmentsForRecordPageFactory(this.recruitContext);
|
|
2261
|
-
}
|
|
2262
|
-
},
|
|
2263
|
-
{
|
|
2264
|
-
key: "uploadAttachmentForRecord",
|
|
2265
|
-
get: /**
|
|
2266
|
-
* Configured pass-through for {@link zohoRecruitUploadAttachmentForRecord}.
|
|
2267
|
-
*
|
|
2268
|
-
* @returns Bound upload attachment function.
|
|
2269
|
-
*/ function get() {
|
|
2270
|
-
return zoho.zohoRecruitUploadAttachmentForRecord(this.recruitContext);
|
|
2271
|
-
}
|
|
2272
|
-
},
|
|
2273
|
-
{
|
|
2274
|
-
key: "downloadAttachmentForRecord",
|
|
2275
|
-
get: /**
|
|
2276
|
-
* Configured pass-through for {@link zohoRecruitDownloadAttachmentForRecord}.
|
|
2277
|
-
*
|
|
2278
|
-
* @returns Bound download attachment function.
|
|
2279
|
-
*/ function get() {
|
|
2280
|
-
return zoho.zohoRecruitDownloadAttachmentForRecord(this.recruitContext);
|
|
2281
|
-
}
|
|
2282
|
-
},
|
|
2283
|
-
{
|
|
2284
|
-
key: "deleteAttachmentFromRecord",
|
|
2285
|
-
get: /**
|
|
2286
|
-
* Configured pass-through for {@link zohoRecruitDeleteAttachmentFromRecord}.
|
|
2287
|
-
*
|
|
2288
|
-
* @returns Bound delete attachment function.
|
|
2289
|
-
*/ function get() {
|
|
2290
|
-
return zoho.zohoRecruitDeleteAttachmentFromRecord(this.recruitContext);
|
|
2291
|
-
}
|
|
2292
|
-
},
|
|
2293
|
-
{
|
|
2294
|
-
key: "createNotes",
|
|
2295
|
-
get: /**
|
|
2296
|
-
* Configured pass-through for {@link zohoRecruitCreateNotes}.
|
|
2297
|
-
*
|
|
2298
|
-
* @returns Bound create notes function.
|
|
2299
|
-
*/ function get() {
|
|
2300
|
-
return zoho.zohoRecruitCreateNotes(this.recruitContext);
|
|
2301
|
-
}
|
|
2302
|
-
},
|
|
2303
|
-
{
|
|
2304
|
-
key: "deleteNotes",
|
|
2305
|
-
get: /**
|
|
2306
|
-
* Configured pass-through for {@link zohoRecruitDeleteNotes}.
|
|
2307
|
-
*
|
|
2308
|
-
* @returns Bound delete notes function.
|
|
2309
|
-
*/ function get() {
|
|
2310
|
-
return zoho.zohoRecruitDeleteNotes(this.recruitContext);
|
|
2311
|
-
}
|
|
2312
|
-
},
|
|
2313
|
-
{
|
|
2314
|
-
key: "createNotesForRecord",
|
|
2315
|
-
get: /**
|
|
2316
|
-
* Configured pass-through for {@link zohoRecruitCreateNotesForRecord}.
|
|
2317
|
-
*
|
|
2318
|
-
* @returns Bound create notes for record function.
|
|
2319
|
-
*/ function get() {
|
|
2320
|
-
return zoho.zohoRecruitCreateNotesForRecord(this.recruitContext);
|
|
2321
|
-
}
|
|
2322
|
-
},
|
|
2323
|
-
{
|
|
2324
|
-
key: "getNotesForRecord",
|
|
2325
|
-
get: /**
|
|
2326
|
-
* Configured pass-through for {@link zohoRecruitGetNotesForRecord}.
|
|
2327
|
-
*
|
|
2328
|
-
* @returns Bound get notes for record function.
|
|
2329
|
-
*/ function get() {
|
|
2330
|
-
return zoho.zohoRecruitGetNotesForRecord(this.recruitContext);
|
|
2331
|
-
}
|
|
2332
|
-
},
|
|
2333
|
-
{
|
|
2334
|
-
key: "getNotesForRecordPageFactory",
|
|
2335
|
-
get: /**
|
|
2336
|
-
* Configured pass-through for {@link zohoRecruitGetNotesForRecordPageFactory}.
|
|
2337
|
-
*
|
|
2338
|
-
* @returns Bound get notes page factory function.
|
|
2339
|
-
*/ function get() {
|
|
2340
|
-
return zoho.zohoRecruitGetNotesForRecordPageFactory(this.recruitContext);
|
|
2341
|
-
}
|
|
2342
|
-
},
|
|
2343
|
-
{
|
|
2344
|
-
key: "executeRestApiFunction",
|
|
2345
|
-
get: /**
|
|
2346
|
-
* Configured pass-through for {@link zohoRecruitExecuteRestApiFunction}.
|
|
2347
|
-
*
|
|
2348
|
-
* @returns Bound execute REST API function.
|
|
2349
|
-
*/ function get() {
|
|
2350
|
-
return zoho.zohoRecruitExecuteRestApiFunction(this.recruitContext);
|
|
2351
|
-
}
|
|
2352
|
-
},
|
|
2353
|
-
{
|
|
2354
|
-
key: "associateCandidateRecordsWithJobOpenings",
|
|
2355
|
-
get: /**
|
|
2356
|
-
* Configured pass-through for {@link zohoRecruitAssociateCandidateRecordsWithJobOpenings}.
|
|
2357
|
-
*
|
|
2358
|
-
* @returns Bound associate candidates with job openings function.
|
|
2359
|
-
*/ function get() {
|
|
2360
|
-
return zoho.zohoRecruitAssociateCandidateRecordsWithJobOpenings(this.recruitContext);
|
|
2361
|
-
}
|
|
2362
|
-
},
|
|
2363
|
-
{
|
|
2364
|
-
key: "searchCandidateAssociatedJobOpeningRecords",
|
|
2365
|
-
get: /**
|
|
2366
|
-
* Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecords}.
|
|
2367
|
-
*
|
|
2368
|
-
* @returns Bound search candidate associated job openings function.
|
|
2369
|
-
*/ function get() {
|
|
2370
|
-
return zoho.zohoRecruitSearchCandidateAssociatedJobOpeningRecords(this.recruitContext);
|
|
2371
|
-
}
|
|
2372
|
-
},
|
|
2373
|
-
{
|
|
2374
|
-
key: "searchCandidateAssociatedJobOpeningRecordsPageFactory",
|
|
2375
|
-
get: /**
|
|
2376
|
-
* Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory}.
|
|
2377
|
-
*
|
|
2378
|
-
* @returns Bound search candidate job openings page factory function.
|
|
2379
|
-
*/ function get() {
|
|
2380
|
-
return zoho.zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory(this.recruitContext);
|
|
2381
|
-
}
|
|
2382
|
-
},
|
|
2383
|
-
{
|
|
2384
|
-
key: "searchJobOpeningAssociatedCandidateRecords",
|
|
2385
|
-
get: /**
|
|
2386
|
-
* Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecords}.
|
|
2387
|
-
*
|
|
2388
|
-
* @returns Bound search job opening associated candidates function.
|
|
2389
|
-
*/ function get() {
|
|
2390
|
-
return zoho.zohoRecruitSearchJobOpeningAssociatedCandidateRecords(this.recruitContext);
|
|
2391
|
-
}
|
|
2392
|
-
},
|
|
2393
|
-
{
|
|
2394
|
-
key: "searchJobOpeningAssociatedCandidateRecordsPageFactory",
|
|
2395
|
-
get: /**
|
|
2396
|
-
* Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory}.
|
|
2397
|
-
*
|
|
2398
|
-
* @returns Bound search job opening candidates page factory function.
|
|
2399
|
-
*/ function get() {
|
|
2400
|
-
return zoho.zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory(this.recruitContext);
|
|
2401
|
-
}
|
|
2402
|
-
},
|
|
2403
|
-
{
|
|
2404
|
-
key: "createTagsForModule",
|
|
2405
|
-
get: /**
|
|
2406
|
-
* Configured pass-through for {@link zohoRecruitCreateTagsForModule}.
|
|
2407
|
-
*
|
|
2408
|
-
* @returns Bound create tags for module function.
|
|
2409
|
-
*/ function get() {
|
|
2410
|
-
return zoho.zohoRecruitCreateTagsForModule(this.recruitContext);
|
|
2411
|
-
}
|
|
2412
|
-
},
|
|
2413
|
-
{
|
|
2414
|
-
key: "getTagsForModule",
|
|
2415
|
-
get: /**
|
|
2416
|
-
* Configured pass-through for {@link zohoRecruitGetTagsForModule}.
|
|
2417
|
-
*
|
|
2418
|
-
* @returns Bound get tags for module function.
|
|
2419
|
-
*/ function get() {
|
|
2420
|
-
return zoho.zohoRecruitGetTagsForModule(this.recruitContext);
|
|
2421
|
-
}
|
|
2422
|
-
},
|
|
2423
|
-
{
|
|
2424
|
-
key: "addTagsToRecords",
|
|
2425
|
-
get: /**
|
|
2426
|
-
* Configured pass-through for {@link zohoRecruitAddTagsToRecords}.
|
|
2427
|
-
*
|
|
2428
|
-
* @returns Bound add tags to records function.
|
|
2429
|
-
*/ function get() {
|
|
2430
|
-
return zoho.zohoRecruitAddTagsToRecords(this.recruitContext);
|
|
2431
|
-
}
|
|
2432
|
-
},
|
|
2433
|
-
{
|
|
2434
|
-
key: "removeTagsFromRecords",
|
|
2435
|
-
get: /**
|
|
2436
|
-
* Configured pass-through for {@link zohoRecruitRemoveTagsFromRecords}.
|
|
2437
|
-
*
|
|
2438
|
-
* @returns Bound remove tags from records function.
|
|
2439
|
-
*/ function get() {
|
|
2440
|
-
return zoho.zohoRecruitRemoveTagsFromRecords(this.recruitContext);
|
|
2441
|
-
}
|
|
2442
|
-
}
|
|
2443
|
-
]);
|
|
2444
|
-
return ZohoRecruitApi;
|
|
2445
|
-
}();
|
|
2446
|
-
exports.ZohoRecruitApi = __decorate([
|
|
2447
|
-
common.Injectable(),
|
|
2448
|
-
__param(0, common.Inject(ZohoRecruitServiceConfig)),
|
|
2449
|
-
__param(1, common.Inject(exports.ZohoAccountsApi))
|
|
2450
|
-
], exports.ZohoRecruitApi);
|
|
2451
|
-
|
|
2452
|
-
function _array_like_to_array$2(arr, len) {
|
|
2453
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
2454
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2455
|
-
return arr2;
|
|
2456
|
-
}
|
|
2457
|
-
function _array_without_holes$2(arr) {
|
|
2458
|
-
if (Array.isArray(arr)) return _array_like_to_array$2(arr);
|
|
2459
|
-
}
|
|
2460
|
-
function _iterable_to_array$2(iter) {
|
|
2461
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2462
|
-
}
|
|
2463
|
-
function _non_iterable_spread$2() {
|
|
2464
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2465
|
-
}
|
|
2466
|
-
function _to_consumable_array$2(arr) {
|
|
2467
|
-
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
|
|
2468
|
-
}
|
|
2469
|
-
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
2470
|
-
if (!o) return;
|
|
2471
|
-
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
2472
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2473
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2474
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2475
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
2476
|
-
}
|
|
2477
|
-
// MARK: Provider Factories
|
|
2478
|
-
/**
|
|
2479
|
-
* Reads Zoho Recruit connection settings from the NestJS ConfigService
|
|
2480
|
-
* and returns a validated service config.
|
|
2481
|
-
*
|
|
2482
|
-
* Resolves the API URL via environment variables following the naming convention
|
|
2483
|
-
* `ZOHO_RECRUIT_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
2484
|
-
*
|
|
2485
|
-
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
2486
|
-
* @returns Validated Zoho Recruit service configuration.
|
|
2487
|
-
* @throws {Error} If required config values (e.g. API URL) are missing.
|
|
2488
|
-
*
|
|
2489
|
-
* @example
|
|
2490
|
-
* ```typescript
|
|
2491
|
-
* {
|
|
2492
|
-
* provide: ZohoRecruitServiceConfig,
|
|
2493
|
-
* inject: [ConfigService],
|
|
2494
|
-
* useFactory: zohoRecruitServiceConfigFactory
|
|
2495
|
-
* }
|
|
2496
|
-
* ```
|
|
2497
|
-
*/ function zohoRecruitServiceConfigFactory(configService) {
|
|
2498
|
-
var getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_RECRUIT_SERVICE_NAME, configService);
|
|
2499
|
-
var config = {
|
|
2500
|
-
zohoRecruit: {
|
|
2501
|
-
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
2502
|
-
}
|
|
2503
|
-
};
|
|
2504
|
-
ZohoRecruitServiceConfig.assertValidConfig(config);
|
|
2505
|
-
return config;
|
|
2506
|
-
}
|
|
2507
|
-
/**
|
|
2508
|
-
* Reads Zoho Accounts (OAuth) settings scoped to the Recruit service from
|
|
2509
|
-
* the NestJS ConfigService and returns an accounts service config.
|
|
2510
|
-
*
|
|
2511
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
2512
|
-
* @returns Zoho Accounts service config scoped to the Recruit service access token.
|
|
2513
|
-
*
|
|
2514
|
-
* @example
|
|
2515
|
-
* ```typescript
|
|
2516
|
-
* {
|
|
2517
|
-
* provide: ZohoAccountsServiceConfig,
|
|
2518
|
-
* inject: [ConfigService],
|
|
2519
|
-
* useFactory: zohoRecruitAccountServiceConfigFactory
|
|
2520
|
-
* }
|
|
2521
|
-
* ```
|
|
2522
|
-
*/ function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
2523
|
-
return zohoAccountsServiceConfigFromConfigService({
|
|
2524
|
-
configService: configService,
|
|
2525
|
-
serviceAccessTokenKey: zoho.ZOHO_RECRUIT_SERVICE_NAME
|
|
2526
|
-
});
|
|
2527
|
-
}
|
|
2528
|
-
/**
|
|
2529
|
-
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Recruit stack
|
|
2530
|
-
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
2531
|
-
*
|
|
2532
|
-
* The generated module requires the following dependencies in order to initialize properly:
|
|
2533
|
-
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
2534
|
-
*
|
|
2535
|
-
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
2536
|
-
*
|
|
2537
|
-
* The returned metadata registers {@link ZohoRecruitServiceConfig}, {@link ZohoRecruitApi},
|
|
2538
|
-
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
2539
|
-
* exports {@link ZohoRecruitApi} by default. Additional imports, exports, and providers
|
|
2540
|
-
* from the config are merged in.
|
|
2541
|
-
*
|
|
2542
|
-
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
2543
|
-
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
2544
|
-
*
|
|
2545
|
-
* @Module ({
|
|
2546
|
-
* providers: [
|
|
2547
|
-
* {
|
|
2548
|
-
* provide: ZohoAccountsAccessTokenCacheService,
|
|
2549
|
-
* useValue: cacheService
|
|
2550
|
-
* }
|
|
2551
|
-
* ],
|
|
2552
|
-
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
2553
|
-
* })
|
|
2554
|
-
* export class ZohoRecruitDependencyModule {}
|
|
2555
|
-
* @Module (appZohoRecruitModuleMetadata({ dependencyModule: ZohoRecruitDependencyModule }))
|
|
2556
|
-
* export class AppZohoRecruitModule {}
|
|
2557
|
-
* ```
|
|
2558
|
-
*
|
|
2559
|
-
* @example
|
|
2560
|
-
* ```typescript
|
|
2561
|
-
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
2562
|
-
*/ function appZohoRecruitModuleMetadata(config$1) {
|
|
2563
|
-
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
2564
|
-
var dependencyModuleImport = dependencyModule ? [
|
|
2565
|
-
dependencyModule
|
|
2566
|
-
] : [];
|
|
2567
|
-
return {
|
|
2568
|
-
imports: [
|
|
2569
|
-
config.ConfigModule
|
|
2570
|
-
].concat(_to_consumable_array$2(dependencyModuleImport), _to_consumable_array$2(imports !== null && imports !== void 0 ? imports : [])),
|
|
2571
|
-
exports: [
|
|
2572
|
-
exports.ZohoRecruitApi
|
|
2573
|
-
].concat(_to_consumable_array$2(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
2574
|
-
providers: [
|
|
2575
|
-
{
|
|
2576
|
-
provide: ZohoRecruitServiceConfig,
|
|
2577
|
-
inject: [
|
|
2578
|
-
config.ConfigService
|
|
2579
|
-
],
|
|
2580
|
-
useFactory: zohoRecruitServiceConfigFactory
|
|
2581
|
-
},
|
|
2582
|
-
exports.ZohoRecruitApi,
|
|
2583
|
-
// Accounts
|
|
2584
|
-
{
|
|
2585
|
-
provide: ZohoAccountsServiceConfig,
|
|
2586
|
-
inject: [
|
|
2587
|
-
config.ConfigService
|
|
2588
|
-
],
|
|
2589
|
-
useFactory: zohoRecruitAccountServiceConfigFactory
|
|
2590
|
-
},
|
|
2591
|
-
exports.ZohoAccountsApi
|
|
2592
|
-
].concat(_to_consumable_array$2(providers !== null && providers !== void 0 ? providers : []))
|
|
2593
|
-
};
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
function _class_call_check$7(instance, Constructor) {
|
|
2597
|
-
if (!(instance instanceof Constructor)) {
|
|
2598
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
function _defineProperties$6(target, props) {
|
|
2602
|
-
for(var i = 0; i < props.length; i++){
|
|
2603
|
-
var descriptor = props[i];
|
|
2604
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
2605
|
-
descriptor.configurable = true;
|
|
2606
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
2607
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
function _create_class$6(Constructor, protoProps, staticProps) {
|
|
2611
|
-
if (staticProps) _defineProperties$6(Constructor, staticProps);
|
|
2612
|
-
return Constructor;
|
|
2613
|
-
}
|
|
2614
|
-
function _define_property$7(obj, key, value) {
|
|
2615
|
-
if (key in obj) {
|
|
2616
|
-
Object.defineProperty(obj, key, {
|
|
2617
|
-
value: value,
|
|
2618
|
-
enumerable: true,
|
|
2619
|
-
configurable: true,
|
|
2620
|
-
writable: true
|
|
2621
|
-
});
|
|
2622
|
-
} else {
|
|
2623
|
-
obj[key] = value;
|
|
2624
|
-
}
|
|
2625
|
-
return obj;
|
|
2626
|
-
}
|
|
2627
|
-
/**
|
|
2628
|
-
* Configuration for ZohoSignService
|
|
2629
|
-
*/ var ZohoSignServiceConfig = /*#__PURE__*/ function() {
|
|
2630
|
-
function ZohoSignServiceConfig() {
|
|
2631
|
-
_class_call_check$7(this, ZohoSignServiceConfig);
|
|
2632
|
-
_define_property$7(this, "zohoSign", void 0);
|
|
2633
|
-
_define_property$7(this, "factoryConfig", void 0);
|
|
2634
|
-
}
|
|
2635
|
-
_create_class$6(ZohoSignServiceConfig, null, [
|
|
2636
|
-
{
|
|
2637
|
-
key: "assertValidConfig",
|
|
2638
|
-
value: function assertValidConfig(config) {
|
|
2639
|
-
assertValidZohoConfig(config.zohoSign);
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
]);
|
|
2643
|
-
return ZohoSignServiceConfig;
|
|
2644
|
-
}
|
|
2645
|
-
();
|
|
2646
|
-
|
|
2647
|
-
function _class_call_check$6(instance, Constructor) {
|
|
2648
|
-
if (!(instance instanceof Constructor)) {
|
|
2649
|
-
throw new TypeError("Cannot call a class as a function");
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2652
|
-
function _defineProperties$5(target, props) {
|
|
2653
|
-
for(var i = 0; i < props.length; i++){
|
|
2654
|
-
var descriptor = props[i];
|
|
2655
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
2656
|
-
descriptor.configurable = true;
|
|
2657
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
2658
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
function _create_class$5(Constructor, protoProps, staticProps) {
|
|
2662
|
-
if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
|
|
2663
|
-
return Constructor;
|
|
2664
|
-
}
|
|
2665
|
-
function _define_property$6(obj, key, value) {
|
|
2666
|
-
if (key in obj) {
|
|
2667
|
-
Object.defineProperty(obj, key, {
|
|
2668
|
-
value: value,
|
|
2669
|
-
enumerable: true,
|
|
2670
|
-
configurable: true,
|
|
2671
|
-
writable: true
|
|
2672
|
-
});
|
|
2673
|
-
} else {
|
|
2674
|
-
obj[key] = value;
|
|
2675
|
-
}
|
|
2676
|
-
return obj;
|
|
2677
|
-
}
|
|
2678
|
-
function _object_spread$2(target) {
|
|
2679
|
-
for(var i = 1; i < arguments.length; i++){
|
|
2680
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
2681
|
-
var ownKeys = Object.keys(source);
|
|
2682
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2683
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2684
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2685
|
-
}));
|
|
2686
|
-
}
|
|
2687
|
-
ownKeys.forEach(function(key) {
|
|
2688
|
-
_define_property$6(target, key, source[key]);
|
|
2689
|
-
});
|
|
2690
|
-
}
|
|
2691
|
-
return target;
|
|
2692
|
-
}
|
|
2693
|
-
function ownKeys$2(object, enumerableOnly) {
|
|
2694
|
-
var keys = Object.keys(object);
|
|
2695
|
-
if (Object.getOwnPropertySymbols) {
|
|
2696
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
2697
|
-
keys.push.apply(keys, symbols);
|
|
2698
|
-
}
|
|
2699
|
-
return keys;
|
|
2700
|
-
}
|
|
2701
|
-
function _object_spread_props$2(target, source) {
|
|
2702
|
-
source = source != null ? source : {};
|
|
2703
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
2704
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2705
|
-
} else {
|
|
2706
|
-
ownKeys$2(Object(source)).forEach(function(key) {
|
|
2707
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2708
|
-
});
|
|
2709
|
-
}
|
|
2710
|
-
return target;
|
|
2711
|
-
}
|
|
2712
|
-
/**
|
|
2713
|
-
* NestJS injectable service that wraps the Zoho Sign API.
|
|
2714
|
-
*
|
|
2715
|
-
* Provides convenient accessor getters for all Sign operations, each bound
|
|
2716
|
-
* to the authenticated Sign context created during construction.
|
|
2717
|
-
*/ exports.ZohoSignApi = /*#__PURE__*/ function() {
|
|
2718
|
-
function ZohoSignApi(config, zohoAccountsApi) {
|
|
2719
|
-
_class_call_check$6(this, ZohoSignApi);
|
|
2720
|
-
_define_property$6(this, "config", void 0);
|
|
2721
|
-
_define_property$6(this, "zohoAccountsApi", void 0);
|
|
2722
|
-
/**
|
|
2723
|
-
* Underlying Zoho Sign client instance, initialized from the injected config and accounts context.
|
|
2724
|
-
*/ _define_property$6(this, "zohoSign", void 0);
|
|
2725
|
-
this.config = config;
|
|
2726
|
-
this.zohoAccountsApi = zohoAccountsApi;
|
|
2727
|
-
this.zohoSign = zoho.zohoSignFactory(_object_spread_props$2(_object_spread$2({}, config.factoryConfig), {
|
|
2728
|
-
accountsContext: zohoAccountsApi.accountsContext
|
|
2729
|
-
}))(config.zohoSign);
|
|
2730
|
-
}
|
|
2731
|
-
_create_class$5(ZohoSignApi, [
|
|
2732
|
-
{
|
|
2733
|
-
key: "signContext",
|
|
2734
|
-
get: /**
|
|
2735
|
-
* The authenticated Sign context used by all operation accessors.
|
|
2736
|
-
*
|
|
2737
|
-
* @returns The Sign context from the underlying client.
|
|
2738
|
-
*/ function get() {
|
|
2739
|
-
return this.zohoSign.signContext;
|
|
2740
|
-
}
|
|
2741
|
-
},
|
|
2742
|
-
{
|
|
2743
|
-
key: "zohoRateLimiter",
|
|
2744
|
-
get: /**
|
|
2745
|
-
* Rate limiter shared across all Sign requests to respect Zoho API quotas.
|
|
2746
|
-
*
|
|
2747
|
-
* @returns The shared rate limiter instance.
|
|
2748
|
-
*/ function get() {
|
|
2749
|
-
return this.zohoSign.signContext.zohoRateLimiter;
|
|
2750
|
-
}
|
|
2751
|
-
},
|
|
2752
|
-
{
|
|
2753
|
-
key: "getDocument",
|
|
2754
|
-
get: // MARK: Accessors
|
|
2755
|
-
/**
|
|
2756
|
-
* Configured pass-through for {@link zohoSignGetDocument}.
|
|
2757
|
-
*
|
|
2758
|
-
* @returns Bound get document function.
|
|
2759
|
-
*/ function get() {
|
|
2760
|
-
return zoho.zohoSignGetDocument(this.signContext);
|
|
2761
|
-
}
|
|
2762
|
-
},
|
|
2763
|
-
{
|
|
2764
|
-
key: "getDocuments",
|
|
2765
|
-
get: /**
|
|
2766
|
-
* Configured pass-through for {@link zohoSignGetDocuments}.
|
|
2767
|
-
*
|
|
2768
|
-
* @returns Bound get documents function.
|
|
2769
|
-
*/ function get() {
|
|
2770
|
-
return zoho.zohoSignGetDocuments(this.signContext);
|
|
2771
|
-
}
|
|
2772
|
-
},
|
|
2773
|
-
{
|
|
2774
|
-
key: "getDocumentsPageFactory",
|
|
2775
|
-
get: /**
|
|
2776
|
-
* Configured pass-through for {@link zohoSignGetDocumentsPageFactory}.
|
|
2777
|
-
*
|
|
2778
|
-
* @returns Bound get documents page factory function.
|
|
2779
|
-
*/ function get() {
|
|
2780
|
-
return zoho.zohoSignGetDocumentsPageFactory(this.signContext);
|
|
2781
|
-
}
|
|
2782
|
-
},
|
|
2783
|
-
{
|
|
2784
|
-
key: "getDocumentFormData",
|
|
2785
|
-
get: /**
|
|
2786
|
-
* Configured pass-through for {@link zohoSignGetDocumentFormData}.
|
|
2787
|
-
*
|
|
2788
|
-
* @returns Bound get document form data function.
|
|
2789
|
-
*/ function get() {
|
|
2790
|
-
return zoho.zohoSignGetDocumentFormData(this.signContext);
|
|
2791
|
-
}
|
|
2792
|
-
},
|
|
2793
|
-
{
|
|
2794
|
-
key: "retrieveFieldTypes",
|
|
2795
|
-
get: /**
|
|
2796
|
-
* Configured pass-through for {@link zohoSignRetrieveFieldTypes}.
|
|
2797
|
-
*
|
|
2798
|
-
* @returns Bound retrieve field types function.
|
|
2799
|
-
*/ function get() {
|
|
2800
|
-
return zoho.zohoSignRetrieveFieldTypes(this.signContext);
|
|
2801
|
-
}
|
|
2802
|
-
},
|
|
2803
|
-
{
|
|
2804
|
-
key: "downloadPdf",
|
|
2805
|
-
get: /**
|
|
2806
|
-
* Configured pass-through for {@link zohoSignDownloadPdf}.
|
|
2807
|
-
*
|
|
2808
|
-
* @returns Bound download PDF function.
|
|
2809
|
-
*/ function get() {
|
|
2810
|
-
return zoho.zohoSignDownloadPdf(this.signContext);
|
|
2811
|
-
}
|
|
2812
|
-
},
|
|
2813
|
-
{
|
|
2814
|
-
key: "downloadCompletionCertificate",
|
|
2815
|
-
get: /**
|
|
2816
|
-
* Configured pass-through for {@link zohoSignDownloadCompletionCertificate}.
|
|
2817
|
-
*
|
|
2818
|
-
* @returns Bound download completion certificate function.
|
|
2819
|
-
*/ function get() {
|
|
2820
|
-
return zoho.zohoSignDownloadCompletionCertificate(this.signContext);
|
|
2821
|
-
}
|
|
2822
|
-
},
|
|
2823
|
-
{
|
|
2824
|
-
key: "createDocument",
|
|
2825
|
-
get: /**
|
|
2826
|
-
* Configured pass-through for {@link zohoSignCreateDocument}.
|
|
2827
|
-
*
|
|
2828
|
-
* @returns Bound create document function.
|
|
2829
|
-
*/ function get() {
|
|
2830
|
-
return zoho.zohoSignCreateDocument(this.signContext);
|
|
2831
|
-
}
|
|
2832
|
-
},
|
|
2833
|
-
{
|
|
2834
|
-
key: "createDocumentFromTemplate",
|
|
2835
|
-
get: /**
|
|
2836
|
-
* Configured pass-through for {@link zohoSignCreateDocumentFromTemplate}.
|
|
2837
|
-
*
|
|
2838
|
-
* @returns Bound create document from template function.
|
|
2839
|
-
*/ function get() {
|
|
2840
|
-
return zoho.zohoSignCreateDocumentFromTemplate(this.signContext);
|
|
2841
|
-
}
|
|
2842
|
-
},
|
|
2843
|
-
{
|
|
2844
|
-
key: "getTemplate",
|
|
2845
|
-
get: /**
|
|
2846
|
-
* Configured pass-through for {@link zohoSignGetTemplate}.
|
|
2847
|
-
*
|
|
2848
|
-
* @returns Bound get template function.
|
|
2849
|
-
*/ function get() {
|
|
2850
|
-
return zoho.zohoSignGetTemplate(this.signContext);
|
|
2851
|
-
}
|
|
2852
|
-
},
|
|
2853
|
-
{
|
|
2854
|
-
key: "getTemplates",
|
|
2855
|
-
get: /**
|
|
2856
|
-
* Configured pass-through for {@link zohoSignGetTemplates}.
|
|
2857
|
-
*
|
|
2858
|
-
* @returns Bound get templates (list) function.
|
|
2859
|
-
*/ function get() {
|
|
2860
|
-
return zoho.zohoSignGetTemplates(this.signContext);
|
|
2861
|
-
}
|
|
2862
|
-
},
|
|
2863
|
-
{
|
|
2864
|
-
key: "updateDocument",
|
|
2865
|
-
get: /**
|
|
2866
|
-
* Configured pass-through for {@link zohoSignUpdateDocument}.
|
|
2867
|
-
*
|
|
2868
|
-
* @returns Bound update document function.
|
|
2869
|
-
*/ function get() {
|
|
2870
|
-
return zoho.zohoSignUpdateDocument(this.signContext);
|
|
2871
|
-
}
|
|
2872
|
-
},
|
|
2873
|
-
{
|
|
2874
|
-
key: "sendDocumentForSignature",
|
|
2875
|
-
get: /**
|
|
2876
|
-
* Configured pass-through for {@link zohoSignSendDocumentForSignature}.
|
|
2877
|
-
*
|
|
2878
|
-
* @returns Bound send document for signature function.
|
|
2879
|
-
*/ function get() {
|
|
2880
|
-
return zoho.zohoSignSendDocumentForSignature(this.signContext);
|
|
2881
|
-
}
|
|
2882
|
-
},
|
|
2883
|
-
{
|
|
2884
|
-
key: "extendDocument",
|
|
2885
|
-
get: /**
|
|
2886
|
-
* Configured pass-through for {@link zohoSignExtendDocument}.
|
|
2887
|
-
*
|
|
2888
|
-
* @returns Bound extend document function.
|
|
2889
|
-
*/ function get() {
|
|
2890
|
-
return zoho.zohoSignExtendDocument(this.signContext);
|
|
2891
|
-
}
|
|
2892
|
-
},
|
|
2893
|
-
{
|
|
2894
|
-
key: "deleteDocument",
|
|
2895
|
-
get: /**
|
|
2896
|
-
* Configured pass-through for {@link zohoSignDeleteDocument}.
|
|
2897
|
-
*
|
|
2898
|
-
* @returns Bound delete document function.
|
|
2899
|
-
*/ function get() {
|
|
2900
|
-
return zoho.zohoSignDeleteDocument(this.signContext);
|
|
2901
|
-
}
|
|
2902
|
-
},
|
|
2903
|
-
{
|
|
2904
|
-
key: "getEmbeddedSigningUrl",
|
|
2905
|
-
get: /**
|
|
2906
|
-
* Configured pass-through for {@link zohoSignGetEmbeddedSigningUrl}.
|
|
2907
|
-
*
|
|
2908
|
-
* @returns Bound get embedded signing URL function.
|
|
2909
|
-
*/ function get() {
|
|
2910
|
-
return zoho.zohoSignGetEmbeddedSigningUrl(this.signContext);
|
|
2911
|
-
}
|
|
2912
|
-
}
|
|
2913
|
-
]);
|
|
2914
|
-
return ZohoSignApi;
|
|
2915
|
-
}();
|
|
2916
|
-
exports.ZohoSignApi = __decorate([
|
|
2917
|
-
common.Injectable(),
|
|
2918
|
-
__param(0, common.Inject(ZohoSignServiceConfig)),
|
|
2919
|
-
__param(1, common.Inject(exports.ZohoAccountsApi))
|
|
2920
|
-
], exports.ZohoSignApi);
|
|
2921
|
-
|
|
2922
|
-
function _array_like_to_array$1(arr, len) {
|
|
2923
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
2924
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2925
|
-
return arr2;
|
|
2926
|
-
}
|
|
2927
|
-
function _array_without_holes$1(arr) {
|
|
2928
|
-
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
|
|
2929
|
-
}
|
|
2930
|
-
function _iterable_to_array$1(iter) {
|
|
2931
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2932
|
-
}
|
|
2933
|
-
function _non_iterable_spread$1() {
|
|
2934
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2935
|
-
}
|
|
2936
|
-
function _to_consumable_array$1(arr) {
|
|
2937
|
-
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
|
|
2938
|
-
}
|
|
2939
|
-
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
2940
|
-
if (!o) return;
|
|
2941
|
-
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
2942
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2943
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2944
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2945
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
2946
|
-
}
|
|
2947
|
-
// MARK: Provider Factories
|
|
2948
|
-
/**
|
|
2949
|
-
* Reads Zoho Sign connection settings from the NestJS ConfigService
|
|
2950
|
-
* and returns a validated service config.
|
|
2951
|
-
*
|
|
2952
|
-
* Resolves the API URL via environment variables following the naming convention
|
|
2953
|
-
* `ZOHO_SIGN_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
2954
|
-
*
|
|
2955
|
-
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
2956
|
-
* @returns Validated Zoho Sign service configuration.
|
|
2957
|
-
* @throws {Error} If required config values (e.g. API URL) are missing.
|
|
2958
|
-
*
|
|
2959
|
-
* @example
|
|
2960
|
-
* ```typescript
|
|
2961
|
-
* // Typically used as a NestJS factory provider:
|
|
2962
|
-
* {
|
|
2963
|
-
* provide: ZohoSignServiceConfig,
|
|
2964
|
-
* inject: [ConfigService],
|
|
2965
|
-
* useFactory: zohoSignServiceConfigFactory
|
|
2966
|
-
* }
|
|
2967
|
-
* ```
|
|
2968
|
-
*/ function zohoSignServiceConfigFactory(configService) {
|
|
2969
|
-
var getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_SIGN_SERVICE_NAME, configService);
|
|
2970
|
-
var config = {
|
|
2971
|
-
zohoSign: {
|
|
2972
|
-
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
2973
|
-
}
|
|
2974
|
-
};
|
|
2975
|
-
ZohoSignServiceConfig.assertValidConfig(config);
|
|
2976
|
-
return config;
|
|
2977
|
-
}
|
|
2978
|
-
/**
|
|
2979
|
-
* Reads Zoho Accounts (OAuth) settings scoped to the Sign service from
|
|
2980
|
-
* the NestJS ConfigService and returns an accounts service config.
|
|
2981
|
-
*
|
|
2982
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
2983
|
-
* @returns Zoho Accounts service config scoped to the Sign service access token.
|
|
2984
|
-
*
|
|
2985
|
-
* @example
|
|
2986
|
-
* ```typescript
|
|
2987
|
-
* {
|
|
2988
|
-
* provide: ZohoAccountsServiceConfig,
|
|
2989
|
-
* inject: [ConfigService],
|
|
2990
|
-
* useFactory: zohoSignAccountServiceConfigFactory
|
|
2991
|
-
* }
|
|
2992
|
-
* ```
|
|
2993
|
-
*/ function zohoSignAccountServiceConfigFactory(configService) {
|
|
2994
|
-
return zohoAccountsServiceConfigFromConfigService({
|
|
2995
|
-
configService: configService,
|
|
2996
|
-
serviceAccessTokenKey: zoho.ZOHO_SIGN_SERVICE_NAME
|
|
2997
|
-
});
|
|
2998
|
-
}
|
|
2999
|
-
/**
|
|
3000
|
-
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Sign stack
|
|
3001
|
-
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
3002
|
-
*
|
|
3003
|
-
* The generated module requires the following dependencies in order to initialize properly:
|
|
3004
|
-
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
3005
|
-
*
|
|
3006
|
-
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
3007
|
-
*
|
|
3008
|
-
* The returned metadata registers {@link ZohoSignServiceConfig}, {@link ZohoSignApi},
|
|
3009
|
-
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
3010
|
-
* exports {@link ZohoSignApi} by default. Additional imports, exports, and providers
|
|
3011
|
-
* from the config are merged in.
|
|
3012
|
-
*
|
|
3013
|
-
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
3014
|
-
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
3015
|
-
*
|
|
3016
|
-
* @Module ({
|
|
3017
|
-
* providers: [
|
|
3018
|
-
* {
|
|
3019
|
-
* provide: ZohoAccountsAccessTokenCacheService,
|
|
3020
|
-
* useValue: cacheService
|
|
3021
|
-
* }
|
|
3022
|
-
* ],
|
|
3023
|
-
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
3024
|
-
* })
|
|
3025
|
-
* export class ZohoSignDependencyModule {}
|
|
3026
|
-
* @Module (appZohoSignModuleMetadata({ dependencyModule: ZohoSignDependencyModule }))
|
|
3027
|
-
* export class AppZohoSignModule {}
|
|
3028
|
-
* ```
|
|
3029
|
-
*
|
|
3030
|
-
* @example
|
|
3031
|
-
* ```typescript
|
|
3032
|
-
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
3033
|
-
*/ function appZohoSignModuleMetadata(config$1) {
|
|
3034
|
-
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
3035
|
-
var dependencyModuleImport = dependencyModule ? [
|
|
3036
|
-
dependencyModule
|
|
3037
|
-
] : [];
|
|
3038
|
-
return {
|
|
3039
|
-
imports: [
|
|
3040
|
-
config.ConfigModule
|
|
3041
|
-
].concat(_to_consumable_array$1(dependencyModuleImport), _to_consumable_array$1(imports !== null && imports !== void 0 ? imports : [])),
|
|
3042
|
-
exports: [
|
|
3043
|
-
exports.ZohoSignApi
|
|
3044
|
-
].concat(_to_consumable_array$1(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
3045
|
-
providers: [
|
|
3046
|
-
{
|
|
3047
|
-
provide: ZohoSignServiceConfig,
|
|
3048
|
-
inject: [
|
|
3049
|
-
config.ConfigService
|
|
3050
|
-
],
|
|
3051
|
-
useFactory: zohoSignServiceConfigFactory
|
|
3052
|
-
},
|
|
3053
|
-
exports.ZohoSignApi,
|
|
3054
|
-
// Accounts
|
|
3055
|
-
{
|
|
3056
|
-
provide: ZohoAccountsServiceConfig,
|
|
3057
|
-
inject: [
|
|
3058
|
-
config.ConfigService
|
|
3059
|
-
],
|
|
3060
|
-
useFactory: zohoSignAccountServiceConfigFactory
|
|
3061
|
-
},
|
|
3062
|
-
exports.ZohoAccountsApi
|
|
3063
|
-
].concat(_to_consumable_array$1(providers !== null && providers !== void 0 ? providers : []))
|
|
3064
|
-
};
|
|
3065
|
-
}
|
|
3066
|
-
|
|
3067
|
-
function _define_property$5(obj, key, value) {
|
|
3068
|
-
if (key in obj) {
|
|
3069
|
-
Object.defineProperty(obj, key, {
|
|
3070
|
-
value: value,
|
|
3071
|
-
enumerable: true,
|
|
3072
|
-
configurable: true,
|
|
3073
|
-
writable: true
|
|
3074
|
-
});
|
|
3075
|
-
} else {
|
|
3076
|
-
obj[key] = value;
|
|
3077
|
-
}
|
|
3078
|
-
return obj;
|
|
3079
|
-
}
|
|
3080
|
-
function _object_spread$1(target) {
|
|
3081
|
-
for(var i = 1; i < arguments.length; i++){
|
|
3082
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
3083
|
-
var ownKeys = Object.keys(source);
|
|
3084
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3085
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3086
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3087
|
-
}));
|
|
3088
|
-
}
|
|
3089
|
-
ownKeys.forEach(function(key) {
|
|
3090
|
-
_define_property$5(target, key, source[key]);
|
|
3091
|
-
});
|
|
3092
|
-
}
|
|
3093
|
-
return target;
|
|
3094
|
-
}
|
|
3095
|
-
function ownKeys$1(object, enumerableOnly) {
|
|
3096
|
-
var keys = Object.keys(object);
|
|
3097
|
-
if (Object.getOwnPropertySymbols) {
|
|
3098
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
3099
|
-
keys.push.apply(keys, symbols);
|
|
3100
|
-
}
|
|
3101
|
-
return keys;
|
|
3102
|
-
}
|
|
3103
|
-
function _object_spread_props$1(target, source) {
|
|
3104
|
-
source = source != null ? source : {};
|
|
3105
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
3106
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3107
|
-
} else {
|
|
3108
|
-
ownKeys$1(Object(source)).forEach(function(key) {
|
|
3109
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3110
|
-
});
|
|
3111
|
-
}
|
|
3112
|
-
return target;
|
|
3113
|
-
}
|
|
3114
|
-
/**
|
|
3115
|
-
* Creates a {@link ZohoSignWebhookEvent} from a raw payload.
|
|
3116
|
-
*
|
|
3117
|
-
* @param payload - The raw Zoho Sign webhook payload to convert.
|
|
3118
|
-
* @returns A webhook event with the operation type extracted for convenience.
|
|
3119
|
-
*/ function zohoSignWebhookEvent(payload) {
|
|
3120
|
-
return _object_spread_props$1(_object_spread$1({}, payload), {
|
|
3121
|
-
operationType: payload.notifications.operation_type
|
|
3122
|
-
});
|
|
3123
|
-
}
|
|
3124
|
-
var zohoSignEventHandlerFactory = util.handlerFactory(function(x) {
|
|
3125
|
-
return x.operationType;
|
|
3126
|
-
});
|
|
3127
|
-
var zohoSignEventHandlerConfigurerFactory = util.handlerConfigurerFactory({
|
|
3128
|
-
configurerForAccessor: function configurerForAccessor(accessor) {
|
|
3129
|
-
var fnWithKey = util.handlerMappedSetFunctionFactory(accessor, function(x) {
|
|
3130
|
-
return x;
|
|
3131
|
-
});
|
|
3132
|
-
var configurer = _object_spread_props$1(_object_spread$1({}, accessor), {
|
|
3133
|
-
handleRequestSubmitted: fnWithKey('RequestSubmitted'),
|
|
3134
|
-
handleRequestViewed: fnWithKey('RequestViewed'),
|
|
3135
|
-
handleRequestSigningSuccess: fnWithKey('RequestSigningSuccess'),
|
|
3136
|
-
handleRequestCompleted: fnWithKey('RequestCompleted'),
|
|
3137
|
-
handleRequestRejected: fnWithKey('RequestRejected'),
|
|
3138
|
-
handleRequestRecalled: fnWithKey('RequestRecalled'),
|
|
3139
|
-
handleRequestForwarded: fnWithKey('RequestForwarded'),
|
|
3140
|
-
handleRequestExpired: fnWithKey('RequestExpired')
|
|
3141
|
-
});
|
|
3142
|
-
return configurer;
|
|
3143
|
-
}
|
|
3144
|
-
});
|
|
3145
|
-
|
|
3146
|
-
function _class_call_check$5(instance, Constructor) {
|
|
3147
|
-
if (!(instance instanceof Constructor)) {
|
|
3148
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3149
|
-
}
|
|
3150
|
-
}
|
|
3151
|
-
function _defineProperties$4(target, props) {
|
|
3152
|
-
for(var i = 0; i < props.length; i++){
|
|
3153
|
-
var descriptor = props[i];
|
|
3154
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
3155
|
-
descriptor.configurable = true;
|
|
3156
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
3157
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
3160
|
-
function _create_class$4(Constructor, protoProps, staticProps) {
|
|
3161
|
-
if (staticProps) _defineProperties$4(Constructor, staticProps);
|
|
3162
|
-
return Constructor;
|
|
3163
|
-
}
|
|
3164
|
-
function _define_property$4(obj, key, value) {
|
|
3165
|
-
if (key in obj) {
|
|
3166
|
-
Object.defineProperty(obj, key, {
|
|
3167
|
-
value: value,
|
|
3168
|
-
enumerable: true,
|
|
3169
|
-
configurable: true,
|
|
3170
|
-
writable: true
|
|
3171
|
-
});
|
|
3172
|
-
} else {
|
|
3173
|
-
obj[key] = value;
|
|
3174
|
-
}
|
|
3175
|
-
return obj;
|
|
3176
|
-
}
|
|
3177
|
-
var ZOHO_SIGN_WEBHOOK_SECRET_TOKEN_ENV_VAR = 'ZOHO_SIGN_WEBHOOK_SECRET_TOKEN';
|
|
3178
|
-
/**
|
|
3179
|
-
* Configuration for the Zoho Sign webhook service.
|
|
3180
|
-
*/ var ZohoSignWebhookServiceConfig = /*#__PURE__*/ function() {
|
|
3181
|
-
function ZohoSignWebhookServiceConfig() {
|
|
3182
|
-
_class_call_check$5(this, ZohoSignWebhookServiceConfig);
|
|
3183
|
-
_define_property$4(this, "zohoSignWebhook", void 0);
|
|
3184
|
-
}
|
|
3185
|
-
_create_class$4(ZohoSignWebhookServiceConfig, null, [
|
|
3186
|
-
{
|
|
3187
|
-
key: "assertValidConfig",
|
|
3188
|
-
value: function assertValidConfig(config) {
|
|
3189
|
-
if (!config.zohoSignWebhook.webhookSecret) {
|
|
3190
|
-
throw new Error('No Zoho Sign webhook secret specified.');
|
|
3191
|
-
}
|
|
3192
|
-
}
|
|
3193
|
-
}
|
|
3194
|
-
]);
|
|
3195
|
-
return ZohoSignWebhookServiceConfig;
|
|
3196
|
-
}
|
|
3197
|
-
();
|
|
3198
|
-
|
|
3199
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3200
|
-
try {
|
|
3201
|
-
var info = gen[key](arg);
|
|
3202
|
-
var value = info.value;
|
|
3203
|
-
} catch (error) {
|
|
3204
|
-
reject(error);
|
|
3205
|
-
return;
|
|
3206
|
-
}
|
|
3207
|
-
if (info.done) {
|
|
3208
|
-
resolve(value);
|
|
3209
|
-
} else {
|
|
3210
|
-
Promise.resolve(value).then(_next, _throw);
|
|
3211
|
-
}
|
|
3212
|
-
}
|
|
3213
|
-
function _async_to_generator$2(fn) {
|
|
3214
|
-
return function() {
|
|
3215
|
-
var self = this, args = arguments;
|
|
3216
|
-
return new Promise(function(resolve, reject) {
|
|
3217
|
-
var gen = fn.apply(self, args);
|
|
3218
|
-
function _next(value) {
|
|
3219
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
3220
|
-
}
|
|
3221
|
-
function _throw(err) {
|
|
3222
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3223
|
-
}
|
|
3224
|
-
_next(undefined);
|
|
3225
|
-
});
|
|
3226
|
-
};
|
|
3227
|
-
}
|
|
3228
|
-
function _ts_generator$2(thisArg, body) {
|
|
3229
|
-
var f, y, t, _ = {
|
|
3230
|
-
label: 0,
|
|
3231
|
-
sent: function() {
|
|
3232
|
-
if (t[0] & 1) throw t[1];
|
|
3233
|
-
return t[1];
|
|
3234
|
-
},
|
|
3235
|
-
trys: [],
|
|
3236
|
-
ops: []
|
|
3237
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
3238
|
-
return d(g, "next", {
|
|
3239
|
-
value: verb(0)
|
|
3240
|
-
}), d(g, "throw", {
|
|
3241
|
-
value: verb(1)
|
|
3242
|
-
}), d(g, "return", {
|
|
3243
|
-
value: verb(2)
|
|
3244
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
3245
|
-
value: function() {
|
|
3246
|
-
return this;
|
|
3247
|
-
}
|
|
3248
|
-
}), g;
|
|
3249
|
-
function verb(n) {
|
|
3250
|
-
return function(v) {
|
|
3251
|
-
return step([
|
|
3252
|
-
n,
|
|
3253
|
-
v
|
|
3254
|
-
]);
|
|
3255
|
-
};
|
|
3256
|
-
}
|
|
3257
|
-
function step(op) {
|
|
3258
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
3259
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
3260
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3261
|
-
if (y = 0, t) op = [
|
|
3262
|
-
op[0] & 2,
|
|
3263
|
-
t.value
|
|
3264
|
-
];
|
|
3265
|
-
switch(op[0]){
|
|
3266
|
-
case 0:
|
|
3267
|
-
case 1:
|
|
3268
|
-
t = op;
|
|
3269
|
-
break;
|
|
3270
|
-
case 4:
|
|
3271
|
-
_.label++;
|
|
3272
|
-
return {
|
|
3273
|
-
value: op[1],
|
|
3274
|
-
done: false
|
|
3275
|
-
};
|
|
3276
|
-
case 5:
|
|
3277
|
-
_.label++;
|
|
3278
|
-
y = op[1];
|
|
3279
|
-
op = [
|
|
3280
|
-
0
|
|
3281
|
-
];
|
|
3282
|
-
continue;
|
|
3283
|
-
case 7:
|
|
3284
|
-
op = _.ops.pop();
|
|
3285
|
-
_.trys.pop();
|
|
3286
|
-
continue;
|
|
3287
|
-
default:
|
|
3288
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
3289
|
-
_ = 0;
|
|
3290
|
-
continue;
|
|
3291
|
-
}
|
|
3292
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
3293
|
-
_.label = op[1];
|
|
3294
|
-
break;
|
|
3295
|
-
}
|
|
3296
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
3297
|
-
_.label = t[1];
|
|
3298
|
-
t = op;
|
|
3299
|
-
break;
|
|
3300
|
-
}
|
|
3301
|
-
if (t && _.label < t[2]) {
|
|
3302
|
-
_.label = t[2];
|
|
3303
|
-
_.ops.push(op);
|
|
3304
|
-
break;
|
|
3305
|
-
}
|
|
3306
|
-
if (t[2]) _.ops.pop();
|
|
3307
|
-
_.trys.pop();
|
|
3308
|
-
continue;
|
|
3309
|
-
}
|
|
3310
|
-
op = body.call(thisArg, _);
|
|
3311
|
-
} catch (e) {
|
|
3312
|
-
op = [
|
|
3313
|
-
6,
|
|
3314
|
-
e
|
|
3315
|
-
];
|
|
3316
|
-
y = 0;
|
|
3317
|
-
} finally{
|
|
3318
|
-
f = t = 0;
|
|
3319
|
-
}
|
|
3320
|
-
if (op[0] & 5) throw op[1];
|
|
3321
|
-
return {
|
|
3322
|
-
value: op[0] ? op[1] : void 0,
|
|
3323
|
-
done: true
|
|
3324
|
-
};
|
|
3325
|
-
}
|
|
3326
|
-
}
|
|
3327
|
-
/**
|
|
3328
|
-
* Header name used by Zoho Sign to send the HMAC signature.
|
|
3329
|
-
*/ var ZOHO_SIGN_WEBHOOK_SIGNATURE_HEADER = 'x-zs-webhook-signature';
|
|
3330
|
-
/**
|
|
3331
|
-
* Creates a verifier for Zoho Sign webhook events using HMAC-SHA256 signature verification.
|
|
3332
|
-
*
|
|
3333
|
-
* Zoho Sign computes `base64(HMAC-SHA256(payload, secret))` and sends the result
|
|
3334
|
-
* in the `X-ZS-WEBHOOK-SIGNATURE` header. This verifier recomputes the signature
|
|
3335
|
-
* from the raw request body and compares using timing-safe equality.
|
|
3336
|
-
*
|
|
3337
|
-
* @param config - Configuration containing the webhook secret key.
|
|
3338
|
-
* @returns Verifies webhook requests.
|
|
3339
|
-
*
|
|
3340
|
-
* @example
|
|
3341
|
-
* ```typescript
|
|
3342
|
-
* const verifier = zohoSignWebhookEventVerifier({ secret: 'my-secret-key' });
|
|
3343
|
-
* const result = await verifier(req, rawBody);
|
|
3344
|
-
*
|
|
3345
|
-
* if (result.valid) {
|
|
3346
|
-
* console.log(result.event.operationType);
|
|
3347
|
-
* }
|
|
3348
|
-
* ```
|
|
3349
|
-
*/ function zohoSignWebhookEventVerifier(config) {
|
|
3350
|
-
var secret = config.secret;
|
|
3351
|
-
return function(request, rawBody) {
|
|
3352
|
-
return _async_to_generator$2(function() {
|
|
3353
|
-
var receivedSignature, result, payloadString, computedSignature, valid, receivedBuffer, computedBuffer, event, payload;
|
|
3354
|
-
return _ts_generator$2(this, function(_state) {
|
|
3355
|
-
receivedSignature = request.headers[ZOHO_SIGN_WEBHOOK_SIGNATURE_HEADER];
|
|
3356
|
-
result = {
|
|
3357
|
-
valid: false
|
|
3358
|
-
};
|
|
3359
|
-
if (receivedSignature) {
|
|
3360
|
-
payloadString = rawBody.toString('utf-8');
|
|
3361
|
-
// Compute HMAC-SHA256 and base64 encode
|
|
3362
|
-
computedSignature = node_crypto.createHmac('sha256', secret).update(payloadString, 'utf-8').digest('base64');
|
|
3363
|
-
// Use timing-safe comparison
|
|
3364
|
-
valid = false;
|
|
3365
|
-
try {
|
|
3366
|
-
receivedBuffer = Buffer.from(receivedSignature, 'base64');
|
|
3367
|
-
computedBuffer = Buffer.from(computedSignature, 'base64');
|
|
3368
|
-
if (receivedBuffer.length === computedBuffer.length) {
|
|
3369
|
-
valid = node_crypto.timingSafeEqual(receivedBuffer, computedBuffer);
|
|
3370
|
-
}
|
|
3371
|
-
} catch (unused) {
|
|
3372
|
-
valid = false;
|
|
3373
|
-
}
|
|
3374
|
-
if (valid) {
|
|
3375
|
-
try {
|
|
3376
|
-
payload = JSON.parse(payloadString);
|
|
3377
|
-
event = zohoSignWebhookEvent(payload);
|
|
3378
|
-
} catch (unused) {
|
|
3379
|
-
valid = false;
|
|
3380
|
-
}
|
|
3381
|
-
}
|
|
3382
|
-
if (valid && event) {
|
|
3383
|
-
result = {
|
|
3384
|
-
valid: true,
|
|
3385
|
-
event: event
|
|
3386
|
-
};
|
|
3387
|
-
}
|
|
3388
|
-
}
|
|
3389
|
-
return [
|
|
3390
|
-
2,
|
|
3391
|
-
result
|
|
3392
|
-
];
|
|
3393
|
-
});
|
|
3394
|
-
})();
|
|
3395
|
-
};
|
|
3396
|
-
}
|
|
3397
|
-
|
|
3398
|
-
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3399
|
-
try {
|
|
3400
|
-
var info = gen[key](arg);
|
|
3401
|
-
var value = info.value;
|
|
3402
|
-
} catch (error) {
|
|
3403
|
-
reject(error);
|
|
3404
|
-
return;
|
|
3405
|
-
}
|
|
3406
|
-
if (info.done) {
|
|
3407
|
-
resolve(value);
|
|
3408
|
-
} else {
|
|
3409
|
-
Promise.resolve(value).then(_next, _throw);
|
|
3410
|
-
}
|
|
3411
|
-
}
|
|
3412
|
-
function _async_to_generator$1(fn) {
|
|
3413
|
-
return function() {
|
|
3414
|
-
var self = this, args = arguments;
|
|
3415
|
-
return new Promise(function(resolve, reject) {
|
|
3416
|
-
var gen = fn.apply(self, args);
|
|
3417
|
-
function _next(value) {
|
|
3418
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
3419
|
-
}
|
|
3420
|
-
function _throw(err) {
|
|
3421
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3422
|
-
}
|
|
3423
|
-
_next(undefined);
|
|
3424
|
-
});
|
|
3425
|
-
};
|
|
3426
|
-
}
|
|
3427
|
-
function _class_call_check$4(instance, Constructor) {
|
|
3428
|
-
if (!(instance instanceof Constructor)) {
|
|
3429
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
function _defineProperties$3(target, props) {
|
|
3433
|
-
for(var i = 0; i < props.length; i++){
|
|
3434
|
-
var descriptor = props[i];
|
|
3435
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
3436
|
-
descriptor.configurable = true;
|
|
3437
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
3438
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3439
|
-
}
|
|
3440
|
-
}
|
|
3441
|
-
function _create_class$3(Constructor, protoProps, staticProps) {
|
|
3442
|
-
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
|
|
3443
|
-
return Constructor;
|
|
3444
|
-
}
|
|
3445
|
-
function _define_property$3(obj, key, value) {
|
|
3446
|
-
if (key in obj) {
|
|
3447
|
-
Object.defineProperty(obj, key, {
|
|
3448
|
-
value: value,
|
|
3449
|
-
enumerable: true,
|
|
3450
|
-
configurable: true,
|
|
3451
|
-
writable: true
|
|
3452
|
-
});
|
|
3453
|
-
} else {
|
|
3454
|
-
obj[key] = value;
|
|
3455
|
-
}
|
|
3456
|
-
return obj;
|
|
3457
|
-
}
|
|
3458
|
-
function _ts_generator$1(thisArg, body) {
|
|
3459
|
-
var f, y, t, _ = {
|
|
3460
|
-
label: 0,
|
|
3461
|
-
sent: function() {
|
|
3462
|
-
if (t[0] & 1) throw t[1];
|
|
3463
|
-
return t[1];
|
|
3464
|
-
},
|
|
3465
|
-
trys: [],
|
|
3466
|
-
ops: []
|
|
3467
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
3468
|
-
return d(g, "next", {
|
|
3469
|
-
value: verb(0)
|
|
3470
|
-
}), d(g, "throw", {
|
|
3471
|
-
value: verb(1)
|
|
3472
|
-
}), d(g, "return", {
|
|
3473
|
-
value: verb(2)
|
|
3474
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
3475
|
-
value: function() {
|
|
3476
|
-
return this;
|
|
3477
|
-
}
|
|
3478
|
-
}), g;
|
|
3479
|
-
function verb(n) {
|
|
3480
|
-
return function(v) {
|
|
3481
|
-
return step([
|
|
3482
|
-
n,
|
|
3483
|
-
v
|
|
3484
|
-
]);
|
|
3485
|
-
};
|
|
3486
|
-
}
|
|
3487
|
-
function step(op) {
|
|
3488
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
3489
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
3490
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3491
|
-
if (y = 0, t) op = [
|
|
3492
|
-
op[0] & 2,
|
|
3493
|
-
t.value
|
|
3494
|
-
];
|
|
3495
|
-
switch(op[0]){
|
|
3496
|
-
case 0:
|
|
3497
|
-
case 1:
|
|
3498
|
-
t = op;
|
|
3499
|
-
break;
|
|
3500
|
-
case 4:
|
|
3501
|
-
_.label++;
|
|
3502
|
-
return {
|
|
3503
|
-
value: op[1],
|
|
3504
|
-
done: false
|
|
3505
|
-
};
|
|
3506
|
-
case 5:
|
|
3507
|
-
_.label++;
|
|
3508
|
-
y = op[1];
|
|
3509
|
-
op = [
|
|
3510
|
-
0
|
|
3511
|
-
];
|
|
3512
|
-
continue;
|
|
3513
|
-
case 7:
|
|
3514
|
-
op = _.ops.pop();
|
|
3515
|
-
_.trys.pop();
|
|
3516
|
-
continue;
|
|
3517
|
-
default:
|
|
3518
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
3519
|
-
_ = 0;
|
|
3520
|
-
continue;
|
|
3521
|
-
}
|
|
3522
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
3523
|
-
_.label = op[1];
|
|
3524
|
-
break;
|
|
3525
|
-
}
|
|
3526
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
3527
|
-
_.label = t[1];
|
|
3528
|
-
t = op;
|
|
3529
|
-
break;
|
|
3530
|
-
}
|
|
3531
|
-
if (t && _.label < t[2]) {
|
|
3532
|
-
_.label = t[2];
|
|
3533
|
-
_.ops.push(op);
|
|
3534
|
-
break;
|
|
3535
|
-
}
|
|
3536
|
-
if (t[2]) _.ops.pop();
|
|
3537
|
-
_.trys.pop();
|
|
3538
|
-
continue;
|
|
3539
|
-
}
|
|
3540
|
-
op = body.call(thisArg, _);
|
|
3541
|
-
} catch (e) {
|
|
3542
|
-
op = [
|
|
3543
|
-
6,
|
|
3544
|
-
e
|
|
3545
|
-
];
|
|
3546
|
-
y = 0;
|
|
3547
|
-
} finally{
|
|
3548
|
-
f = t = 0;
|
|
3549
|
-
}
|
|
3550
|
-
if (op[0] & 5) throw op[1];
|
|
3551
|
-
return {
|
|
3552
|
-
value: op[0] ? op[1] : void 0,
|
|
3553
|
-
done: true
|
|
3554
|
-
};
|
|
3555
|
-
}
|
|
3556
|
-
}
|
|
3557
|
-
/**
|
|
3558
|
-
* Service that handles Zoho Sign webhook events.
|
|
3559
|
-
*/ exports.ZohoSignWebhookService = /*#__PURE__*/ function() {
|
|
3560
|
-
function ZohoSignWebhookService(zohoSignWebhookServiceConfig) {
|
|
3561
|
-
_class_call_check$4(this, ZohoSignWebhookService);
|
|
3562
|
-
_define_property$3(this, "logger", new common.Logger('ZohoSignWebhookService'));
|
|
3563
|
-
_define_property$3(this, "_verifier", void 0);
|
|
3564
|
-
_define_property$3(this, "handler", zohoSignEventHandlerFactory());
|
|
3565
|
-
_define_property$3(this, "configure", zohoSignEventHandlerConfigurerFactory(this.handler));
|
|
3566
|
-
var webhookSecret = zohoSignWebhookServiceConfig.zohoSignWebhook.webhookSecret;
|
|
3567
|
-
this._verifier = zohoSignWebhookEventVerifier({
|
|
3568
|
-
secret: webhookSecret
|
|
3569
|
-
});
|
|
3570
|
-
}
|
|
3571
|
-
_create_class$3(ZohoSignWebhookService, [
|
|
3572
|
-
{
|
|
3573
|
-
key: "updateForWebhook",
|
|
3574
|
-
value: function updateForWebhook(req, rawBody) {
|
|
3575
|
-
return _async_to_generator$1(function() {
|
|
3576
|
-
var result;
|
|
3577
|
-
return _ts_generator$1(this, function(_state) {
|
|
3578
|
-
switch(_state.label){
|
|
3579
|
-
case 0:
|
|
3580
|
-
return [
|
|
3581
|
-
4,
|
|
3582
|
-
this._verifier(req, rawBody)
|
|
3583
|
-
];
|
|
3584
|
-
case 1:
|
|
3585
|
-
result = _state.sent();
|
|
3586
|
-
if (!result.valid) return [
|
|
3587
|
-
3,
|
|
3588
|
-
3
|
|
3589
|
-
];
|
|
3590
|
-
return [
|
|
3591
|
-
4,
|
|
3592
|
-
this.updateForZohoSignEvent(result.event)
|
|
3593
|
-
];
|
|
3594
|
-
case 2:
|
|
3595
|
-
_state.sent();
|
|
3596
|
-
return [
|
|
3597
|
-
3,
|
|
3598
|
-
4
|
|
3599
|
-
];
|
|
3600
|
-
case 3:
|
|
3601
|
-
this.logger.warn('Received invalid Zoho Sign webhook event.', req);
|
|
3602
|
-
_state.label = 4;
|
|
3603
|
-
case 4:
|
|
3604
|
-
return [
|
|
3605
|
-
2
|
|
3606
|
-
];
|
|
3607
|
-
}
|
|
3608
|
-
});
|
|
3609
|
-
}).call(this);
|
|
3610
|
-
}
|
|
3611
|
-
},
|
|
3612
|
-
{
|
|
3613
|
-
key: "updateForZohoSignEvent",
|
|
3614
|
-
value: function updateForZohoSignEvent(event) {
|
|
3615
|
-
return _async_to_generator$1(function() {
|
|
3616
|
-
var result;
|
|
3617
|
-
return _ts_generator$1(this, function(_state) {
|
|
3618
|
-
switch(_state.label){
|
|
3619
|
-
case 0:
|
|
3620
|
-
return [
|
|
3621
|
-
4,
|
|
3622
|
-
this.handler(event)
|
|
3623
|
-
];
|
|
3624
|
-
case 1:
|
|
3625
|
-
result = _state.sent();
|
|
3626
|
-
if (!result) {
|
|
3627
|
-
this.logger.warn('Received unexpected/unhandled Zoho Sign webhook event.', event);
|
|
3628
|
-
}
|
|
3629
|
-
return [
|
|
3630
|
-
2
|
|
3631
|
-
];
|
|
3632
|
-
}
|
|
3633
|
-
});
|
|
3634
|
-
}).call(this);
|
|
3635
|
-
}
|
|
3636
|
-
}
|
|
3637
|
-
]);
|
|
3638
|
-
return ZohoSignWebhookService;
|
|
3639
|
-
}();
|
|
3640
|
-
exports.ZohoSignWebhookService = __decorate([
|
|
3641
|
-
common.Injectable(),
|
|
3642
|
-
__param(0, common.Inject(ZohoSignWebhookServiceConfig))
|
|
3643
|
-
], exports.ZohoSignWebhookService);
|
|
3644
|
-
|
|
3645
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3646
|
-
try {
|
|
3647
|
-
var info = gen[key](arg);
|
|
3648
|
-
var value = info.value;
|
|
3649
|
-
} catch (error) {
|
|
3650
|
-
reject(error);
|
|
3651
|
-
return;
|
|
3652
|
-
}
|
|
3653
|
-
if (info.done) {
|
|
3654
|
-
resolve(value);
|
|
3655
|
-
} else {
|
|
3656
|
-
Promise.resolve(value).then(_next, _throw);
|
|
3657
|
-
}
|
|
3658
|
-
}
|
|
3659
|
-
function _async_to_generator(fn) {
|
|
3660
|
-
return function() {
|
|
3661
|
-
var self = this, args = arguments;
|
|
3662
|
-
return new Promise(function(resolve, reject) {
|
|
3663
|
-
var gen = fn.apply(self, args);
|
|
3664
|
-
function _next(value) {
|
|
3665
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
3666
|
-
}
|
|
3667
|
-
function _throw(err) {
|
|
3668
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3669
|
-
}
|
|
3670
|
-
_next(undefined);
|
|
3671
|
-
});
|
|
3672
|
-
};
|
|
3673
|
-
}
|
|
3674
|
-
function _class_call_check$3(instance, Constructor) {
|
|
3675
|
-
if (!(instance instanceof Constructor)) {
|
|
3676
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3677
|
-
}
|
|
3678
|
-
}
|
|
3679
|
-
function _defineProperties$2(target, props) {
|
|
3680
|
-
for(var i = 0; i < props.length; i++){
|
|
3681
|
-
var descriptor = props[i];
|
|
3682
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
3683
|
-
descriptor.configurable = true;
|
|
3684
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
3685
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3686
|
-
}
|
|
3687
|
-
}
|
|
3688
|
-
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
3689
|
-
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
3690
|
-
return Constructor;
|
|
3691
|
-
}
|
|
3692
|
-
function _define_property$2(obj, key, value) {
|
|
3693
|
-
if (key in obj) {
|
|
3694
|
-
Object.defineProperty(obj, key, {
|
|
3695
|
-
value: value,
|
|
3696
|
-
enumerable: true,
|
|
3697
|
-
configurable: true,
|
|
3698
|
-
writable: true
|
|
3699
|
-
});
|
|
3700
|
-
} else {
|
|
3701
|
-
obj[key] = value;
|
|
3702
|
-
}
|
|
3703
|
-
return obj;
|
|
3704
|
-
}
|
|
3705
|
-
function _ts_generator(thisArg, body) {
|
|
3706
|
-
var f, y, t, _ = {
|
|
3707
|
-
label: 0,
|
|
3708
|
-
sent: function() {
|
|
3709
|
-
if (t[0] & 1) throw t[1];
|
|
3710
|
-
return t[1];
|
|
3711
|
-
},
|
|
3712
|
-
trys: [],
|
|
3713
|
-
ops: []
|
|
3714
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
3715
|
-
return d(g, "next", {
|
|
3716
|
-
value: verb(0)
|
|
3717
|
-
}), d(g, "throw", {
|
|
3718
|
-
value: verb(1)
|
|
3719
|
-
}), d(g, "return", {
|
|
3720
|
-
value: verb(2)
|
|
3721
|
-
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
3722
|
-
value: function() {
|
|
3723
|
-
return this;
|
|
3724
|
-
}
|
|
3725
|
-
}), g;
|
|
3726
|
-
function verb(n) {
|
|
3727
|
-
return function(v) {
|
|
3728
|
-
return step([
|
|
3729
|
-
n,
|
|
3730
|
-
v
|
|
3731
|
-
]);
|
|
3732
|
-
};
|
|
3733
|
-
}
|
|
3734
|
-
function step(op) {
|
|
3735
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
3736
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
3737
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3738
|
-
if (y = 0, t) op = [
|
|
3739
|
-
op[0] & 2,
|
|
3740
|
-
t.value
|
|
3741
|
-
];
|
|
3742
|
-
switch(op[0]){
|
|
3743
|
-
case 0:
|
|
3744
|
-
case 1:
|
|
3745
|
-
t = op;
|
|
3746
|
-
break;
|
|
3747
|
-
case 4:
|
|
3748
|
-
_.label++;
|
|
3749
|
-
return {
|
|
3750
|
-
value: op[1],
|
|
3751
|
-
done: false
|
|
3752
|
-
};
|
|
3753
|
-
case 5:
|
|
3754
|
-
_.label++;
|
|
3755
|
-
y = op[1];
|
|
3756
|
-
op = [
|
|
3757
|
-
0
|
|
3758
|
-
];
|
|
3759
|
-
continue;
|
|
3760
|
-
case 7:
|
|
3761
|
-
op = _.ops.pop();
|
|
3762
|
-
_.trys.pop();
|
|
3763
|
-
continue;
|
|
3764
|
-
default:
|
|
3765
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
3766
|
-
_ = 0;
|
|
3767
|
-
continue;
|
|
3768
|
-
}
|
|
3769
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
3770
|
-
_.label = op[1];
|
|
3771
|
-
break;
|
|
3772
|
-
}
|
|
3773
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
3774
|
-
_.label = t[1];
|
|
3775
|
-
t = op;
|
|
3776
|
-
break;
|
|
3777
|
-
}
|
|
3778
|
-
if (t && _.label < t[2]) {
|
|
3779
|
-
_.label = t[2];
|
|
3780
|
-
_.ops.push(op);
|
|
3781
|
-
break;
|
|
3782
|
-
}
|
|
3783
|
-
if (t[2]) _.ops.pop();
|
|
3784
|
-
_.trys.pop();
|
|
3785
|
-
continue;
|
|
3786
|
-
}
|
|
3787
|
-
op = body.call(thisArg, _);
|
|
3788
|
-
} catch (e) {
|
|
3789
|
-
op = [
|
|
3790
|
-
6,
|
|
3791
|
-
e
|
|
3792
|
-
];
|
|
3793
|
-
y = 0;
|
|
3794
|
-
} finally{
|
|
3795
|
-
f = t = 0;
|
|
3796
|
-
}
|
|
3797
|
-
if (op[0] & 5) throw op[1];
|
|
3798
|
-
return {
|
|
3799
|
-
value: op[0] ? op[1] : void 0,
|
|
3800
|
-
done: true
|
|
3801
|
-
};
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
exports.ZohoSignWebhookController = /*#__PURE__*/ function() {
|
|
3805
|
-
function ZohoSignWebhookController(zohoSignWebhookService) {
|
|
3806
|
-
_class_call_check$3(this, ZohoSignWebhookController);
|
|
3807
|
-
_define_property$2(this, "_zohoSignWebhookService", void 0);
|
|
3808
|
-
this._zohoSignWebhookService = zohoSignWebhookService;
|
|
3809
|
-
}
|
|
3810
|
-
_create_class$2(ZohoSignWebhookController, [
|
|
3811
|
-
{
|
|
3812
|
-
key: "handleZohoSignWebhook",
|
|
3813
|
-
value: function handleZohoSignWebhook(req, rawBody) {
|
|
3814
|
-
return _async_to_generator(function() {
|
|
3815
|
-
return _ts_generator(this, function(_state) {
|
|
3816
|
-
switch(_state.label){
|
|
3817
|
-
case 0:
|
|
3818
|
-
return [
|
|
3819
|
-
4,
|
|
3820
|
-
this._zohoSignWebhookService.updateForWebhook(req, rawBody)
|
|
3821
|
-
];
|
|
3822
|
-
case 1:
|
|
3823
|
-
_state.sent();
|
|
3824
|
-
return [
|
|
3825
|
-
2
|
|
3826
|
-
];
|
|
3827
|
-
}
|
|
3828
|
-
});
|
|
3829
|
-
}).call(this);
|
|
3830
|
-
}
|
|
3831
|
-
}
|
|
3832
|
-
]);
|
|
3833
|
-
return ZohoSignWebhookController;
|
|
3834
|
-
}();
|
|
3835
|
-
__decorate([
|
|
3836
|
-
common.Post(),
|
|
3837
|
-
__param(0, common.Req()),
|
|
3838
|
-
__param(1, nestjs.RawBody())
|
|
3839
|
-
], exports.ZohoSignWebhookController.prototype, "handleZohoSignWebhook", null);
|
|
3840
|
-
exports.ZohoSignWebhookController = __decorate([
|
|
3841
|
-
common.Controller('/webhook/zoho/sign'),
|
|
3842
|
-
__param(0, common.Inject(exports.ZohoSignWebhookService))
|
|
3843
|
-
], exports.ZohoSignWebhookController);
|
|
3844
|
-
|
|
3845
|
-
function _class_call_check$2(instance, Constructor) {
|
|
3846
|
-
if (!(instance instanceof Constructor)) {
|
|
3847
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3848
|
-
}
|
|
3849
|
-
}
|
|
3850
|
-
/**
|
|
3851
|
-
* Reads the Zoho Sign webhook secret from the NestJS ConfigService
|
|
3852
|
-
* and returns a validated webhook service config.
|
|
3853
|
-
*
|
|
3854
|
-
* @param configService - NestJS config service populated with webhook environment variables.
|
|
3855
|
-
* @returns Validated Zoho Sign webhook service configuration.
|
|
3856
|
-
* @throws {Error} If the webhook secret is not configured.
|
|
3857
|
-
*/ function zohoSignWebhookServiceConfigFactory(configService) {
|
|
3858
|
-
var config = {
|
|
3859
|
-
zohoSignWebhook: {
|
|
3860
|
-
webhookSecret: configService.get(ZOHO_SIGN_WEBHOOK_SECRET_TOKEN_ENV_VAR)
|
|
3861
|
-
}
|
|
3862
|
-
};
|
|
3863
|
-
ZohoSignWebhookServiceConfig.assertValidConfig(config);
|
|
3864
|
-
return config;
|
|
3865
|
-
}
|
|
3866
|
-
exports.ZohoSignWebhookModule = function ZohoSignWebhookModule() {
|
|
3867
|
-
_class_call_check$2(this, ZohoSignWebhookModule);
|
|
3868
|
-
};
|
|
3869
|
-
exports.ZohoSignWebhookModule = __decorate([
|
|
3870
|
-
common.Module({
|
|
3871
|
-
imports: [
|
|
3872
|
-
config.ConfigModule
|
|
3873
|
-
],
|
|
3874
|
-
controllers: [
|
|
3875
|
-
exports.ZohoSignWebhookController
|
|
3876
|
-
],
|
|
3877
|
-
providers: [
|
|
3878
|
-
{
|
|
3879
|
-
provide: ZohoSignWebhookServiceConfig,
|
|
3880
|
-
inject: [
|
|
3881
|
-
config.ConfigService
|
|
3882
|
-
],
|
|
3883
|
-
useFactory: zohoSignWebhookServiceConfigFactory
|
|
3884
|
-
},
|
|
3885
|
-
exports.ZohoSignWebhookService
|
|
3886
|
-
],
|
|
3887
|
-
exports: [
|
|
3888
|
-
exports.ZohoSignWebhookService
|
|
3889
|
-
]
|
|
3890
|
-
})
|
|
3891
|
-
], exports.ZohoSignWebhookModule);
|
|
3892
|
-
|
|
3893
|
-
function _class_call_check$1(instance, Constructor) {
|
|
3894
|
-
if (!(instance instanceof Constructor)) {
|
|
3895
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
function _defineProperties$1(target, props) {
|
|
3899
|
-
for(var i = 0; i < props.length; i++){
|
|
3900
|
-
var descriptor = props[i];
|
|
3901
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
3902
|
-
descriptor.configurable = true;
|
|
3903
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
3904
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3905
|
-
}
|
|
3906
|
-
}
|
|
3907
|
-
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
3908
|
-
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
3909
|
-
return Constructor;
|
|
3910
|
-
}
|
|
3911
|
-
function _define_property$1(obj, key, value) {
|
|
3912
|
-
if (key in obj) {
|
|
3913
|
-
Object.defineProperty(obj, key, {
|
|
3914
|
-
value: value,
|
|
3915
|
-
enumerable: true,
|
|
3916
|
-
configurable: true,
|
|
3917
|
-
writable: true
|
|
3918
|
-
});
|
|
3919
|
-
} else {
|
|
3920
|
-
obj[key] = value;
|
|
3921
|
-
}
|
|
3922
|
-
return obj;
|
|
3923
|
-
}
|
|
3924
|
-
/**
|
|
3925
|
-
* Abstract configuration class for the NestJS Zoho Desk service.
|
|
3926
|
-
*
|
|
3927
|
-
* Used as a DI token so that applications can provide their own config values
|
|
3928
|
-
* while keeping the expected shape consistent.
|
|
3929
|
-
*/ var ZohoDeskServiceConfig = /*#__PURE__*/ function() {
|
|
3930
|
-
function ZohoDeskServiceConfig() {
|
|
3931
|
-
_class_call_check$1(this, ZohoDeskServiceConfig);
|
|
3932
|
-
/**
|
|
3933
|
-
* Zoho Desk API connection settings (endpoint URL, org ID, etc.).
|
|
3934
|
-
*/ _define_property$1(this, "zohoDesk", void 0);
|
|
3935
|
-
/**
|
|
3936
|
-
* Optional factory-level overrides applied when creating the underlying Desk client.
|
|
3937
|
-
*/ _define_property$1(this, "factoryConfig", void 0);
|
|
3938
|
-
}
|
|
3939
|
-
_create_class$1(ZohoDeskServiceConfig, null, [
|
|
3940
|
-
{
|
|
3941
|
-
key: "assertValidConfig",
|
|
3942
|
-
value: /**
|
|
3943
|
-
* Validates that the required Zoho Desk connection fields are present and well-formed.
|
|
3944
|
-
*
|
|
3945
|
-
* @param config - The Desk service config to validate.
|
|
3946
|
-
* @throws {Error} When `config.zohoDesk.orgId` is missing or fails the shared Zoho config assertion.
|
|
3947
|
-
*/ function assertValidConfig(config) {
|
|
3948
|
-
assertValidZohoConfig(config.zohoDesk);
|
|
3949
|
-
if (!config.zohoDesk.orgId) {
|
|
3950
|
-
throw new Error('No Zoho Desk orgId specified.');
|
|
3951
|
-
}
|
|
3952
|
-
}
|
|
3953
|
-
}
|
|
3954
|
-
]);
|
|
3955
|
-
return ZohoDeskServiceConfig;
|
|
3956
|
-
}
|
|
3957
|
-
();
|
|
3958
|
-
|
|
3959
|
-
function _class_call_check(instance, Constructor) {
|
|
3960
|
-
if (!(instance instanceof Constructor)) {
|
|
3961
|
-
throw new TypeError("Cannot call a class as a function");
|
|
3962
|
-
}
|
|
3963
|
-
}
|
|
3964
|
-
function _defineProperties(target, props) {
|
|
3965
|
-
for(var i = 0; i < props.length; i++){
|
|
3966
|
-
var descriptor = props[i];
|
|
3967
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
3968
|
-
descriptor.configurable = true;
|
|
3969
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
3970
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3973
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
3974
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3975
|
-
return Constructor;
|
|
3976
|
-
}
|
|
3977
|
-
function _define_property(obj, key, value) {
|
|
3978
|
-
if (key in obj) {
|
|
3979
|
-
Object.defineProperty(obj, key, {
|
|
3980
|
-
value: value,
|
|
3981
|
-
enumerable: true,
|
|
3982
|
-
configurable: true,
|
|
3983
|
-
writable: true
|
|
3984
|
-
});
|
|
3985
|
-
} else {
|
|
3986
|
-
obj[key] = value;
|
|
3987
|
-
}
|
|
3988
|
-
return obj;
|
|
3989
|
-
}
|
|
3990
|
-
function _object_spread(target) {
|
|
3991
|
-
for(var i = 1; i < arguments.length; i++){
|
|
3992
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
3993
|
-
var ownKeys = Object.keys(source);
|
|
3994
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3995
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3996
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3997
|
-
}));
|
|
3998
|
-
}
|
|
3999
|
-
ownKeys.forEach(function(key) {
|
|
4000
|
-
_define_property(target, key, source[key]);
|
|
4001
|
-
});
|
|
4002
|
-
}
|
|
4003
|
-
return target;
|
|
4004
|
-
}
|
|
4005
|
-
function ownKeys(object, enumerableOnly) {
|
|
4006
|
-
var keys = Object.keys(object);
|
|
4007
|
-
if (Object.getOwnPropertySymbols) {
|
|
4008
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
4009
|
-
keys.push.apply(keys, symbols);
|
|
4010
|
-
}
|
|
4011
|
-
return keys;
|
|
4012
|
-
}
|
|
4013
|
-
function _object_spread_props(target, source) {
|
|
4014
|
-
source = source != null ? source : {};
|
|
4015
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
4016
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4017
|
-
} else {
|
|
4018
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
4019
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4020
|
-
});
|
|
4021
|
-
}
|
|
4022
|
-
return target;
|
|
4023
|
-
}
|
|
4024
|
-
/**
|
|
4025
|
-
* NestJS injectable service that wraps the Zoho Desk API.
|
|
4026
|
-
*
|
|
4027
|
-
* Provides convenient accessor getters for all Desk operations (tickets, departments, contacts),
|
|
4028
|
-
* each bound to the authenticated Desk context created during construction.
|
|
4029
|
-
*/ exports.ZohoDeskApi = /*#__PURE__*/ function() {
|
|
4030
|
-
function ZohoDeskApi(config, zohoAccountsApi) {
|
|
4031
|
-
_class_call_check(this, ZohoDeskApi);
|
|
4032
|
-
_define_property(this, "config", void 0);
|
|
4033
|
-
_define_property(this, "zohoAccountsApi", void 0);
|
|
4034
|
-
/**
|
|
4035
|
-
* Underlying Zoho Desk client instance, initialized from the injected config and accounts context.
|
|
4036
|
-
*/ _define_property(this, "zohoDesk", void 0);
|
|
4037
|
-
this.config = config;
|
|
4038
|
-
this.zohoAccountsApi = zohoAccountsApi;
|
|
4039
|
-
this.zohoDesk = zoho.zohoDeskFactory(_object_spread_props(_object_spread({}, config.factoryConfig), {
|
|
4040
|
-
accountsContext: zohoAccountsApi.accountsContext
|
|
4041
|
-
}))(config.zohoDesk);
|
|
4042
|
-
}
|
|
4043
|
-
_create_class(ZohoDeskApi, [
|
|
4044
|
-
{
|
|
4045
|
-
key: "deskContext",
|
|
4046
|
-
get: /**
|
|
4047
|
-
* The authenticated Desk context used by all operation accessors.
|
|
4048
|
-
*
|
|
4049
|
-
* @returns The Desk context from the underlying client.
|
|
4050
|
-
*/ function get() {
|
|
4051
|
-
return this.zohoDesk.deskContext;
|
|
4052
|
-
}
|
|
4053
|
-
},
|
|
4054
|
-
{
|
|
4055
|
-
key: "zohoRateLimiter",
|
|
4056
|
-
get: /**
|
|
4057
|
-
* Rate limiter shared across all Desk requests to respect Zoho API quotas.
|
|
4058
|
-
*
|
|
4059
|
-
* @returns The shared rate limiter instance.
|
|
4060
|
-
*/ function get() {
|
|
4061
|
-
return this.zohoDesk.deskContext.zohoRateLimiter;
|
|
4062
|
-
}
|
|
4063
|
-
},
|
|
4064
|
-
{
|
|
4065
|
-
key: "getTickets",
|
|
4066
|
-
get: // MARK: Ticket Accessors
|
|
4067
|
-
/**
|
|
4068
|
-
* Configured pass-through for {@link zohoDeskGetTickets}.
|
|
4069
|
-
*
|
|
4070
|
-
* @returns Lists Desk tickets matching the supplied filter/pagination input.
|
|
4071
|
-
*/ function get() {
|
|
4072
|
-
return zoho.zohoDeskGetTickets(this.deskContext);
|
|
4073
|
-
}
|
|
4074
|
-
},
|
|
4075
|
-
{
|
|
4076
|
-
key: "getTicketById",
|
|
4077
|
-
get: /**
|
|
4078
|
-
* Configured pass-through for {@link zohoDeskGetTicketById}.
|
|
4079
|
-
*
|
|
4080
|
-
* @returns Fetches a single Desk ticket by its identifier.
|
|
4081
|
-
*/ function get() {
|
|
4082
|
-
return zoho.zohoDeskGetTicketById(this.deskContext);
|
|
4083
|
-
}
|
|
4084
|
-
},
|
|
4085
|
-
{
|
|
4086
|
-
key: "searchTickets",
|
|
4087
|
-
get: /**
|
|
4088
|
-
* Configured pass-through for {@link zohoDeskSearchTickets}.
|
|
4089
|
-
*
|
|
4090
|
-
* @returns Runs a Desk ticket search with the provided criteria.
|
|
4091
|
-
*/ function get() {
|
|
4092
|
-
return zoho.zohoDeskSearchTickets(this.deskContext);
|
|
4093
|
-
}
|
|
4094
|
-
},
|
|
4095
|
-
{
|
|
4096
|
-
key: "getTicketsForContact",
|
|
4097
|
-
get: /**
|
|
4098
|
-
* Configured pass-through for {@link zohoDeskGetTicketsForContact}.
|
|
4099
|
-
*
|
|
4100
|
-
* @returns Lists Desk tickets associated with the given contact id.
|
|
4101
|
-
*/ function get() {
|
|
4102
|
-
return zoho.zohoDeskGetTicketsForContact(this.deskContext);
|
|
4103
|
-
}
|
|
4104
|
-
},
|
|
4105
|
-
{
|
|
4106
|
-
key: "getTicketsForProduct",
|
|
4107
|
-
get: /**
|
|
4108
|
-
* Configured pass-through for {@link zohoDeskGetTicketsForProduct}.
|
|
4109
|
-
*
|
|
4110
|
-
* @returns Lists Desk tickets associated with the given product id.
|
|
4111
|
-
*/ function get() {
|
|
4112
|
-
return zoho.zohoDeskGetTicketsForProduct(this.deskContext);
|
|
4113
|
-
}
|
|
4114
|
-
},
|
|
4115
|
-
{
|
|
4116
|
-
key: "getTicketMetrics",
|
|
4117
|
-
get: /**
|
|
4118
|
-
* Configured pass-through for {@link zohoDeskGetTicketMetrics}.
|
|
4119
|
-
*
|
|
4120
|
-
* @returns Fetches aggregated metrics for the requested Desk tickets.
|
|
4121
|
-
*/ function get() {
|
|
4122
|
-
return zoho.zohoDeskGetTicketMetrics(this.deskContext);
|
|
4123
|
-
}
|
|
4124
|
-
},
|
|
4125
|
-
{
|
|
4126
|
-
key: "getAgentsTicketsCount",
|
|
4127
|
-
get: /**
|
|
4128
|
-
* Configured pass-through for {@link zohoDeskGetAgentsTicketsCount}.
|
|
4129
|
-
*
|
|
4130
|
-
* @returns Returns ticket counts grouped by agent for the requested filter.
|
|
4131
|
-
*/ function get() {
|
|
4132
|
-
return zoho.zohoDeskGetAgentsTicketsCount(this.deskContext);
|
|
4133
|
-
}
|
|
4134
|
-
},
|
|
4135
|
-
{
|
|
4136
|
-
key: "getTicketsPageFactory",
|
|
4137
|
-
get: /**
|
|
4138
|
-
* Configured pass-through for {@link zohoDeskGetTicketsPageFactory}.
|
|
4139
|
-
*
|
|
4140
|
-
* @returns A paged result factory for iterating over Desk ticket list responses.
|
|
4141
|
-
*/ function get() {
|
|
4142
|
-
return zoho.zohoDeskGetTicketsPageFactory(this.deskContext);
|
|
4143
|
-
}
|
|
4144
|
-
},
|
|
4145
|
-
{
|
|
4146
|
-
key: "searchTicketsPageFactory",
|
|
4147
|
-
get: /**
|
|
4148
|
-
* Configured pass-through for {@link zohoDeskSearchTicketsPageFactory}.
|
|
4149
|
-
*
|
|
4150
|
-
* @returns A paged result factory for iterating over Desk ticket search responses.
|
|
4151
|
-
*/ function get() {
|
|
4152
|
-
return zoho.zohoDeskSearchTicketsPageFactory(this.deskContext);
|
|
4153
|
-
}
|
|
4154
|
-
},
|
|
4155
|
-
{
|
|
4156
|
-
key: "getDepartments",
|
|
4157
|
-
get: // MARK: Department Accessors
|
|
4158
|
-
/**
|
|
4159
|
-
* Configured pass-through for {@link zohoDeskGetDepartments}.
|
|
4160
|
-
*
|
|
4161
|
-
* @returns Lists Desk departments visible to the authenticated portal.
|
|
4162
|
-
*/ function get() {
|
|
4163
|
-
return zoho.zohoDeskGetDepartments(this.deskContext);
|
|
4164
|
-
}
|
|
4165
|
-
},
|
|
4166
|
-
{
|
|
4167
|
-
key: "getDepartmentById",
|
|
4168
|
-
get: /**
|
|
4169
|
-
* Configured pass-through for {@link zohoDeskGetDepartmentById}.
|
|
4170
|
-
*
|
|
4171
|
-
* @returns Fetches a single Desk department by its identifier.
|
|
4172
|
-
*/ function get() {
|
|
4173
|
-
return zoho.zohoDeskGetDepartmentById(this.deskContext);
|
|
4174
|
-
}
|
|
4175
|
-
},
|
|
4176
|
-
{
|
|
4177
|
-
key: "getContacts",
|
|
4178
|
-
get: // MARK: Contact Accessors
|
|
4179
|
-
/**
|
|
4180
|
-
* Configured pass-through for {@link zohoDeskGetContacts}.
|
|
4181
|
-
*
|
|
4182
|
-
* @returns Lists Desk contacts matching the supplied filter/pagination input.
|
|
4183
|
-
*/ function get() {
|
|
4184
|
-
return zoho.zohoDeskGetContacts(this.deskContext);
|
|
4185
|
-
}
|
|
4186
|
-
},
|
|
4187
|
-
{
|
|
4188
|
-
key: "getContactById",
|
|
4189
|
-
get: /**
|
|
4190
|
-
* Configured pass-through for {@link zohoDeskGetContactById}.
|
|
4191
|
-
*
|
|
4192
|
-
* @returns Fetches a single Desk contact by its identifier.
|
|
4193
|
-
*/ function get() {
|
|
4194
|
-
return zoho.zohoDeskGetContactById(this.deskContext);
|
|
4195
|
-
}
|
|
4196
|
-
},
|
|
4197
|
-
{
|
|
4198
|
-
key: "getContactsByIds",
|
|
4199
|
-
get: /**
|
|
4200
|
-
* Configured pass-through for {@link zohoDeskGetContactsByIds}.
|
|
4201
|
-
*
|
|
4202
|
-
* @returns Fetches multiple Desk contacts in a single request by their identifiers.
|
|
4203
|
-
*/ function get() {
|
|
4204
|
-
return zoho.zohoDeskGetContactsByIds(this.deskContext);
|
|
4205
|
-
}
|
|
4206
|
-
},
|
|
4207
|
-
{
|
|
4208
|
-
key: "getContactsPageFactory",
|
|
4209
|
-
get: /**
|
|
4210
|
-
* Configured pass-through for {@link zohoDeskGetContactsPageFactory}.
|
|
4211
|
-
*
|
|
4212
|
-
* @returns A paged result factory for iterating over Desk contact list responses.
|
|
4213
|
-
*/ function get() {
|
|
4214
|
-
return zoho.zohoDeskGetContactsPageFactory(this.deskContext);
|
|
4215
|
-
}
|
|
4216
|
-
},
|
|
4217
|
-
{
|
|
4218
|
-
key: "getTicketTags",
|
|
4219
|
-
get: // MARK: Tag Accessors
|
|
4220
|
-
/**
|
|
4221
|
-
* Configured pass-through for {@link zohoDeskGetTicketTags}.
|
|
4222
|
-
*
|
|
4223
|
-
* @returns Lists the tags currently associated with a given Desk ticket.
|
|
4224
|
-
*/ function get() {
|
|
4225
|
-
return zoho.zohoDeskGetTicketTags(this.deskContext);
|
|
4226
|
-
}
|
|
4227
|
-
},
|
|
4228
|
-
{
|
|
4229
|
-
key: "associateTicketTags",
|
|
4230
|
-
get: /**
|
|
4231
|
-
* Configured pass-through for {@link zohoDeskAssociateTicketTags}.
|
|
4232
|
-
*
|
|
4233
|
-
* @returns Associates one or more tags with a Desk ticket.
|
|
4234
|
-
*/ function get() {
|
|
4235
|
-
return zoho.zohoDeskAssociateTicketTags(this.deskContext);
|
|
4236
|
-
}
|
|
4237
|
-
},
|
|
4238
|
-
{
|
|
4239
|
-
key: "dissociateTicketTag",
|
|
4240
|
-
get: /**
|
|
4241
|
-
* Configured pass-through for {@link zohoDeskDissociateTicketTag}.
|
|
4242
|
-
*
|
|
4243
|
-
* @returns Removes a single tag association from a Desk ticket.
|
|
4244
|
-
*/ function get() {
|
|
4245
|
-
return zoho.zohoDeskDissociateTicketTag(this.deskContext);
|
|
4246
|
-
}
|
|
4247
|
-
},
|
|
4248
|
-
{
|
|
4249
|
-
key: "searchTags",
|
|
4250
|
-
get: /**
|
|
4251
|
-
* Configured pass-through for {@link zohoDeskSearchTags}.
|
|
4252
|
-
*
|
|
4253
|
-
* @returns Searches the Desk tag catalog by the supplied criteria.
|
|
4254
|
-
*/ function get() {
|
|
4255
|
-
return zoho.zohoDeskSearchTags(this.deskContext);
|
|
4256
|
-
}
|
|
4257
|
-
},
|
|
4258
|
-
{
|
|
4259
|
-
key: "getAllTags",
|
|
4260
|
-
get: /**
|
|
4261
|
-
* Configured pass-through for {@link zohoDeskGetAllTags}.
|
|
4262
|
-
*
|
|
4263
|
-
* @returns Lists every tag defined on the Desk portal.
|
|
4264
|
-
*/ function get() {
|
|
4265
|
-
return zoho.zohoDeskGetAllTags(this.deskContext);
|
|
4266
|
-
}
|
|
4267
|
-
},
|
|
4268
|
-
{
|
|
4269
|
-
key: "getTicketFollowers",
|
|
4270
|
-
get: // MARK: Follower Accessors
|
|
4271
|
-
/**
|
|
4272
|
-
* Configured pass-through for {@link zohoDeskGetTicketFollowers}.
|
|
4273
|
-
*
|
|
4274
|
-
* @returns Lists the agents following a given Desk ticket.
|
|
4275
|
-
*/ function get() {
|
|
4276
|
-
return zoho.zohoDeskGetTicketFollowers(this.deskContext);
|
|
4277
|
-
}
|
|
4278
|
-
},
|
|
4279
|
-
{
|
|
4280
|
-
key: "addTicketFollowers",
|
|
4281
|
-
get: /**
|
|
4282
|
-
* Configured pass-through for {@link zohoDeskAddTicketFollowers}.
|
|
4283
|
-
*
|
|
4284
|
-
* @returns Adds one or more agents as followers of a Desk ticket.
|
|
4285
|
-
*/ function get() {
|
|
4286
|
-
return zoho.zohoDeskAddTicketFollowers(this.deskContext);
|
|
4287
|
-
}
|
|
4288
|
-
},
|
|
4289
|
-
{
|
|
4290
|
-
key: "removeTicketFollowers",
|
|
4291
|
-
get: /**
|
|
4292
|
-
* Configured pass-through for {@link zohoDeskRemoveTicketFollowers}.
|
|
4293
|
-
*
|
|
4294
|
-
* @returns Removes one or more agents from a Desk ticket's follower list.
|
|
4295
|
-
*/ function get() {
|
|
4296
|
-
return zoho.zohoDeskRemoveTicketFollowers(this.deskContext);
|
|
4297
|
-
}
|
|
4298
|
-
},
|
|
4299
|
-
{
|
|
4300
|
-
key: "getTicketAttachments",
|
|
4301
|
-
get: // MARK: Attachment Accessors
|
|
4302
|
-
/**
|
|
4303
|
-
* Configured pass-through for {@link zohoDeskGetTicketAttachments}.
|
|
4304
|
-
*
|
|
4305
|
-
* @returns Lists the file attachments on a given Desk ticket.
|
|
4306
|
-
*/ function get() {
|
|
4307
|
-
return zoho.zohoDeskGetTicketAttachments(this.deskContext);
|
|
4308
|
-
}
|
|
4309
|
-
},
|
|
4310
|
-
{
|
|
4311
|
-
key: "deleteTicketAttachment",
|
|
4312
|
-
get: /**
|
|
4313
|
-
* Configured pass-through for {@link zohoDeskDeleteTicketAttachment}.
|
|
4314
|
-
*
|
|
4315
|
-
* @returns Deletes a single attachment from a Desk ticket by attachment id.
|
|
4316
|
-
*/ function get() {
|
|
4317
|
-
return zoho.zohoDeskDeleteTicketAttachment(this.deskContext);
|
|
4318
|
-
}
|
|
4319
|
-
},
|
|
4320
|
-
{
|
|
4321
|
-
key: "getTicketComments",
|
|
4322
|
-
get: // MARK: Comment Accessors
|
|
4323
|
-
/**
|
|
4324
|
-
* Configured pass-through for {@link zohoDeskGetTicketComments}.
|
|
4325
|
-
*
|
|
4326
|
-
* @returns Lists the comments on a given Desk ticket.
|
|
4327
|
-
*/ function get() {
|
|
4328
|
-
return zoho.zohoDeskGetTicketComments(this.deskContext);
|
|
4329
|
-
}
|
|
4330
|
-
},
|
|
4331
|
-
{
|
|
4332
|
-
key: "getTicketCommentById",
|
|
4333
|
-
get: /**
|
|
4334
|
-
* Configured pass-through for {@link zohoDeskGetTicketCommentById}.
|
|
4335
|
-
*
|
|
4336
|
-
* @returns Fetches a single comment on a Desk ticket by comment id.
|
|
4337
|
-
*/ function get() {
|
|
4338
|
-
return zoho.zohoDeskGetTicketCommentById(this.deskContext);
|
|
4339
|
-
}
|
|
4340
|
-
},
|
|
4341
|
-
{
|
|
4342
|
-
key: "createTicketComment",
|
|
4343
|
-
get: /**
|
|
4344
|
-
* Configured pass-through for {@link zohoDeskCreateTicketComment}.
|
|
4345
|
-
*
|
|
4346
|
-
* @returns Creates a new comment on a Desk ticket from the supplied body.
|
|
4347
|
-
*/ function get() {
|
|
4348
|
-
return zoho.zohoDeskCreateTicketComment(this.deskContext);
|
|
4349
|
-
}
|
|
4350
|
-
},
|
|
4351
|
-
{
|
|
4352
|
-
key: "deleteTicketComment",
|
|
4353
|
-
get: /**
|
|
4354
|
-
* Configured pass-through for {@link zohoDeskDeleteTicketComment}.
|
|
4355
|
-
*
|
|
4356
|
-
* @returns Deletes a single comment from a Desk ticket by comment id.
|
|
4357
|
-
*/ function get() {
|
|
4358
|
-
return zoho.zohoDeskDeleteTicketComment(this.deskContext);
|
|
4359
|
-
}
|
|
4360
|
-
},
|
|
4361
|
-
{
|
|
4362
|
-
key: "getTicketTimer",
|
|
4363
|
-
get: // MARK: Time Tracking Accessors
|
|
4364
|
-
/**
|
|
4365
|
-
* Configured pass-through for {@link zohoDeskGetTicketTimer}.
|
|
4366
|
-
*
|
|
4367
|
-
* @returns Fetches the current timer state for a Desk ticket.
|
|
4368
|
-
*/ function get() {
|
|
4369
|
-
return zoho.zohoDeskGetTicketTimer(this.deskContext);
|
|
4370
|
-
}
|
|
4371
|
-
},
|
|
4372
|
-
{
|
|
4373
|
-
key: "performTicketTimerAction",
|
|
4374
|
-
get: /**
|
|
4375
|
-
* Configured pass-through for {@link zohoDeskPerformTicketTimerAction}.
|
|
4376
|
-
*
|
|
4377
|
-
* @returns Performs a timer action (start/pause/stop) on a Desk ticket.
|
|
4378
|
-
*/ function get() {
|
|
4379
|
-
return zoho.zohoDeskPerformTicketTimerAction(this.deskContext);
|
|
4380
|
-
}
|
|
4381
|
-
},
|
|
4382
|
-
{
|
|
4383
|
-
key: "getTicketTimeEntries",
|
|
4384
|
-
get: /**
|
|
4385
|
-
* Configured pass-through for {@link zohoDeskGetTicketTimeEntries}.
|
|
4386
|
-
*
|
|
4387
|
-
* @returns Lists the time entries logged against a Desk ticket.
|
|
4388
|
-
*/ function get() {
|
|
4389
|
-
return zoho.zohoDeskGetTicketTimeEntries(this.deskContext);
|
|
4390
|
-
}
|
|
4391
|
-
},
|
|
4392
|
-
{
|
|
4393
|
-
key: "getTicketTimeEntryById",
|
|
4394
|
-
get: /**
|
|
4395
|
-
* Configured pass-through for {@link zohoDeskGetTicketTimeEntryById}.
|
|
4396
|
-
*
|
|
4397
|
-
* @returns Fetches a single time entry on a Desk ticket by entry id.
|
|
4398
|
-
*/ function get() {
|
|
4399
|
-
return zoho.zohoDeskGetTicketTimeEntryById(this.deskContext);
|
|
4400
|
-
}
|
|
4401
|
-
},
|
|
4402
|
-
{
|
|
4403
|
-
key: "getTicketTimeEntrySummation",
|
|
4404
|
-
get: /**
|
|
4405
|
-
* Configured pass-through for {@link zohoDeskGetTicketTimeEntrySummation}.
|
|
4406
|
-
*
|
|
4407
|
-
* @returns Fetches the aggregated time-entry totals for a Desk ticket.
|
|
4408
|
-
*/ function get() {
|
|
4409
|
-
return zoho.zohoDeskGetTicketTimeEntrySummation(this.deskContext);
|
|
4410
|
-
}
|
|
4411
|
-
},
|
|
4412
|
-
{
|
|
4413
|
-
key: "getTicketThreads",
|
|
4414
|
-
get: // MARK: Thread Accessors
|
|
4415
|
-
/**
|
|
4416
|
-
* Configured pass-through for {@link zohoDeskGetTicketThreads}.
|
|
4417
|
-
*
|
|
4418
|
-
* @returns Lists the conversation threads on a given Desk ticket.
|
|
4419
|
-
*/ function get() {
|
|
4420
|
-
return zoho.zohoDeskGetTicketThreads(this.deskContext);
|
|
4421
|
-
}
|
|
4422
|
-
},
|
|
4423
|
-
{
|
|
4424
|
-
key: "getTicketThreadById",
|
|
4425
|
-
get: /**
|
|
4426
|
-
* Configured pass-through for {@link zohoDeskGetTicketThreadById}.
|
|
4427
|
-
*
|
|
4428
|
-
* @returns Fetches a single thread on a Desk ticket by thread id.
|
|
4429
|
-
*/ function get() {
|
|
4430
|
-
return zoho.zohoDeskGetTicketThreadById(this.deskContext);
|
|
4431
|
-
}
|
|
4432
|
-
},
|
|
4433
|
-
{
|
|
4434
|
-
key: "getTicketThreadsPageFactory",
|
|
4435
|
-
get: /**
|
|
4436
|
-
* Configured pass-through for {@link zohoDeskGetTicketThreadsPageFactory}.
|
|
4437
|
-
*
|
|
4438
|
-
* @returns A paged result factory for iterating over Desk ticket thread responses.
|
|
4439
|
-
*/ function get() {
|
|
4440
|
-
return zoho.zohoDeskGetTicketThreadsPageFactory(this.deskContext);
|
|
4441
|
-
}
|
|
4442
|
-
},
|
|
4443
|
-
{
|
|
4444
|
-
key: "getTicketActivities",
|
|
4445
|
-
get: // MARK: Activity Accessors
|
|
4446
|
-
/**
|
|
4447
|
-
* Configured pass-through for {@link zohoDeskGetTicketActivities}.
|
|
4448
|
-
*
|
|
4449
|
-
* @returns Lists the activity log entries for a given Desk ticket.
|
|
4450
|
-
*/ function get() {
|
|
4451
|
-
return zoho.zohoDeskGetTicketActivities(this.deskContext);
|
|
4452
|
-
}
|
|
4453
|
-
},
|
|
4454
|
-
{
|
|
4455
|
-
key: "getTicketActivitiesPageFactory",
|
|
4456
|
-
get: /**
|
|
4457
|
-
* Configured pass-through for {@link zohoDeskGetTicketActivitiesPageFactory}.
|
|
4458
|
-
*
|
|
4459
|
-
* @returns A paged result factory for iterating over Desk ticket activity responses.
|
|
4460
|
-
*/ function get() {
|
|
4461
|
-
return zoho.zohoDeskGetTicketActivitiesPageFactory(this.deskContext);
|
|
4462
|
-
}
|
|
4463
|
-
},
|
|
4464
|
-
{
|
|
4465
|
-
key: "getAgents",
|
|
4466
|
-
get: // MARK: Agent Accessors
|
|
4467
|
-
/**
|
|
4468
|
-
* Configured pass-through for {@link zohoDeskGetAgents}.
|
|
4469
|
-
*
|
|
4470
|
-
* @returns Lists Desk agents matching the supplied filter/pagination input.
|
|
4471
|
-
*/ function get() {
|
|
4472
|
-
return zoho.zohoDeskGetAgents(this.deskContext);
|
|
4473
|
-
}
|
|
4474
|
-
},
|
|
4475
|
-
{
|
|
4476
|
-
key: "getAgentById",
|
|
4477
|
-
get: /**
|
|
4478
|
-
* Configured pass-through for {@link zohoDeskGetAgentById}.
|
|
4479
|
-
*
|
|
4480
|
-
* @returns Fetches a single Desk agent by agent id.
|
|
4481
|
-
*/ function get() {
|
|
4482
|
-
return zoho.zohoDeskGetAgentById(this.deskContext);
|
|
4483
|
-
}
|
|
4484
|
-
},
|
|
4485
|
-
{
|
|
4486
|
-
key: "getAgentsByIds",
|
|
4487
|
-
get: /**
|
|
4488
|
-
* Configured pass-through for {@link zohoDeskGetAgentsByIds}.
|
|
4489
|
-
*
|
|
4490
|
-
* @returns Fetches multiple Desk agents in a single request by their identifiers.
|
|
4491
|
-
*/ function get() {
|
|
4492
|
-
return zoho.zohoDeskGetAgentsByIds(this.deskContext);
|
|
4493
|
-
}
|
|
4494
|
-
},
|
|
4495
|
-
{
|
|
4496
|
-
key: "getMyInfo",
|
|
4497
|
-
get: /**
|
|
4498
|
-
* Configured pass-through for {@link zohoDeskGetMyInfo}.
|
|
4499
|
-
*
|
|
4500
|
-
* @returns Fetches the profile information for the currently authenticated agent.
|
|
4501
|
-
*/ function get() {
|
|
4502
|
-
return zoho.zohoDeskGetMyInfo(this.deskContext);
|
|
4503
|
-
}
|
|
4504
|
-
},
|
|
4505
|
-
{
|
|
4506
|
-
key: "getAgentsPageFactory",
|
|
4507
|
-
get: /**
|
|
4508
|
-
* Configured pass-through for {@link zohoDeskGetAgentsPageFactory}.
|
|
4509
|
-
*
|
|
4510
|
-
* @returns A paged result factory for iterating over Desk agent list responses.
|
|
4511
|
-
*/ function get() {
|
|
4512
|
-
return zoho.zohoDeskGetAgentsPageFactory(this.deskContext);
|
|
4513
|
-
}
|
|
4514
|
-
}
|
|
4515
|
-
]);
|
|
4516
|
-
return ZohoDeskApi;
|
|
4517
|
-
}();
|
|
4518
|
-
exports.ZohoDeskApi = __decorate([
|
|
4519
|
-
common.Injectable(),
|
|
4520
|
-
__param(0, common.Inject(ZohoDeskServiceConfig)),
|
|
4521
|
-
__param(1, common.Inject(exports.ZohoAccountsApi))
|
|
4522
|
-
], exports.ZohoDeskApi);
|
|
4523
|
-
|
|
4524
|
-
function _array_like_to_array(arr, len) {
|
|
4525
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
4526
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4527
|
-
return arr2;
|
|
4528
|
-
}
|
|
4529
|
-
function _array_without_holes(arr) {
|
|
4530
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
4531
|
-
}
|
|
4532
|
-
function _iterable_to_array(iter) {
|
|
4533
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4534
|
-
}
|
|
4535
|
-
function _non_iterable_spread() {
|
|
4536
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4537
|
-
}
|
|
4538
|
-
function _to_consumable_array(arr) {
|
|
4539
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
4540
|
-
}
|
|
4541
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
4542
|
-
if (!o) return;
|
|
4543
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
4544
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4545
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4546
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4547
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
4548
|
-
}
|
|
4549
|
-
/**
|
|
4550
|
-
* Config key suffix for the Zoho Desk organization ID.
|
|
4551
|
-
* Resolves to `ZOHO_DESK_ORG_ID` or `ZOHO_ORG_ID`.
|
|
4552
|
-
*/ var ZOHO_ORG_ID_CONFIG_KEY = 'ORG_ID';
|
|
4553
|
-
// MARK: Provider Factories
|
|
4554
|
-
/**
|
|
4555
|
-
* Reads Zoho Desk connection settings from the NestJS ConfigService
|
|
4556
|
-
* and returns a validated service config.
|
|
4557
|
-
*
|
|
4558
|
-
* Resolves the API URL via environment variables following the naming convention
|
|
4559
|
-
* `ZOHO_DESK_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
4560
|
-
* The organization ID is read from `ZOHO_DESK_ORG_ID` or `ZOHO_ORG_ID`.
|
|
4561
|
-
*
|
|
4562
|
-
* @param configService - NestJS config service populated with Zoho environment variables.
|
|
4563
|
-
* @returns Validated Zoho Desk service configuration.
|
|
4564
|
-
* @throws {Error} If required config values (API URL or orgId) are missing.
|
|
4565
|
-
*/ function zohoDeskServiceConfigFactory(configService) {
|
|
4566
|
-
var getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_DESK_SERVICE_NAME, configService);
|
|
4567
|
-
var config = {
|
|
4568
|
-
zohoDesk: {
|
|
4569
|
-
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY),
|
|
4570
|
-
orgId: getFromConfigService(ZOHO_ORG_ID_CONFIG_KEY)
|
|
4571
|
-
}
|
|
4572
|
-
};
|
|
4573
|
-
ZohoDeskServiceConfig.assertValidConfig(config);
|
|
4574
|
-
return config;
|
|
4575
|
-
}
|
|
4576
|
-
/**
|
|
4577
|
-
* Reads Zoho Accounts (OAuth) settings scoped to the Desk service from
|
|
4578
|
-
* the NestJS ConfigService and returns an accounts service config.
|
|
4579
|
-
*
|
|
4580
|
-
* @param configService - NestJS config service populated with Zoho OAuth environment variables.
|
|
4581
|
-
* @returns Zoho Accounts service config scoped to the Desk service access token.
|
|
4582
|
-
*/ function zohoDeskAccountServiceConfigFactory(configService) {
|
|
4583
|
-
return zohoAccountsServiceConfigFromConfigService({
|
|
4584
|
-
configService: configService,
|
|
4585
|
-
serviceAccessTokenKey: zoho.ZOHO_DESK_SERVICE_NAME
|
|
4586
|
-
});
|
|
4587
|
-
}
|
|
4588
|
-
/**
|
|
4589
|
-
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Desk stack
|
|
4590
|
-
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
4591
|
-
*
|
|
4592
|
-
* The generated module requires the following dependencies in order to initialize properly:
|
|
4593
|
-
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
4594
|
-
*
|
|
4595
|
-
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
4596
|
-
*
|
|
4597
|
-
* The returned metadata registers {@link ZohoDeskServiceConfig}, {@link ZohoDeskApi},
|
|
4598
|
-
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
4599
|
-
* exports {@link ZohoDeskApi} by default. Additional imports, exports, and providers
|
|
4600
|
-
* from the config are merged in.
|
|
4601
|
-
*
|
|
4602
|
-
* @param config - Module configuration with optional dependency module and extra metadata.
|
|
4603
|
-
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
4604
|
-
*/ function appZohoDeskModuleMetadata(config$1) {
|
|
4605
|
-
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
4606
|
-
var dependencyModuleImport = dependencyModule ? [
|
|
4607
|
-
dependencyModule
|
|
4608
|
-
] : [];
|
|
4609
|
-
return {
|
|
4610
|
-
imports: [
|
|
4611
|
-
config.ConfigModule
|
|
4612
|
-
].concat(_to_consumable_array(dependencyModuleImport), _to_consumable_array(imports !== null && imports !== void 0 ? imports : [])),
|
|
4613
|
-
exports: [
|
|
4614
|
-
exports.ZohoDeskApi
|
|
4615
|
-
].concat(_to_consumable_array(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
4616
|
-
providers: [
|
|
4617
|
-
{
|
|
4618
|
-
provide: ZohoDeskServiceConfig,
|
|
4619
|
-
inject: [
|
|
4620
|
-
config.ConfigService
|
|
4621
|
-
],
|
|
4622
|
-
useFactory: zohoDeskServiceConfigFactory
|
|
4623
|
-
},
|
|
4624
|
-
exports.ZohoDeskApi,
|
|
4625
|
-
// Accounts
|
|
4626
|
-
{
|
|
4627
|
-
provide: ZohoAccountsServiceConfig,
|
|
4628
|
-
inject: [
|
|
4629
|
-
config.ConfigService
|
|
4630
|
-
],
|
|
4631
|
-
useFactory: zohoDeskAccountServiceConfigFactory
|
|
4632
|
-
},
|
|
4633
|
-
exports.ZohoAccountsApi
|
|
4634
|
-
].concat(_to_consumable_array(providers !== null && providers !== void 0 ? providers : []))
|
|
4635
|
-
};
|
|
4636
|
-
}
|
|
4637
|
-
|
|
4638
|
-
exports.DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH;
|
|
4639
|
-
exports.ZOHO_ACCOUNTS_CLIENT_ID_CONFIG_KEY = ZOHO_ACCOUNTS_CLIENT_ID_CONFIG_KEY;
|
|
4640
|
-
exports.ZOHO_ACCOUNTS_CLIENT_SECRET_CONFIG_KEY = ZOHO_ACCOUNTS_CLIENT_SECRET_CONFIG_KEY;
|
|
4641
|
-
exports.ZOHO_ACCOUNTS_URL_CONFIG_KEY = ZOHO_ACCOUNTS_URL_CONFIG_KEY;
|
|
4642
|
-
exports.ZOHO_API_URL_CONFIG_KEY = ZOHO_API_URL_CONFIG_KEY;
|
|
4643
|
-
exports.ZOHO_ORG_ID_CONFIG_KEY = ZOHO_ORG_ID_CONFIG_KEY;
|
|
4644
|
-
exports.ZOHO_SIGN_WEBHOOK_SECRET_TOKEN_ENV_VAR = ZOHO_SIGN_WEBHOOK_SECRET_TOKEN_ENV_VAR;
|
|
4645
|
-
exports.ZOHO_SIGN_WEBHOOK_SIGNATURE_HEADER = ZOHO_SIGN_WEBHOOK_SIGNATURE_HEADER;
|
|
4646
|
-
exports.ZohoAccountsOAuthServiceConfig = ZohoAccountsOAuthServiceConfig;
|
|
4647
|
-
exports.ZohoAccountsServiceConfig = ZohoAccountsServiceConfig;
|
|
4648
|
-
exports.ZohoCrmServiceConfig = ZohoCrmServiceConfig;
|
|
4649
|
-
exports.ZohoDeskServiceConfig = ZohoDeskServiceConfig;
|
|
4650
|
-
exports.ZohoRecruitServiceConfig = ZohoRecruitServiceConfig;
|
|
4651
|
-
exports.ZohoSignServiceConfig = ZohoSignServiceConfig;
|
|
4652
|
-
exports.ZohoSignWebhookServiceConfig = ZohoSignWebhookServiceConfig;
|
|
4653
|
-
exports.appZohoAccountsOAuthModuleMetadata = appZohoAccountsOAuthModuleMetadata;
|
|
4654
|
-
exports.appZohoCrmModuleMetadata = appZohoCrmModuleMetadata;
|
|
4655
|
-
exports.appZohoDeskModuleMetadata = appZohoDeskModuleMetadata;
|
|
4656
|
-
exports.appZohoRecruitModuleMetadata = appZohoRecruitModuleMetadata;
|
|
4657
|
-
exports.appZohoSignModuleMetadata = appZohoSignModuleMetadata;
|
|
4658
|
-
exports.assertValidZohoConfig = assertValidZohoConfig;
|
|
4659
|
-
exports.fileZohoAccountsAccessTokenCacheService = fileZohoAccountsAccessTokenCacheService;
|
|
4660
|
-
exports.logMergeZohoAccountsAccessTokenCacheServiceErrorFunction = logMergeZohoAccountsAccessTokenCacheServiceErrorFunction;
|
|
4661
|
-
exports.memoryZohoAccountsAccessTokenCacheService = memoryZohoAccountsAccessTokenCacheService;
|
|
4662
|
-
exports.mergeZohoAccountsAccessTokenCacheServices = mergeZohoAccountsAccessTokenCacheServices;
|
|
4663
|
-
exports.readZohoConfigFromConfigService = readZohoConfigFromConfigService;
|
|
4664
|
-
exports.zohoAccountsOAuthServiceConfigFactory = zohoAccountsOAuthServiceConfigFactory;
|
|
4665
|
-
exports.zohoAccountsServiceConfigFromConfigService = zohoAccountsServiceConfigFromConfigService;
|
|
4666
|
-
exports.zohoConfigServiceReaderFunction = zohoConfigServiceReaderFunction;
|
|
4667
|
-
exports.zohoCrmAccountServiceConfigFactory = zohoCrmAccountServiceConfigFactory;
|
|
4668
|
-
exports.zohoCrmServiceConfigFactory = zohoCrmServiceConfigFactory;
|
|
4669
|
-
exports.zohoDeskAccountServiceConfigFactory = zohoDeskAccountServiceConfigFactory;
|
|
4670
|
-
exports.zohoDeskServiceConfigFactory = zohoDeskServiceConfigFactory;
|
|
4671
|
-
exports.zohoRecruitAccountServiceConfigFactory = zohoRecruitAccountServiceConfigFactory;
|
|
4672
|
-
exports.zohoRecruitServiceConfigFactory = zohoRecruitServiceConfigFactory;
|
|
4673
|
-
exports.zohoSignAccountServiceConfigFactory = zohoSignAccountServiceConfigFactory;
|
|
4674
|
-
exports.zohoSignEventHandlerConfigurerFactory = zohoSignEventHandlerConfigurerFactory;
|
|
4675
|
-
exports.zohoSignEventHandlerFactory = zohoSignEventHandlerFactory;
|
|
4676
|
-
exports.zohoSignServiceConfigFactory = zohoSignServiceConfigFactory;
|
|
4677
|
-
exports.zohoSignWebhookEvent = zohoSignWebhookEvent;
|
|
4678
|
-
exports.zohoSignWebhookEventVerifier = zohoSignWebhookEventVerifier;
|
|
4679
|
-
exports.zohoSignWebhookServiceConfigFactory = zohoSignWebhookServiceConfigFactory;
|