@dereekb/zoho 13.2.2 → 13.3.1
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/index.cjs.js +4226 -1292
- package/index.esm.js +4233 -1299
- package/nestjs/index.cjs.js +1712 -692
- package/nestjs/index.esm.js +1713 -693
- package/nestjs/package.json +6 -6
- package/package.json +5 -5
package/nestjs/index.esm.js
CHANGED
|
@@ -2,61 +2,48 @@ import { Injectable, Inject } from '@nestjs/common';
|
|
|
2
2
|
import { zohoAccountsFactory, zohoAccountsAccessToken, zohoCrmFactory, zohoCrmInsertRecord, zohoCrmUpsertRecord, zohoCrmUpdateRecord, zohoCrmDeleteRecord, zohoCrmGetRecordById, zohoCrmGetRecords, zohoCrmSearchRecords, zohoCrmSearchRecordsPageFactory, zohoCrmGetRelatedRecordsFunctionFactory, zohoCrmGetEmailsForRecord, zohoCrmGetEmailsForRecordPageFactory, zohoCrmGetAttachmentsForRecord, zohoCrmGetAttachmentsForRecordPageFactory, zohoCrmUploadAttachmentForRecord, zohoCrmDownloadAttachmentForRecord, zohoCrmDeleteAttachmentFromRecord, zohoCrmCreateNotes, zohoCrmDeleteNotes, zohoCrmCreateNotesForRecord, zohoCrmGetNotesForRecord, zohoCrmGetNotesForRecordPageFactory, zohoCrmExecuteRestApiFunction, zohoCrmCreateTagsForModule, zohoCrmDeleteTag, zohoCrmGetTagsForModule, zohoCrmAddTagsToRecords, zohoCrmRemoveTagsFromRecords, ZOHO_CRM_SERVICE_NAME, zohoRecruitFactory, zohoRecruitInsertRecord, zohoRecruitUpsertRecord, zohoRecruitUpdateRecord, zohoRecruitDeleteRecord, zohoRecruitGetRecordById, zohoRecruitGetRecords, zohoRecruitSearchRecords, zohoRecruitSearchRecordsPageFactory, zohoRecruitGetRelatedRecordsFunctionFactory, zohoRecruitGetEmailsForRecord, zohoRecruitGetEmailsForRecordPageFactory, zohoRecruitGetAttachmentsForRecord, zohoRecruitGetAttachmentsForRecordPageFactory, zohoRecruitUploadAttachmentForRecord, zohoRecruitDownloadAttachmentForRecord, zohoRecruitDeleteAttachmentFromRecord, zohoRecruitCreateNotes, zohoRecruitDeleteNotes, zohoRecruitCreateNotesForRecord, zohoRecruitGetNotesForRecord, zohoRecruitGetNotesForRecordPageFactory, zohoRecruitExecuteRestApiFunction, zohoRecruitAssociateCandidateRecordsWithJobOpenings, zohoRecruitSearchCandidateAssociatedJobOpeningRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory, zohoRecruitSearchJobOpeningAssociatedCandidateRecords, zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory, zohoRecruitCreateTagsForModule, zohoRecruitGetTagsForModule, zohoRecruitAddTagsToRecords, zohoRecruitRemoveTagsFromRecords, ZOHO_RECRUIT_SERVICE_NAME, zohoSignFactory, zohoSignGetDocument, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignGetDocumentFormData, zohoSignRetrieveFieldTypes, zohoSignDownloadPdf, zohoSignDownloadCompletionCertificate, zohoSignCreateDocument, zohoSignUpdateDocument, zohoSignSendDocumentForSignature, zohoSignExtendDocument, zohoSignDeleteDocument, ZOHO_SIGN_SERVICE_NAME } from '@dereekb/zoho';
|
|
3
3
|
import { forEachKeyValue, tryWithPromiseFactoriesFunction, isPast, filterMaybeArrayValues } from '@dereekb/util';
|
|
4
4
|
import { dirname } from 'path';
|
|
5
|
-
import {
|
|
5
|
+
import { mkdirSync, readFile, writeFile, rm } from 'fs';
|
|
6
6
|
import { ConfigService, ConfigModule } from '@nestjs/config';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
-
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;
|
|
29
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function __param(paramIndex, decorator) {
|
|
33
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
37
|
-
var e = new Error(message);
|
|
38
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
8
|
+
function _type_of(obj) {
|
|
9
|
+
"@swc/helpers - typeof";
|
|
10
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
11
|
+
}
|
|
12
|
+
function __decorate(decorators, target, key, desc) {
|
|
13
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
+
if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
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;
|
|
16
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
+
}
|
|
18
|
+
function __param(paramIndex, decorator) {
|
|
19
|
+
return function(target, key) {
|
|
20
|
+
decorator(target, key, paramIndex);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
24
|
+
var e = new Error(message);
|
|
25
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
39
26
|
};
|
|
40
27
|
|
|
41
|
-
|
|
28
|
+
var ZOHO_API_URL_CONFIG_KEY = 'API_URL';
|
|
42
29
|
function zohoConfigServiceReaderFunction(inputOrKey, inputConfigService) {
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
var configService;
|
|
31
|
+
var serviceAccessTokenKey;
|
|
45
32
|
if (typeof inputOrKey === 'string') {
|
|
46
33
|
serviceAccessTokenKey = inputOrKey;
|
|
47
34
|
configService = inputConfigService;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
35
|
+
} else {
|
|
50
36
|
configService = inputOrKey.configService;
|
|
51
37
|
serviceAccessTokenKey = inputOrKey.serviceAccessTokenKey;
|
|
52
38
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return (key)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
var baseServicePrefix = 'ZOHO_';
|
|
40
|
+
var servicePrefix = serviceAccessTokenKey.toUpperCase(); // "RECRUIT"
|
|
41
|
+
var servicePrefixString = "".concat(baseServicePrefix).concat(servicePrefix, "_"); // "ZOHO_RECRUIT_"
|
|
42
|
+
return function(key) {
|
|
43
|
+
var _configService_get;
|
|
44
|
+
var baseConfigKey = "".concat(baseServicePrefix).concat(key); // "ZOHO_ACCOUNTS_URL"
|
|
45
|
+
var serviceSpecificConfigKey = "".concat(servicePrefixString).concat(key); // "ZOHO_RECRUIT_ACCOUNTS_URL"
|
|
46
|
+
return (_configService_get = configService.get(serviceSpecificConfigKey)) !== null && _configService_get !== void 0 ? _configService_get : configService.get(baseConfigKey);
|
|
60
47
|
};
|
|
61
48
|
}
|
|
62
49
|
/**
|
|
@@ -64,53 +51,89 @@ function zohoConfigServiceReaderFunction(inputOrKey, inputConfigService) {
|
|
|
64
51
|
*
|
|
65
52
|
* @param configService
|
|
66
53
|
* @param prefix
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
*/ function readZohoConfigFromConfigService(configService, servicePrefix) {
|
|
55
|
+
var assertValid = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
56
|
+
var _configService_get;
|
|
57
|
+
var servicePrefixString = servicePrefix ? "".concat(servicePrefix, "_") : '';
|
|
58
|
+
var apiUrlConfigKey = "".concat(servicePrefixString).concat(ZOHO_API_URL_CONFIG_KEY);
|
|
59
|
+
var config = {
|
|
60
|
+
apiUrl: (_configService_get = configService.get(apiUrlConfigKey)) !== null && _configService_get !== void 0 ? _configService_get : configService.get(ZOHO_API_URL_CONFIG_KEY)
|
|
73
61
|
};
|
|
74
62
|
if (assertValid) {
|
|
75
63
|
if (!config.apiUrl) {
|
|
76
|
-
throw new Error(
|
|
64
|
+
throw new Error('No Zoho API url or type specified for key "'.concat(apiUrlConfigKey, '".'));
|
|
77
65
|
}
|
|
78
66
|
}
|
|
79
67
|
return config;
|
|
80
68
|
}
|
|
81
69
|
function assertValidZohoConfig(config) {
|
|
82
70
|
if (!config.apiUrl) {
|
|
83
|
-
throw new Error(
|
|
71
|
+
throw new Error("No Zoho API url or type specified.");
|
|
84
72
|
}
|
|
85
73
|
}
|
|
86
74
|
|
|
75
|
+
function _class_call_check$8(instance, Constructor) {
|
|
76
|
+
if (!(instance instanceof Constructor)) {
|
|
77
|
+
throw new TypeError("Cannot call a class as a function");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function _defineProperties$7(target, props) {
|
|
81
|
+
for(var i = 0; i < props.length; i++){
|
|
82
|
+
var descriptor = props[i];
|
|
83
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
84
|
+
descriptor.configurable = true;
|
|
85
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
86
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function _create_class$7(Constructor, protoProps, staticProps) {
|
|
90
|
+
if (staticProps) _defineProperties$7(Constructor, staticProps);
|
|
91
|
+
return Constructor;
|
|
92
|
+
}
|
|
93
|
+
function _define_property$8(obj, key, value) {
|
|
94
|
+
if (key in obj) {
|
|
95
|
+
Object.defineProperty(obj, key, {
|
|
96
|
+
value: value,
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true,
|
|
99
|
+
writable: true
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
obj[key] = value;
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
87
106
|
/**
|
|
88
107
|
* Configuration for ZohoService
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
*/ var ZohoAccountsServiceConfig = /*#__PURE__*/ function() {
|
|
109
|
+
function ZohoAccountsServiceConfig() {
|
|
110
|
+
_class_call_check$8(this, ZohoAccountsServiceConfig);
|
|
111
|
+
_define_property$8(this, "zohoAccounts", void 0);
|
|
112
|
+
_define_property$8(this, "factoryConfig", void 0);
|
|
113
|
+
}
|
|
114
|
+
_create_class$7(ZohoAccountsServiceConfig, null, [
|
|
115
|
+
{
|
|
116
|
+
key: "assertValidConfig",
|
|
117
|
+
value: function assertValidConfig(config) {
|
|
118
|
+
var zohoAccounts = config.zohoAccounts;
|
|
119
|
+
if (!zohoAccounts) {
|
|
120
|
+
throw new Error('ZohoAccountsServiceConfig.zohoAccounts is required');
|
|
121
|
+
} else {
|
|
122
|
+
if (!zohoAccounts.serviceAccessTokenKey) {
|
|
123
|
+
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.serviceAccessTokenKey is required');
|
|
124
|
+
} else if (!zohoAccounts.refreshToken) {
|
|
125
|
+
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.refreshToken is required');
|
|
126
|
+
} else if (!zohoAccounts.apiUrl) {
|
|
127
|
+
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.apiUrl is required');
|
|
128
|
+
} else if (!zohoAccounts.clientId) {
|
|
129
|
+
throw new Error('ZohoAccountsServiceConfig.zohoAccounts.clientId is required');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
110
132
|
}
|
|
111
133
|
}
|
|
112
|
-
|
|
113
|
-
|
|
134
|
+
]);
|
|
135
|
+
return ZohoAccountsServiceConfig;
|
|
136
|
+
}();
|
|
114
137
|
/**
|
|
115
138
|
* Builds a {@link ZohoAccountsServiceConfig} by reading Zoho Accounts OAuth credentials
|
|
116
139
|
* from a NestJS `ConfigService` (typically backed by environment variables).
|
|
@@ -135,36 +158,255 @@ class ZohoAccountsServiceConfig {
|
|
|
135
158
|
* `ConfigService` and the `serviceAccessTokenKey` for the target Zoho service.
|
|
136
159
|
* @returns A validated {@link ZohoAccountsServiceConfig} ready for use with `ZohoAccountsApi`.
|
|
137
160
|
* @throws If any required credential (apiUrl, refreshToken, clientId) is missing.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
clientId: getFromConfigService('ACCOUNTS_CLIENT_ID'), // ZOHO_<SERVICE>_ACCOUNTS_CLIENT_ID, ZOHO_ACCOUNTS_CLIENT_ID
|
|
161
|
+
*/ function zohoAccountsServiceConfigFromConfigService(input) {
|
|
162
|
+
var serviceAccessTokenKey = input.serviceAccessTokenKey;
|
|
163
|
+
var getFromConfigService = zohoConfigServiceReaderFunction(input);
|
|
164
|
+
var zohoAccounts = {
|
|
165
|
+
serviceAccessTokenKey: serviceAccessTokenKey,
|
|
166
|
+
apiUrl: getFromConfigService('ACCOUNTS_URL'),
|
|
167
|
+
refreshToken: getFromConfigService('ACCOUNTS_REFRESH_TOKEN'),
|
|
168
|
+
clientId: getFromConfigService('ACCOUNTS_CLIENT_ID'),
|
|
147
169
|
clientSecret: getFromConfigService('ACCOUNTS_CLIENT_SECRET') // ZOHO_<SERVICE>_ACCOUNTS_CLIENT_SECRET, ZOHO_ACCOUNTS_CLIENT_SECRET
|
|
148
170
|
};
|
|
149
|
-
|
|
150
|
-
zohoAccounts
|
|
171
|
+
var config = {
|
|
172
|
+
zohoAccounts: zohoAccounts
|
|
151
173
|
};
|
|
152
174
|
ZohoAccountsServiceConfig.assertValidConfig(config);
|
|
153
175
|
return config;
|
|
154
176
|
}
|
|
155
177
|
|
|
178
|
+
function _array_like_to_array$3(arr, len) {
|
|
179
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
180
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
181
|
+
return arr2;
|
|
182
|
+
}
|
|
183
|
+
function _array_with_holes(arr) {
|
|
184
|
+
if (Array.isArray(arr)) return arr;
|
|
185
|
+
}
|
|
186
|
+
function _array_without_holes$3(arr) {
|
|
187
|
+
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
188
|
+
}
|
|
189
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
190
|
+
try {
|
|
191
|
+
var info = gen[key](arg);
|
|
192
|
+
var value = info.value;
|
|
193
|
+
} catch (error) {
|
|
194
|
+
reject(error);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (info.done) {
|
|
198
|
+
resolve(value);
|
|
199
|
+
} else {
|
|
200
|
+
Promise.resolve(value).then(_next, _throw);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function _async_to_generator(fn) {
|
|
204
|
+
return function() {
|
|
205
|
+
var self = this, args = arguments;
|
|
206
|
+
return new Promise(function(resolve, reject) {
|
|
207
|
+
var gen = fn.apply(self, args);
|
|
208
|
+
function _next(value) {
|
|
209
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
210
|
+
}
|
|
211
|
+
function _throw(err) {
|
|
212
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
213
|
+
}
|
|
214
|
+
_next(undefined);
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function _class_call_check$7(instance, Constructor) {
|
|
219
|
+
if (!(instance instanceof Constructor)) {
|
|
220
|
+
throw new TypeError("Cannot call a class as a function");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function _define_property$7(obj, key, value) {
|
|
224
|
+
if (key in obj) {
|
|
225
|
+
Object.defineProperty(obj, key, {
|
|
226
|
+
value: value,
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true,
|
|
229
|
+
writable: true
|
|
230
|
+
});
|
|
231
|
+
} else {
|
|
232
|
+
obj[key] = value;
|
|
233
|
+
}
|
|
234
|
+
return obj;
|
|
235
|
+
}
|
|
236
|
+
function _iterable_to_array$3(iter) {
|
|
237
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
238
|
+
}
|
|
239
|
+
function _iterable_to_array_limit(arr, i) {
|
|
240
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
241
|
+
if (_i == null) return;
|
|
242
|
+
var _arr = [];
|
|
243
|
+
var _n = true;
|
|
244
|
+
var _d = false;
|
|
245
|
+
var _s, _e;
|
|
246
|
+
try {
|
|
247
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
248
|
+
_arr.push(_s.value);
|
|
249
|
+
if (i && _arr.length === i) break;
|
|
250
|
+
}
|
|
251
|
+
} catch (err) {
|
|
252
|
+
_d = true;
|
|
253
|
+
_e = err;
|
|
254
|
+
} finally{
|
|
255
|
+
try {
|
|
256
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
257
|
+
} finally{
|
|
258
|
+
if (_d) throw _e;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return _arr;
|
|
262
|
+
}
|
|
263
|
+
function _non_iterable_rest() {
|
|
264
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
265
|
+
}
|
|
266
|
+
function _non_iterable_spread$3() {
|
|
267
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
268
|
+
}
|
|
269
|
+
function _object_spread$4(target) {
|
|
270
|
+
for(var i = 1; i < arguments.length; i++){
|
|
271
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
272
|
+
var ownKeys = Object.keys(source);
|
|
273
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
274
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
275
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
276
|
+
}));
|
|
277
|
+
}
|
|
278
|
+
ownKeys.forEach(function(key) {
|
|
279
|
+
_define_property$7(target, key, source[key]);
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return target;
|
|
283
|
+
}
|
|
284
|
+
function _sliced_to_array(arr, i) {
|
|
285
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest();
|
|
286
|
+
}
|
|
287
|
+
function _to_consumable_array$3(arr) {
|
|
288
|
+
return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$3();
|
|
289
|
+
}
|
|
290
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
291
|
+
if (!o) return;
|
|
292
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
293
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
294
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
295
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
296
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
297
|
+
}
|
|
298
|
+
function _ts_generator(thisArg, body) {
|
|
299
|
+
var f, y, t, _ = {
|
|
300
|
+
label: 0,
|
|
301
|
+
sent: function() {
|
|
302
|
+
if (t[0] & 1) throw t[1];
|
|
303
|
+
return t[1];
|
|
304
|
+
},
|
|
305
|
+
trys: [],
|
|
306
|
+
ops: []
|
|
307
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
308
|
+
return d(g, "next", {
|
|
309
|
+
value: verb(0)
|
|
310
|
+
}), d(g, "throw", {
|
|
311
|
+
value: verb(1)
|
|
312
|
+
}), d(g, "return", {
|
|
313
|
+
value: verb(2)
|
|
314
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
315
|
+
value: function() {
|
|
316
|
+
return this;
|
|
317
|
+
}
|
|
318
|
+
}), g;
|
|
319
|
+
function verb(n) {
|
|
320
|
+
return function(v) {
|
|
321
|
+
return step([
|
|
322
|
+
n,
|
|
323
|
+
v
|
|
324
|
+
]);
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function step(op) {
|
|
328
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
329
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
330
|
+
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;
|
|
331
|
+
if (y = 0, t) op = [
|
|
332
|
+
op[0] & 2,
|
|
333
|
+
t.value
|
|
334
|
+
];
|
|
335
|
+
switch(op[0]){
|
|
336
|
+
case 0:
|
|
337
|
+
case 1:
|
|
338
|
+
t = op;
|
|
339
|
+
break;
|
|
340
|
+
case 4:
|
|
341
|
+
_.label++;
|
|
342
|
+
return {
|
|
343
|
+
value: op[1],
|
|
344
|
+
done: false
|
|
345
|
+
};
|
|
346
|
+
case 5:
|
|
347
|
+
_.label++;
|
|
348
|
+
y = op[1];
|
|
349
|
+
op = [
|
|
350
|
+
0
|
|
351
|
+
];
|
|
352
|
+
continue;
|
|
353
|
+
case 7:
|
|
354
|
+
op = _.ops.pop();
|
|
355
|
+
_.trys.pop();
|
|
356
|
+
continue;
|
|
357
|
+
default:
|
|
358
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
359
|
+
_ = 0;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
363
|
+
_.label = op[1];
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
367
|
+
_.label = t[1];
|
|
368
|
+
t = op;
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
if (t && _.label < t[2]) {
|
|
372
|
+
_.label = t[2];
|
|
373
|
+
_.ops.push(op);
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
if (t[2]) _.ops.pop();
|
|
377
|
+
_.trys.pop();
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
op = body.call(thisArg, _);
|
|
381
|
+
} catch (e) {
|
|
382
|
+
op = [
|
|
383
|
+
6,
|
|
384
|
+
e
|
|
385
|
+
];
|
|
386
|
+
y = 0;
|
|
387
|
+
} finally{
|
|
388
|
+
f = t = 0;
|
|
389
|
+
}
|
|
390
|
+
if (op[0] & 5) throw op[1];
|
|
391
|
+
return {
|
|
392
|
+
value: op[0] ? op[1] : void 0,
|
|
393
|
+
done: true
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
}
|
|
156
397
|
/**
|
|
157
398
|
* Service used for retrieving ZohoAccessTokenCache for Zoho services.
|
|
158
|
-
*/
|
|
159
|
-
|
|
399
|
+
*/ var ZohoAccountsAccessTokenCacheService = function ZohoAccountsAccessTokenCacheService() {
|
|
400
|
+
_class_call_check$7(this, ZohoAccountsAccessTokenCacheService);
|
|
160
401
|
};
|
|
161
402
|
ZohoAccountsAccessTokenCacheService = __decorate([
|
|
162
403
|
Injectable()
|
|
163
404
|
], ZohoAccountsAccessTokenCacheService);
|
|
164
405
|
function logMergeZohoAccountsAccessTokenCacheServiceErrorFunction(failedUpdates) {
|
|
165
|
-
console.warn(
|
|
166
|
-
failedUpdates.forEach((
|
|
167
|
-
|
|
406
|
+
console.warn("mergeZohoAccountsAccessTokenCacheServices(): failed updating ".concat(failedUpdates.length, " caches."));
|
|
407
|
+
failedUpdates.forEach(function(param, i) {
|
|
408
|
+
var _param = _sliced_to_array(param, 2); _param[0]; var e = _param[1];
|
|
409
|
+
console.warn("Cache update failure ".concat(i + 1, ": - ").concat(e));
|
|
168
410
|
});
|
|
169
411
|
}
|
|
170
412
|
/**
|
|
@@ -175,52 +417,86 @@ function logMergeZohoAccountsAccessTokenCacheServiceErrorFunction(failedUpdates)
|
|
|
175
417
|
* When updating a cached token, it will update the token across all services.
|
|
176
418
|
*
|
|
177
419
|
* @param servicesToMerge Must include atleast one service. Empty arrays will throw an error.
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const logErrorFunction = typeof logError === 'function' ? logError : logError !== false ? logMergeZohoAccountsAccessTokenCacheServiceErrorFunction : undefined;
|
|
420
|
+
*/ function mergeZohoAccountsAccessTokenCacheServices(inputServicesToMerge, logError) {
|
|
421
|
+
var services = _to_consumable_array$3(inputServicesToMerge);
|
|
422
|
+
var logErrorFunction = typeof logError === 'function' ? logError : logError !== false ? logMergeZohoAccountsAccessTokenCacheServiceErrorFunction : undefined;
|
|
182
423
|
if (services.length === 0) {
|
|
183
424
|
throw new Error('mergeZohoAccountsAccessTokenCacheServices() input cannot be empty.');
|
|
184
425
|
}
|
|
185
|
-
|
|
186
|
-
loadZohoAccessTokenCache: function (service) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
426
|
+
var service = {
|
|
427
|
+
loadZohoAccessTokenCache: function loadZohoAccessTokenCache(service) {
|
|
428
|
+
var accessCachesForServices = services.map(function(x) {
|
|
429
|
+
return x.loadZohoAccessTokenCache(service);
|
|
430
|
+
});
|
|
431
|
+
var loadCachedTokenFromFirstService = tryWithPromiseFactoriesFunction({
|
|
432
|
+
promiseFactories: accessCachesForServices.map(function(x) {
|
|
433
|
+
return function() {
|
|
434
|
+
return x.loadCachedToken().catch(function() {
|
|
435
|
+
return null;
|
|
436
|
+
}).then(function(x) {
|
|
437
|
+
var result = undefined;
|
|
438
|
+
if (x && !isPast(x.expiresAt)) {
|
|
439
|
+
result = x; // only return from cache if it is not expired
|
|
440
|
+
}
|
|
441
|
+
return result;
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
}),
|
|
199
445
|
successOnMaybe: false,
|
|
200
446
|
throwErrors: false
|
|
201
447
|
});
|
|
202
|
-
|
|
203
|
-
loadCachedToken: function () {
|
|
448
|
+
var cacheForService = {
|
|
449
|
+
loadCachedToken: function loadCachedToken() {
|
|
204
450
|
return loadCachedTokenFromFirstService();
|
|
205
451
|
},
|
|
206
|
-
updateCachedToken:
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
452
|
+
updateCachedToken: function updateCachedToken(accessToken) {
|
|
453
|
+
return _async_to_generator(function() {
|
|
454
|
+
return _ts_generator(this, function(_state) {
|
|
455
|
+
return [
|
|
456
|
+
2,
|
|
457
|
+
Promise.allSettled(accessCachesForServices.map(function(x) {
|
|
458
|
+
return x.updateCachedToken(accessToken).then(function() {
|
|
459
|
+
return null;
|
|
460
|
+
}).catch(function(e) {
|
|
461
|
+
return [
|
|
462
|
+
x,
|
|
463
|
+
e
|
|
464
|
+
];
|
|
465
|
+
});
|
|
466
|
+
})).then(function(x) {
|
|
467
|
+
// only find the failures if we're logging
|
|
468
|
+
if (logErrorFunction != null) {
|
|
469
|
+
var failedUpdates = filterMaybeArrayValues(x.map(function(y) {
|
|
470
|
+
return y.value;
|
|
471
|
+
}));
|
|
472
|
+
if (failedUpdates.length) {
|
|
473
|
+
logErrorFunction(failedUpdates);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
];
|
|
478
|
+
});
|
|
479
|
+
})();
|
|
221
480
|
},
|
|
222
|
-
clearCachedToken:
|
|
223
|
-
|
|
481
|
+
clearCachedToken: function clearCachedToken() {
|
|
482
|
+
return _async_to_generator(function() {
|
|
483
|
+
return _ts_generator(this, function(_state) {
|
|
484
|
+
switch(_state.label){
|
|
485
|
+
case 0:
|
|
486
|
+
return [
|
|
487
|
+
4,
|
|
488
|
+
Promise.allSettled(accessCachesForServices.map(function(x) {
|
|
489
|
+
return x.clearCachedToken();
|
|
490
|
+
}))
|
|
491
|
+
];
|
|
492
|
+
case 1:
|
|
493
|
+
_state.sent();
|
|
494
|
+
return [
|
|
495
|
+
2
|
|
496
|
+
];
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
})();
|
|
224
500
|
}
|
|
225
501
|
};
|
|
226
502
|
return cacheForService;
|
|
@@ -233,356 +509,737 @@ function mergeZohoAccountsAccessTokenCacheServices(inputServicesToMerge, logErro
|
|
|
233
509
|
* Creates a ZohoAccountsAccessTokenCacheService that uses in-memory storage.
|
|
234
510
|
*
|
|
235
511
|
* @returns
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
const tokens = existingCache ?? {};
|
|
512
|
+
*/ function memoryZohoAccountsAccessTokenCacheService(existingCache, logAccessToConsole) {
|
|
513
|
+
var tokens = existingCache !== null && existingCache !== void 0 ? existingCache : {};
|
|
239
514
|
function loadZohoAccessTokenCache(service) {
|
|
240
|
-
|
|
241
|
-
loadCachedToken:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
515
|
+
var accessTokenCache = {
|
|
516
|
+
loadCachedToken: function loadCachedToken() {
|
|
517
|
+
return _async_to_generator(function() {
|
|
518
|
+
var token;
|
|
519
|
+
return _ts_generator(this, function(_state) {
|
|
520
|
+
token = tokens[service];
|
|
521
|
+
if (logAccessToConsole) {
|
|
522
|
+
console.log('retrieving access token from memory: ', {
|
|
523
|
+
token: token,
|
|
524
|
+
service: service
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
return [
|
|
528
|
+
2,
|
|
529
|
+
token
|
|
530
|
+
];
|
|
531
|
+
});
|
|
532
|
+
})();
|
|
247
533
|
},
|
|
248
|
-
updateCachedToken:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
534
|
+
updateCachedToken: function updateCachedToken(accessToken) {
|
|
535
|
+
return _async_to_generator(function() {
|
|
536
|
+
return _ts_generator(this, function(_state) {
|
|
537
|
+
tokens[service] = accessToken;
|
|
538
|
+
if (logAccessToConsole) {
|
|
539
|
+
console.log('updating access token in memory: ', {
|
|
540
|
+
accessToken: accessToken,
|
|
541
|
+
service: service
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
return [
|
|
545
|
+
2
|
|
546
|
+
];
|
|
547
|
+
});
|
|
548
|
+
})();
|
|
253
549
|
},
|
|
254
|
-
clearCachedToken:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
550
|
+
clearCachedToken: function clearCachedToken() {
|
|
551
|
+
return _async_to_generator(function() {
|
|
552
|
+
return _ts_generator(this, function(_state) {
|
|
553
|
+
delete tokens[service];
|
|
554
|
+
if (logAccessToConsole) {
|
|
555
|
+
console.log('clearing access token in memory: ', {
|
|
556
|
+
service: service
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
return [
|
|
560
|
+
2
|
|
561
|
+
];
|
|
562
|
+
});
|
|
563
|
+
})();
|
|
259
564
|
}
|
|
260
565
|
};
|
|
261
566
|
return accessTokenCache;
|
|
262
567
|
}
|
|
263
568
|
return {
|
|
264
|
-
loadZohoAccessTokenCache
|
|
569
|
+
loadZohoAccessTokenCache: loadZohoAccessTokenCache
|
|
265
570
|
};
|
|
266
571
|
}
|
|
267
572
|
// MARK: File System Access Token Cache
|
|
268
|
-
|
|
573
|
+
var DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = '.tmp/zoho-access-tokens.json';
|
|
269
574
|
/**
|
|
270
575
|
* Creates a ZohoAccountsAccessTokenCacheService that reads and writes the access token to the file system.
|
|
271
576
|
*
|
|
272
577
|
* Useful for testing.
|
|
273
578
|
*
|
|
274
579
|
* @returns
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
580
|
+
*/ function fileZohoAccountsAccessTokenCacheService() {
|
|
581
|
+
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;
|
|
582
|
+
var loadedTokens = null;
|
|
583
|
+
function loadTokens() {
|
|
584
|
+
return _async_to_generator(function() {
|
|
585
|
+
var _ref;
|
|
586
|
+
return _ts_generator(this, function(_state) {
|
|
587
|
+
switch(_state.label){
|
|
588
|
+
case 0:
|
|
589
|
+
if (!!loadedTokens) return [
|
|
590
|
+
3,
|
|
591
|
+
2
|
|
592
|
+
];
|
|
593
|
+
return [
|
|
594
|
+
4,
|
|
595
|
+
readTokenFile()
|
|
596
|
+
];
|
|
597
|
+
case 1:
|
|
598
|
+
return [
|
|
599
|
+
2,
|
|
600
|
+
(_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : {}
|
|
601
|
+
];
|
|
602
|
+
case 2:
|
|
603
|
+
return [
|
|
604
|
+
2,
|
|
605
|
+
loadedTokens
|
|
606
|
+
];
|
|
607
|
+
case 3:
|
|
608
|
+
return [
|
|
609
|
+
2
|
|
610
|
+
];
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
})();
|
|
285
614
|
}
|
|
286
615
|
function readTokenFile() {
|
|
287
|
-
return new Promise((resolve)
|
|
288
|
-
mkdirSync(dirname(filename), {
|
|
289
|
-
|
|
290
|
-
|
|
616
|
+
return new Promise(function(resolve) {
|
|
617
|
+
mkdirSync(dirname(filename), {
|
|
618
|
+
recursive: true
|
|
619
|
+
}); // make the directory first
|
|
620
|
+
readFile(filename, {}, function(x, data) {
|
|
621
|
+
var result = undefined;
|
|
291
622
|
if (!x) {
|
|
292
623
|
try {
|
|
293
624
|
result = JSON.parse(data.toString());
|
|
294
625
|
forEachKeyValue(result, {
|
|
295
|
-
forEach: (x)
|
|
626
|
+
forEach: function forEach(x) {
|
|
296
627
|
if (x[1]) {
|
|
297
628
|
x[1].expiresAt = new Date(x[1].expiresAt);
|
|
298
629
|
}
|
|
299
630
|
}
|
|
300
631
|
});
|
|
301
|
-
}
|
|
302
|
-
catch (e) {
|
|
632
|
+
} catch (e) {
|
|
303
633
|
console.error('Failed reading token file: ', e);
|
|
304
634
|
}
|
|
305
635
|
}
|
|
306
636
|
resolve(result);
|
|
307
637
|
});
|
|
308
|
-
}).then((x)
|
|
638
|
+
}).then(function(x) {
|
|
309
639
|
// update loaded tokens
|
|
310
640
|
if (useMemoryCache) {
|
|
311
|
-
loadedTokens = {
|
|
312
|
-
...loadedTokens,
|
|
313
|
-
...x
|
|
314
|
-
};
|
|
641
|
+
loadedTokens = _object_spread$4({}, loadedTokens, x);
|
|
315
642
|
}
|
|
316
643
|
return x;
|
|
317
644
|
});
|
|
318
645
|
}
|
|
319
|
-
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
646
|
+
function writeTokenFile(tokens) {
|
|
647
|
+
return _async_to_generator(function() {
|
|
648
|
+
return _ts_generator(this, function(_state) {
|
|
649
|
+
return [
|
|
650
|
+
2,
|
|
651
|
+
new Promise(function(resolve, reject) {
|
|
652
|
+
writeFile(filename, JSON.stringify(tokens), {}, function(x) {
|
|
653
|
+
if (!x) {
|
|
654
|
+
resolve();
|
|
655
|
+
} else {
|
|
656
|
+
reject(x);
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
})
|
|
660
|
+
];
|
|
328
661
|
});
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
662
|
+
})();
|
|
663
|
+
}
|
|
664
|
+
function deleteTokenFile() {
|
|
665
|
+
return _async_to_generator(function() {
|
|
666
|
+
return _ts_generator(this, function(_state) {
|
|
667
|
+
return [
|
|
668
|
+
2,
|
|
669
|
+
new Promise(function(resolve, reject) {
|
|
670
|
+
rm(filename, function(x) {
|
|
671
|
+
if (!x) {
|
|
672
|
+
resolve();
|
|
673
|
+
} else {
|
|
674
|
+
reject(x);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
})
|
|
678
|
+
];
|
|
340
679
|
});
|
|
341
|
-
});
|
|
680
|
+
})();
|
|
342
681
|
}
|
|
343
682
|
function loadZohoAccessTokenCache(service) {
|
|
344
|
-
|
|
345
|
-
loadCachedToken:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
683
|
+
var accessTokenCache = {
|
|
684
|
+
loadCachedToken: function loadCachedToken() {
|
|
685
|
+
return _async_to_generator(function() {
|
|
686
|
+
var tokens, token;
|
|
687
|
+
return _ts_generator(this, function(_state) {
|
|
688
|
+
switch(_state.label){
|
|
689
|
+
case 0:
|
|
690
|
+
return [
|
|
691
|
+
4,
|
|
692
|
+
loadTokens()
|
|
693
|
+
];
|
|
694
|
+
case 1:
|
|
695
|
+
tokens = _state.sent();
|
|
696
|
+
token = tokens[service];
|
|
697
|
+
// console.log('retrieving access token from file: ', { token, service });
|
|
698
|
+
return [
|
|
699
|
+
2,
|
|
700
|
+
token
|
|
701
|
+
];
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
})();
|
|
350
705
|
},
|
|
351
|
-
updateCachedToken:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
706
|
+
updateCachedToken: function updateCachedToken(accessToken) {
|
|
707
|
+
return _async_to_generator(function() {
|
|
708
|
+
var tokens, e;
|
|
709
|
+
return _ts_generator(this, function(_state) {
|
|
710
|
+
switch(_state.label){
|
|
711
|
+
case 0:
|
|
712
|
+
return [
|
|
713
|
+
4,
|
|
714
|
+
loadTokens()
|
|
715
|
+
];
|
|
716
|
+
case 1:
|
|
717
|
+
tokens = _state.sent();
|
|
718
|
+
if (tokens) {
|
|
719
|
+
tokens[service] = accessToken;
|
|
720
|
+
}
|
|
721
|
+
_state.label = 2;
|
|
722
|
+
case 2:
|
|
723
|
+
_state.trys.push([
|
|
724
|
+
2,
|
|
725
|
+
4,
|
|
726
|
+
,
|
|
727
|
+
5
|
|
728
|
+
]);
|
|
729
|
+
return [
|
|
730
|
+
4,
|
|
731
|
+
writeTokenFile(tokens)
|
|
732
|
+
];
|
|
733
|
+
case 3:
|
|
734
|
+
_state.sent();
|
|
735
|
+
return [
|
|
736
|
+
3,
|
|
737
|
+
5
|
|
738
|
+
];
|
|
739
|
+
case 4:
|
|
740
|
+
e = _state.sent();
|
|
741
|
+
console.error('Failed updating access token in file: ', e);
|
|
742
|
+
return [
|
|
743
|
+
3,
|
|
744
|
+
5
|
|
745
|
+
];
|
|
746
|
+
case 5:
|
|
747
|
+
return [
|
|
748
|
+
2
|
|
749
|
+
];
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
})();
|
|
363
753
|
},
|
|
364
|
-
clearCachedToken:
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
754
|
+
clearCachedToken: function clearCachedToken() {
|
|
755
|
+
return _async_to_generator(function() {
|
|
756
|
+
var e;
|
|
757
|
+
return _ts_generator(this, function(_state) {
|
|
758
|
+
switch(_state.label){
|
|
759
|
+
case 0:
|
|
760
|
+
_state.trys.push([
|
|
761
|
+
0,
|
|
762
|
+
2,
|
|
763
|
+
,
|
|
764
|
+
3
|
|
765
|
+
]);
|
|
766
|
+
return [
|
|
767
|
+
4,
|
|
768
|
+
writeTokenFile({})
|
|
769
|
+
];
|
|
770
|
+
case 1:
|
|
771
|
+
_state.sent();
|
|
772
|
+
return [
|
|
773
|
+
3,
|
|
774
|
+
3
|
|
775
|
+
];
|
|
776
|
+
case 2:
|
|
777
|
+
e = _state.sent();
|
|
778
|
+
console.error('Failed clearing access token in file: ', e);
|
|
779
|
+
return [
|
|
780
|
+
3,
|
|
781
|
+
3
|
|
782
|
+
];
|
|
783
|
+
case 3:
|
|
784
|
+
return [
|
|
785
|
+
2
|
|
786
|
+
];
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
})();
|
|
371
790
|
}
|
|
372
791
|
};
|
|
373
792
|
return accessTokenCache;
|
|
374
793
|
}
|
|
375
794
|
return {
|
|
376
|
-
loadZohoAccessTokenCache,
|
|
377
|
-
readTokenFile,
|
|
378
|
-
writeTokenFile,
|
|
379
|
-
deleteTokenFile
|
|
795
|
+
loadZohoAccessTokenCache: loadZohoAccessTokenCache,
|
|
796
|
+
readTokenFile: readTokenFile,
|
|
797
|
+
writeTokenFile: writeTokenFile,
|
|
798
|
+
deleteTokenFile: deleteTokenFile
|
|
380
799
|
};
|
|
381
800
|
}
|
|
382
801
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
zohoAccounts;
|
|
387
|
-
get accountsContext() {
|
|
388
|
-
return this.zohoAccounts.accountsContext;
|
|
802
|
+
function _class_call_check$6(instance, Constructor) {
|
|
803
|
+
if (!(instance instanceof Constructor)) {
|
|
804
|
+
throw new TypeError("Cannot call a class as a function");
|
|
389
805
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
806
|
+
}
|
|
807
|
+
function _defineProperties$6(target, props) {
|
|
808
|
+
for(var i = 0; i < props.length; i++){
|
|
809
|
+
var descriptor = props[i];
|
|
810
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
811
|
+
descriptor.configurable = true;
|
|
812
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
813
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function _create_class$6(Constructor, protoProps, staticProps) {
|
|
817
|
+
if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
|
|
818
|
+
return Constructor;
|
|
819
|
+
}
|
|
820
|
+
function _define_property$6(obj, key, value) {
|
|
821
|
+
if (key in obj) {
|
|
822
|
+
Object.defineProperty(obj, key, {
|
|
823
|
+
value: value,
|
|
824
|
+
enumerable: true,
|
|
825
|
+
configurable: true,
|
|
826
|
+
writable: true
|
|
397
827
|
});
|
|
828
|
+
} else {
|
|
829
|
+
obj[key] = value;
|
|
398
830
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
831
|
+
return obj;
|
|
832
|
+
}
|
|
833
|
+
function _object_spread$3(target) {
|
|
834
|
+
for(var i = 1; i < arguments.length; i++){
|
|
835
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
836
|
+
var ownKeys = Object.keys(source);
|
|
837
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
838
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
839
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
840
|
+
}));
|
|
841
|
+
}
|
|
842
|
+
ownKeys.forEach(function(key) {
|
|
843
|
+
_define_property$6(target, key, source[key]);
|
|
844
|
+
});
|
|
402
845
|
}
|
|
403
|
-
|
|
846
|
+
return target;
|
|
847
|
+
}
|
|
848
|
+
var ZohoAccountsApi = /*#__PURE__*/ function() {
|
|
849
|
+
function ZohoAccountsApi(config, cacheService) {
|
|
850
|
+
_class_call_check$6(this, ZohoAccountsApi);
|
|
851
|
+
var _config_factoryConfig;
|
|
852
|
+
_define_property$6(this, "config", void 0);
|
|
853
|
+
_define_property$6(this, "cacheService", void 0);
|
|
854
|
+
_define_property$6(this, "zohoAccounts", void 0);
|
|
855
|
+
this.config = config;
|
|
856
|
+
this.cacheService = cacheService;
|
|
857
|
+
var accessTokenCache = config.zohoAccounts.accessTokenCache ? config.zohoAccounts.accessTokenCache : cacheService.loadZohoAccessTokenCache(config.zohoAccounts.serviceAccessTokenKey);
|
|
858
|
+
this.zohoAccounts = zohoAccountsFactory((_config_factoryConfig = config.factoryConfig) !== null && _config_factoryConfig !== void 0 ? _config_factoryConfig : {})(_object_spread$3({
|
|
859
|
+
accessTokenCache: accessTokenCache
|
|
860
|
+
}, config.zohoAccounts));
|
|
861
|
+
}
|
|
862
|
+
_create_class$6(ZohoAccountsApi, [
|
|
863
|
+
{
|
|
864
|
+
key: "accountsContext",
|
|
865
|
+
get: function get() {
|
|
866
|
+
return this.zohoAccounts.accountsContext;
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
key: "accessToken",
|
|
871
|
+
get: // MARK: Accessors
|
|
872
|
+
function get() {
|
|
873
|
+
return zohoAccountsAccessToken(this.accountsContext);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
]);
|
|
877
|
+
return ZohoAccountsApi;
|
|
878
|
+
}();
|
|
404
879
|
ZohoAccountsApi = __decorate([
|
|
405
880
|
Injectable(),
|
|
406
881
|
__param(0, Inject(ZohoAccountsServiceConfig)),
|
|
407
882
|
__param(1, Inject(ZohoAccountsAccessTokenCacheService))
|
|
408
883
|
], ZohoAccountsApi);
|
|
409
884
|
|
|
885
|
+
function _class_call_check$5(instance, Constructor) {
|
|
886
|
+
if (!(instance instanceof Constructor)) {
|
|
887
|
+
throw new TypeError("Cannot call a class as a function");
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
function _defineProperties$5(target, props) {
|
|
891
|
+
for(var i = 0; i < props.length; i++){
|
|
892
|
+
var descriptor = props[i];
|
|
893
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
894
|
+
descriptor.configurable = true;
|
|
895
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
896
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
function _create_class$5(Constructor, protoProps, staticProps) {
|
|
900
|
+
if (staticProps) _defineProperties$5(Constructor, staticProps);
|
|
901
|
+
return Constructor;
|
|
902
|
+
}
|
|
903
|
+
function _define_property$5(obj, key, value) {
|
|
904
|
+
if (key in obj) {
|
|
905
|
+
Object.defineProperty(obj, key, {
|
|
906
|
+
value: value,
|
|
907
|
+
enumerable: true,
|
|
908
|
+
configurable: true,
|
|
909
|
+
writable: true
|
|
910
|
+
});
|
|
911
|
+
} else {
|
|
912
|
+
obj[key] = value;
|
|
913
|
+
}
|
|
914
|
+
return obj;
|
|
915
|
+
}
|
|
410
916
|
/**
|
|
411
917
|
* Abstract configuration class for the NestJS Zoho CRM service.
|
|
412
918
|
*
|
|
413
919
|
* Used as a DI token so that applications can provide their own config values
|
|
414
920
|
* while keeping the expected shape consistent.
|
|
415
|
-
*/
|
|
416
|
-
|
|
417
|
-
|
|
921
|
+
*/ var ZohoCrmServiceConfig = /*#__PURE__*/ function() {
|
|
922
|
+
function ZohoCrmServiceConfig() {
|
|
923
|
+
_class_call_check$5(this, ZohoCrmServiceConfig);
|
|
924
|
+
/**
|
|
418
925
|
* Zoho CRM API connection settings (endpoint URL, etc.).
|
|
419
|
-
*/
|
|
420
|
-
|
|
421
|
-
/**
|
|
926
|
+
*/ _define_property$5(this, "zohoCrm", void 0);
|
|
927
|
+
/**
|
|
422
928
|
* Optional factory-level overrides applied when creating the underlying CRM client.
|
|
423
|
-
*/
|
|
424
|
-
|
|
425
|
-
|
|
929
|
+
*/ _define_property$5(this, "factoryConfig", void 0);
|
|
930
|
+
}
|
|
931
|
+
_create_class$5(ZohoCrmServiceConfig, null, [
|
|
932
|
+
{
|
|
933
|
+
key: "assertValidConfig",
|
|
934
|
+
value: /**
|
|
426
935
|
* Validates that the required Zoho CRM connection fields are present and well-formed.
|
|
427
|
-
*/
|
|
428
|
-
|
|
429
|
-
|
|
936
|
+
*/ function assertValidConfig(config) {
|
|
937
|
+
assertValidZohoConfig(config.zohoCrm);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
]);
|
|
941
|
+
return ZohoCrmServiceConfig;
|
|
942
|
+
}
|
|
943
|
+
();
|
|
944
|
+
|
|
945
|
+
function _class_call_check$4(instance, Constructor) {
|
|
946
|
+
if (!(instance instanceof Constructor)) {
|
|
947
|
+
throw new TypeError("Cannot call a class as a function");
|
|
430
948
|
}
|
|
431
949
|
}
|
|
432
|
-
|
|
950
|
+
function _defineProperties$4(target, props) {
|
|
951
|
+
for(var i = 0; i < props.length; i++){
|
|
952
|
+
var descriptor = props[i];
|
|
953
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
954
|
+
descriptor.configurable = true;
|
|
955
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
956
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function _create_class$4(Constructor, protoProps, staticProps) {
|
|
960
|
+
if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
|
|
961
|
+
return Constructor;
|
|
962
|
+
}
|
|
963
|
+
function _define_property$4(obj, key, value) {
|
|
964
|
+
if (key in obj) {
|
|
965
|
+
Object.defineProperty(obj, key, {
|
|
966
|
+
value: value,
|
|
967
|
+
enumerable: true,
|
|
968
|
+
configurable: true,
|
|
969
|
+
writable: true
|
|
970
|
+
});
|
|
971
|
+
} else {
|
|
972
|
+
obj[key] = value;
|
|
973
|
+
}
|
|
974
|
+
return obj;
|
|
975
|
+
}
|
|
976
|
+
function _object_spread$2(target) {
|
|
977
|
+
for(var i = 1; i < arguments.length; i++){
|
|
978
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
979
|
+
var ownKeys = Object.keys(source);
|
|
980
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
981
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
982
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
983
|
+
}));
|
|
984
|
+
}
|
|
985
|
+
ownKeys.forEach(function(key) {
|
|
986
|
+
_define_property$4(target, key, source[key]);
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
return target;
|
|
990
|
+
}
|
|
991
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
992
|
+
var keys = Object.keys(object);
|
|
993
|
+
if (Object.getOwnPropertySymbols) {
|
|
994
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
995
|
+
keys.push.apply(keys, symbols);
|
|
996
|
+
}
|
|
997
|
+
return keys;
|
|
998
|
+
}
|
|
999
|
+
function _object_spread_props$2(target, source) {
|
|
1000
|
+
source = source != null ? source : {};
|
|
1001
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
1002
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1003
|
+
} else {
|
|
1004
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1005
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return target;
|
|
1009
|
+
}
|
|
433
1010
|
/**
|
|
434
1011
|
* NestJS injectable service that wraps the Zoho CRM API.
|
|
435
1012
|
*
|
|
436
1013
|
* Provides convenient accessor getters for all CRM operations, each bound
|
|
437
1014
|
* to the authenticated CRM context created during construction.
|
|
438
|
-
*/
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
1015
|
+
*/ var ZohoCrmApi = /*#__PURE__*/ function() {
|
|
1016
|
+
function ZohoCrmApi(config, zohoAccountsApi) {
|
|
1017
|
+
_class_call_check$4(this, ZohoCrmApi);
|
|
1018
|
+
_define_property$4(this, "config", void 0);
|
|
1019
|
+
_define_property$4(this, "zohoAccountsApi", void 0);
|
|
1020
|
+
/**
|
|
443
1021
|
* Underlying Zoho CRM client instance, initialized from the injected config and accounts context.
|
|
444
|
-
*/
|
|
445
|
-
zohoCrm;
|
|
446
|
-
/**
|
|
447
|
-
* The authenticated CRM context used by all operation accessors.
|
|
448
|
-
*/
|
|
449
|
-
get crmContext() {
|
|
450
|
-
return this.zohoCrm.crmContext;
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Rate limiter shared across all CRM requests to respect Zoho API quotas.
|
|
454
|
-
*/
|
|
455
|
-
get zohoRateLimiter() {
|
|
456
|
-
return this.zohoCrm.crmContext.zohoRateLimiter;
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Initializes the CRM client by combining the service config with the
|
|
460
|
-
* accounts context for OAuth token management.
|
|
461
|
-
*/
|
|
462
|
-
constructor(config, zohoAccountsApi) {
|
|
1022
|
+
*/ _define_property$4(this, "zohoCrm", void 0);
|
|
463
1023
|
this.config = config;
|
|
464
1024
|
this.zohoAccountsApi = zohoAccountsApi;
|
|
465
|
-
this.zohoCrm = zohoCrmFactory({
|
|
466
|
-
...config.factoryConfig,
|
|
1025
|
+
this.zohoCrm = zohoCrmFactory(_object_spread_props$2(_object_spread$2({}, config.factoryConfig), {
|
|
467
1026
|
accountsContext: zohoAccountsApi.accountsContext
|
|
468
|
-
})(config.zohoCrm);
|
|
469
|
-
}
|
|
470
|
-
// MARK: Accessors
|
|
471
|
-
/** Configured pass-through for {@link zohoCrmInsertRecord}. */
|
|
472
|
-
get insertRecord() {
|
|
473
|
-
return zohoCrmInsertRecord(this.crmContext);
|
|
474
|
-
}
|
|
475
|
-
/** Configured pass-through for {@link zohoCrmUpsertRecord}. */
|
|
476
|
-
get upsertRecord() {
|
|
477
|
-
return zohoCrmUpsertRecord(this.crmContext);
|
|
478
|
-
}
|
|
479
|
-
/** Configured pass-through for {@link zohoCrmUpdateRecord}. */
|
|
480
|
-
get updateRecord() {
|
|
481
|
-
return zohoCrmUpdateRecord(this.crmContext);
|
|
482
|
-
}
|
|
483
|
-
/** Configured pass-through for {@link zohoCrmDeleteRecord}. */
|
|
484
|
-
get deleteRecord() {
|
|
485
|
-
return zohoCrmDeleteRecord(this.crmContext);
|
|
486
|
-
}
|
|
487
|
-
/** Configured pass-through for {@link zohoCrmGetRecordById}. */
|
|
488
|
-
get getRecordById() {
|
|
489
|
-
return zohoCrmGetRecordById(this.crmContext);
|
|
490
|
-
}
|
|
491
|
-
/** Configured pass-through for {@link zohoCrmGetRecords}. */
|
|
492
|
-
get getRecords() {
|
|
493
|
-
return zohoCrmGetRecords(this.crmContext);
|
|
494
|
-
}
|
|
495
|
-
/** Configured pass-through for {@link zohoCrmSearchRecords}. */
|
|
496
|
-
get searchRecords() {
|
|
497
|
-
return zohoCrmSearchRecords(this.crmContext);
|
|
498
|
-
}
|
|
499
|
-
/** Configured pass-through for {@link zohoCrmSearchRecordsPageFactory}. */
|
|
500
|
-
get searchRecordsPageFactory() {
|
|
501
|
-
return zohoCrmSearchRecordsPageFactory(this.crmContext);
|
|
502
|
-
}
|
|
503
|
-
/** Configured pass-through for {@link zohoCrmGetRelatedRecordsFunctionFactory}. */
|
|
504
|
-
get getRelatedRecordsFunctionFactory() {
|
|
505
|
-
return zohoCrmGetRelatedRecordsFunctionFactory(this.crmContext);
|
|
506
|
-
}
|
|
507
|
-
/** Configured pass-through for {@link zohoCrmGetEmailsForRecord}. */
|
|
508
|
-
get getEmailsForRecord() {
|
|
509
|
-
return zohoCrmGetEmailsForRecord(this.crmContext);
|
|
510
|
-
}
|
|
511
|
-
/** Configured pass-through for {@link zohoCrmGetEmailsForRecordPageFactory}. */
|
|
512
|
-
get getEmailsForRecordPageFactory() {
|
|
513
|
-
return zohoCrmGetEmailsForRecordPageFactory(this.crmContext);
|
|
514
|
-
}
|
|
515
|
-
/** Configured pass-through for {@link zohoCrmGetAttachmentsForRecord}. */
|
|
516
|
-
get getAttachmentsForRecord() {
|
|
517
|
-
return zohoCrmGetAttachmentsForRecord(this.crmContext);
|
|
518
|
-
}
|
|
519
|
-
/** Configured pass-through for {@link zohoCrmGetAttachmentsForRecordPageFactory}. */
|
|
520
|
-
get getAttachmentsForRecordPageFactory() {
|
|
521
|
-
return zohoCrmGetAttachmentsForRecordPageFactory(this.crmContext);
|
|
522
|
-
}
|
|
523
|
-
/** Configured pass-through for {@link zohoCrmUploadAttachmentForRecord}. */
|
|
524
|
-
get uploadAttachmentForRecord() {
|
|
525
|
-
return zohoCrmUploadAttachmentForRecord(this.crmContext);
|
|
526
|
-
}
|
|
527
|
-
/** Configured pass-through for {@link zohoCrmDownloadAttachmentForRecord}. */
|
|
528
|
-
get downloadAttachmentForRecord() {
|
|
529
|
-
return zohoCrmDownloadAttachmentForRecord(this.crmContext);
|
|
530
|
-
}
|
|
531
|
-
/** Configured pass-through for {@link zohoCrmDeleteAttachmentFromRecord}. */
|
|
532
|
-
get deleteAttachmentFromRecord() {
|
|
533
|
-
return zohoCrmDeleteAttachmentFromRecord(this.crmContext);
|
|
1027
|
+
}))(config.zohoCrm);
|
|
534
1028
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
1029
|
+
_create_class$4(ZohoCrmApi, [
|
|
1030
|
+
{
|
|
1031
|
+
key: "crmContext",
|
|
1032
|
+
get: /**
|
|
1033
|
+
* The authenticated CRM context used by all operation accessors.
|
|
1034
|
+
*/ function get() {
|
|
1035
|
+
return this.zohoCrm.crmContext;
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
key: "zohoRateLimiter",
|
|
1040
|
+
get: /**
|
|
1041
|
+
* Rate limiter shared across all CRM requests to respect Zoho API quotas.
|
|
1042
|
+
*/ function get() {
|
|
1043
|
+
return this.zohoCrm.crmContext.zohoRateLimiter;
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
key: "insertRecord",
|
|
1048
|
+
get: // MARK: Accessors
|
|
1049
|
+
/** Configured pass-through for {@link zohoCrmInsertRecord}. */ function get() {
|
|
1050
|
+
return zohoCrmInsertRecord(this.crmContext);
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
key: "upsertRecord",
|
|
1055
|
+
get: /** Configured pass-through for {@link zohoCrmUpsertRecord}. */ function get() {
|
|
1056
|
+
return zohoCrmUpsertRecord(this.crmContext);
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
key: "updateRecord",
|
|
1061
|
+
get: /** Configured pass-through for {@link zohoCrmUpdateRecord}. */ function get() {
|
|
1062
|
+
return zohoCrmUpdateRecord(this.crmContext);
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
key: "deleteRecord",
|
|
1067
|
+
get: /** Configured pass-through for {@link zohoCrmDeleteRecord}. */ function get() {
|
|
1068
|
+
return zohoCrmDeleteRecord(this.crmContext);
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
key: "getRecordById",
|
|
1073
|
+
get: /** Configured pass-through for {@link zohoCrmGetRecordById}. */ function get() {
|
|
1074
|
+
return zohoCrmGetRecordById(this.crmContext);
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
key: "getRecords",
|
|
1079
|
+
get: /** Configured pass-through for {@link zohoCrmGetRecords}. */ function get() {
|
|
1080
|
+
return zohoCrmGetRecords(this.crmContext);
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
key: "searchRecords",
|
|
1085
|
+
get: /** Configured pass-through for {@link zohoCrmSearchRecords}. */ function get() {
|
|
1086
|
+
return zohoCrmSearchRecords(this.crmContext);
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
key: "searchRecordsPageFactory",
|
|
1091
|
+
get: /** Configured pass-through for {@link zohoCrmSearchRecordsPageFactory}. */ function get() {
|
|
1092
|
+
return zohoCrmSearchRecordsPageFactory(this.crmContext);
|
|
1093
|
+
}
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
key: "getRelatedRecordsFunctionFactory",
|
|
1097
|
+
get: /** Configured pass-through for {@link zohoCrmGetRelatedRecordsFunctionFactory}. */ function get() {
|
|
1098
|
+
return zohoCrmGetRelatedRecordsFunctionFactory(this.crmContext);
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
key: "getEmailsForRecord",
|
|
1103
|
+
get: /** Configured pass-through for {@link zohoCrmGetEmailsForRecord}. */ function get() {
|
|
1104
|
+
return zohoCrmGetEmailsForRecord(this.crmContext);
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
key: "getEmailsForRecordPageFactory",
|
|
1109
|
+
get: /** Configured pass-through for {@link zohoCrmGetEmailsForRecordPageFactory}. */ function get() {
|
|
1110
|
+
return zohoCrmGetEmailsForRecordPageFactory(this.crmContext);
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
key: "getAttachmentsForRecord",
|
|
1115
|
+
get: /** Configured pass-through for {@link zohoCrmGetAttachmentsForRecord}. */ function get() {
|
|
1116
|
+
return zohoCrmGetAttachmentsForRecord(this.crmContext);
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
key: "getAttachmentsForRecordPageFactory",
|
|
1121
|
+
get: /** Configured pass-through for {@link zohoCrmGetAttachmentsForRecordPageFactory}. */ function get() {
|
|
1122
|
+
return zohoCrmGetAttachmentsForRecordPageFactory(this.crmContext);
|
|
1123
|
+
}
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
key: "uploadAttachmentForRecord",
|
|
1127
|
+
get: /** Configured pass-through for {@link zohoCrmUploadAttachmentForRecord}. */ function get() {
|
|
1128
|
+
return zohoCrmUploadAttachmentForRecord(this.crmContext);
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
key: "downloadAttachmentForRecord",
|
|
1133
|
+
get: /** Configured pass-through for {@link zohoCrmDownloadAttachmentForRecord}. */ function get() {
|
|
1134
|
+
return zohoCrmDownloadAttachmentForRecord(this.crmContext);
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
key: "deleteAttachmentFromRecord",
|
|
1139
|
+
get: /** Configured pass-through for {@link zohoCrmDeleteAttachmentFromRecord}. */ function get() {
|
|
1140
|
+
return zohoCrmDeleteAttachmentFromRecord(this.crmContext);
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
key: "createNotes",
|
|
1145
|
+
get: /** Configured pass-through for {@link zohoCrmCreateNotes}. */ function get() {
|
|
1146
|
+
return zohoCrmCreateNotes(this.crmContext);
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
key: "deleteNotes",
|
|
1151
|
+
get: /** Configured pass-through for {@link zohoCrmDeleteNotes}. */ function get() {
|
|
1152
|
+
return zohoCrmDeleteNotes(this.crmContext);
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
key: "createNotesForRecord",
|
|
1157
|
+
get: /** Configured pass-through for {@link zohoCrmCreateNotesForRecord}. */ function get() {
|
|
1158
|
+
return zohoCrmCreateNotesForRecord(this.crmContext);
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
key: "getNotesForRecord",
|
|
1163
|
+
get: /** Configured pass-through for {@link zohoCrmGetNotesForRecord}. */ function get() {
|
|
1164
|
+
return zohoCrmGetNotesForRecord(this.crmContext);
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
key: "getNotesForRecordPageFactory",
|
|
1169
|
+
get: /** Configured pass-through for {@link zohoCrmGetNotesForRecordPageFactory}. */ function get() {
|
|
1170
|
+
return zohoCrmGetNotesForRecordPageFactory(this.crmContext);
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
key: "executeRestApiFunction",
|
|
1175
|
+
get: /** Configured pass-through for {@link zohoCrmExecuteRestApiFunction}. */ function get() {
|
|
1176
|
+
return zohoCrmExecuteRestApiFunction(this.crmContext);
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
key: "createTagsForModule",
|
|
1181
|
+
get: /** Configured pass-through for {@link zohoCrmCreateTagsForModule}. */ function get() {
|
|
1182
|
+
return zohoCrmCreateTagsForModule(this.crmContext);
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
key: "deleteTag",
|
|
1187
|
+
get: /** Configured pass-through for {@link zohoCrmDeleteTag}. */ function get() {
|
|
1188
|
+
return zohoCrmDeleteTag(this.crmContext);
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
key: "getTagsForModule",
|
|
1193
|
+
get: /** Configured pass-through for {@link zohoCrmGetTagsForModule}. */ function get() {
|
|
1194
|
+
return zohoCrmGetTagsForModule(this.crmContext);
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
key: "addTagsToRecords",
|
|
1199
|
+
get: /** Configured pass-through for {@link zohoCrmAddTagsToRecords}. */ function get() {
|
|
1200
|
+
return zohoCrmAddTagsToRecords(this.crmContext);
|
|
1201
|
+
}
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
key: "removeTagsFromRecords",
|
|
1205
|
+
get: /** Configured pass-through for {@link zohoCrmRemoveTagsFromRecords}. */ function get() {
|
|
1206
|
+
return zohoCrmRemoveTagsFromRecords(this.crmContext);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
]);
|
|
1210
|
+
return ZohoCrmApi;
|
|
1211
|
+
}();
|
|
580
1212
|
ZohoCrmApi = __decorate([
|
|
581
1213
|
Injectable(),
|
|
582
1214
|
__param(0, Inject(ZohoCrmServiceConfig)),
|
|
583
1215
|
__param(1, Inject(ZohoAccountsApi))
|
|
584
1216
|
], ZohoCrmApi);
|
|
585
1217
|
|
|
1218
|
+
function _array_like_to_array$2(arr, len) {
|
|
1219
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1220
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1221
|
+
return arr2;
|
|
1222
|
+
}
|
|
1223
|
+
function _array_without_holes$2(arr) {
|
|
1224
|
+
if (Array.isArray(arr)) return _array_like_to_array$2(arr);
|
|
1225
|
+
}
|
|
1226
|
+
function _iterable_to_array$2(iter) {
|
|
1227
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1228
|
+
}
|
|
1229
|
+
function _non_iterable_spread$2() {
|
|
1230
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1231
|
+
}
|
|
1232
|
+
function _to_consumable_array$2(arr) {
|
|
1233
|
+
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
|
|
1234
|
+
}
|
|
1235
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
1236
|
+
if (!o) return;
|
|
1237
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
1238
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1239
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1240
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1241
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
1242
|
+
}
|
|
586
1243
|
// MARK: Provider Factories
|
|
587
1244
|
/**
|
|
588
1245
|
* Reads Zoho CRM connection settings from the NestJS ConfigService
|
|
@@ -603,10 +1260,9 @@ ZohoCrmApi = __decorate([
|
|
|
603
1260
|
* useFactory: zohoCrmServiceConfigFactory
|
|
604
1261
|
* }
|
|
605
1262
|
* ```
|
|
606
|
-
*/
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
const config = {
|
|
1263
|
+
*/ function zohoCrmServiceConfigFactory(configService) {
|
|
1264
|
+
var getFromConfigService = zohoConfigServiceReaderFunction(ZOHO_CRM_SERVICE_NAME, configService);
|
|
1265
|
+
var config = {
|
|
610
1266
|
zohoCrm: {
|
|
611
1267
|
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
612
1268
|
}
|
|
@@ -629,10 +1285,9 @@ function zohoCrmServiceConfigFactory(configService) {
|
|
|
629
1285
|
* useFactory: zohoCrmAccountServiceConfigFactory
|
|
630
1286
|
* }
|
|
631
1287
|
* ```
|
|
632
|
-
*/
|
|
633
|
-
function zohoCrmAccountServiceConfigFactory(configService) {
|
|
1288
|
+
*/ function zohoCrmAccountServiceConfigFactory(configService) {
|
|
634
1289
|
return zohoAccountsServiceConfigFromConfigService({
|
|
635
|
-
configService,
|
|
1290
|
+
configService: configService,
|
|
636
1291
|
serviceAccessTokenKey: ZOHO_CRM_SERVICE_NAME
|
|
637
1292
|
});
|
|
638
1293
|
}
|
|
@@ -671,224 +1326,422 @@ function zohoCrmAccountServiceConfigFactory(configService) {
|
|
|
671
1326
|
* @Module(appZohoCrmModuleMetadata({ dependencyModule: ZohoCrmDependencyModule }))
|
|
672
1327
|
* export class AppZohoCrmModule {}
|
|
673
1328
|
* ```
|
|
674
|
-
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
1329
|
+
*/ function appZohoCrmModuleMetadata(config) {
|
|
1330
|
+
var dependencyModule = config.dependencyModule, imports = config.imports, exports$1 = config.exports, providers = config.providers;
|
|
1331
|
+
var dependencyModuleImport = dependencyModule ? [
|
|
1332
|
+
dependencyModule
|
|
1333
|
+
] : [];
|
|
678
1334
|
return {
|
|
679
|
-
imports: [
|
|
680
|
-
|
|
1335
|
+
imports: [
|
|
1336
|
+
ConfigModule
|
|
1337
|
+
].concat(_to_consumable_array$2(dependencyModuleImport), _to_consumable_array$2(imports !== null && imports !== void 0 ? imports : [])),
|
|
1338
|
+
exports: [
|
|
1339
|
+
ZohoCrmApi
|
|
1340
|
+
].concat(_to_consumable_array$2(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
681
1341
|
providers: [
|
|
682
1342
|
{
|
|
683
1343
|
provide: ZohoCrmServiceConfig,
|
|
684
|
-
inject: [
|
|
1344
|
+
inject: [
|
|
1345
|
+
ConfigService
|
|
1346
|
+
],
|
|
685
1347
|
useFactory: zohoCrmServiceConfigFactory
|
|
686
1348
|
},
|
|
687
1349
|
ZohoCrmApi,
|
|
688
1350
|
// Accounts
|
|
689
1351
|
{
|
|
690
1352
|
provide: ZohoAccountsServiceConfig,
|
|
691
|
-
inject: [
|
|
1353
|
+
inject: [
|
|
1354
|
+
ConfigService
|
|
1355
|
+
],
|
|
692
1356
|
useFactory: zohoCrmAccountServiceConfigFactory
|
|
693
1357
|
},
|
|
694
|
-
ZohoAccountsApi
|
|
695
|
-
|
|
696
|
-
]
|
|
1358
|
+
ZohoAccountsApi
|
|
1359
|
+
].concat(_to_consumable_array$2(providers !== null && providers !== void 0 ? providers : []))
|
|
697
1360
|
};
|
|
698
1361
|
}
|
|
699
1362
|
|
|
1363
|
+
function _class_call_check$3(instance, Constructor) {
|
|
1364
|
+
if (!(instance instanceof Constructor)) {
|
|
1365
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
function _defineProperties$3(target, props) {
|
|
1369
|
+
for(var i = 0; i < props.length; i++){
|
|
1370
|
+
var descriptor = props[i];
|
|
1371
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1372
|
+
descriptor.configurable = true;
|
|
1373
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
1374
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
function _create_class$3(Constructor, protoProps, staticProps) {
|
|
1378
|
+
if (staticProps) _defineProperties$3(Constructor, staticProps);
|
|
1379
|
+
return Constructor;
|
|
1380
|
+
}
|
|
1381
|
+
function _define_property$3(obj, key, value) {
|
|
1382
|
+
if (key in obj) {
|
|
1383
|
+
Object.defineProperty(obj, key, {
|
|
1384
|
+
value: value,
|
|
1385
|
+
enumerable: true,
|
|
1386
|
+
configurable: true,
|
|
1387
|
+
writable: true
|
|
1388
|
+
});
|
|
1389
|
+
} else {
|
|
1390
|
+
obj[key] = value;
|
|
1391
|
+
}
|
|
1392
|
+
return obj;
|
|
1393
|
+
}
|
|
700
1394
|
/**
|
|
701
1395
|
* Abstract configuration class for the NestJS Zoho Recruit service.
|
|
702
1396
|
*
|
|
703
1397
|
* Used as a DI token so that applications can provide their own config values
|
|
704
1398
|
* while keeping the expected shape consistent.
|
|
705
|
-
*/
|
|
706
|
-
|
|
707
|
-
|
|
1399
|
+
*/ var ZohoRecruitServiceConfig = /*#__PURE__*/ function() {
|
|
1400
|
+
function ZohoRecruitServiceConfig() {
|
|
1401
|
+
_class_call_check$3(this, ZohoRecruitServiceConfig);
|
|
1402
|
+
/**
|
|
708
1403
|
* Zoho Recruit API connection settings (endpoint URL, etc.).
|
|
709
|
-
*/
|
|
710
|
-
|
|
711
|
-
/**
|
|
1404
|
+
*/ _define_property$3(this, "zohoRecruit", void 0);
|
|
1405
|
+
/**
|
|
712
1406
|
* Optional factory-level overrides applied when creating the underlying Recruit client.
|
|
713
|
-
*/
|
|
714
|
-
|
|
715
|
-
|
|
1407
|
+
*/ _define_property$3(this, "factoryConfig", void 0);
|
|
1408
|
+
}
|
|
1409
|
+
_create_class$3(ZohoRecruitServiceConfig, null, [
|
|
1410
|
+
{
|
|
1411
|
+
key: "assertValidConfig",
|
|
1412
|
+
value: /**
|
|
716
1413
|
* Validates that the required Zoho Recruit connection fields are present and well-formed.
|
|
717
|
-
*/
|
|
718
|
-
|
|
719
|
-
|
|
1414
|
+
*/ function assertValidConfig(config) {
|
|
1415
|
+
assertValidZohoConfig(config.zohoRecruit);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
]);
|
|
1419
|
+
return ZohoRecruitServiceConfig;
|
|
1420
|
+
}
|
|
1421
|
+
();
|
|
1422
|
+
|
|
1423
|
+
function _class_call_check$2(instance, Constructor) {
|
|
1424
|
+
if (!(instance instanceof Constructor)) {
|
|
1425
|
+
throw new TypeError("Cannot call a class as a function");
|
|
720
1426
|
}
|
|
721
1427
|
}
|
|
722
|
-
|
|
1428
|
+
function _defineProperties$2(target, props) {
|
|
1429
|
+
for(var i = 0; i < props.length; i++){
|
|
1430
|
+
var descriptor = props[i];
|
|
1431
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1432
|
+
descriptor.configurable = true;
|
|
1433
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
1434
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
1438
|
+
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
|
|
1439
|
+
return Constructor;
|
|
1440
|
+
}
|
|
1441
|
+
function _define_property$2(obj, key, value) {
|
|
1442
|
+
if (key in obj) {
|
|
1443
|
+
Object.defineProperty(obj, key, {
|
|
1444
|
+
value: value,
|
|
1445
|
+
enumerable: true,
|
|
1446
|
+
configurable: true,
|
|
1447
|
+
writable: true
|
|
1448
|
+
});
|
|
1449
|
+
} else {
|
|
1450
|
+
obj[key] = value;
|
|
1451
|
+
}
|
|
1452
|
+
return obj;
|
|
1453
|
+
}
|
|
1454
|
+
function _object_spread$1(target) {
|
|
1455
|
+
for(var i = 1; i < arguments.length; i++){
|
|
1456
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1457
|
+
var ownKeys = Object.keys(source);
|
|
1458
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1459
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1460
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1461
|
+
}));
|
|
1462
|
+
}
|
|
1463
|
+
ownKeys.forEach(function(key) {
|
|
1464
|
+
_define_property$2(target, key, source[key]);
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
return target;
|
|
1468
|
+
}
|
|
1469
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
1470
|
+
var keys = Object.keys(object);
|
|
1471
|
+
if (Object.getOwnPropertySymbols) {
|
|
1472
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1473
|
+
keys.push.apply(keys, symbols);
|
|
1474
|
+
}
|
|
1475
|
+
return keys;
|
|
1476
|
+
}
|
|
1477
|
+
function _object_spread_props$1(target, source) {
|
|
1478
|
+
source = source != null ? source : {};
|
|
1479
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
1480
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1481
|
+
} else {
|
|
1482
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
1483
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
return target;
|
|
1487
|
+
}
|
|
723
1488
|
/**
|
|
724
1489
|
* NestJS injectable service that wraps the Zoho Recruit API.
|
|
725
1490
|
*
|
|
726
1491
|
* Provides convenient accessor getters for all Recruit operations, each bound
|
|
727
1492
|
* to the authenticated Recruit context created during construction.
|
|
728
|
-
*/
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1493
|
+
*/ var ZohoRecruitApi = /*#__PURE__*/ function() {
|
|
1494
|
+
function ZohoRecruitApi(config, zohoAccountsApi) {
|
|
1495
|
+
_class_call_check$2(this, ZohoRecruitApi);
|
|
1496
|
+
_define_property$2(this, "config", void 0);
|
|
1497
|
+
_define_property$2(this, "zohoAccountsApi", void 0);
|
|
1498
|
+
/**
|
|
733
1499
|
* Underlying Zoho Recruit client instance, initialized from the injected config and accounts context.
|
|
734
|
-
*/
|
|
735
|
-
zohoRecruit;
|
|
736
|
-
/**
|
|
737
|
-
* The authenticated Recruit context used by all operation accessors.
|
|
738
|
-
*/
|
|
739
|
-
get recruitContext() {
|
|
740
|
-
return this.zohoRecruit.recruitContext;
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Rate limiter shared across all Recruit requests to respect Zoho API quotas.
|
|
744
|
-
*/
|
|
745
|
-
get zohoRateLimiter() {
|
|
746
|
-
return this.zohoRecruit.recruitContext.zohoRateLimiter;
|
|
747
|
-
}
|
|
748
|
-
/**
|
|
749
|
-
* Initializes the Recruit client by combining the service config with the
|
|
750
|
-
* accounts context for OAuth token management.
|
|
751
|
-
*/
|
|
752
|
-
constructor(config, zohoAccountsApi) {
|
|
1500
|
+
*/ _define_property$2(this, "zohoRecruit", void 0);
|
|
753
1501
|
this.config = config;
|
|
754
1502
|
this.zohoAccountsApi = zohoAccountsApi;
|
|
755
|
-
this.zohoRecruit = zohoRecruitFactory({
|
|
756
|
-
...config.factoryConfig,
|
|
1503
|
+
this.zohoRecruit = zohoRecruitFactory(_object_spread_props$1(_object_spread$1({}, config.factoryConfig), {
|
|
757
1504
|
accountsContext: zohoAccountsApi.accountsContext
|
|
758
|
-
})(config.zohoRecruit);
|
|
759
|
-
}
|
|
760
|
-
// MARK: Accessors
|
|
761
|
-
/** Configured pass-through for {@link zohoRecruitInsertRecord}. */
|
|
762
|
-
get insertRecord() {
|
|
763
|
-
return zohoRecruitInsertRecord(this.recruitContext);
|
|
764
|
-
}
|
|
765
|
-
/** Configured pass-through for {@link zohoRecruitUpsertRecord}. */
|
|
766
|
-
get upsertRecord() {
|
|
767
|
-
return zohoRecruitUpsertRecord(this.recruitContext);
|
|
768
|
-
}
|
|
769
|
-
/** Configured pass-through for {@link zohoRecruitUpdateRecord}. */
|
|
770
|
-
get updateRecord() {
|
|
771
|
-
return zohoRecruitUpdateRecord(this.recruitContext);
|
|
772
|
-
}
|
|
773
|
-
/** Configured pass-through for {@link zohoRecruitDeleteRecord}. */
|
|
774
|
-
get deleteRecord() {
|
|
775
|
-
return zohoRecruitDeleteRecord(this.recruitContext);
|
|
776
|
-
}
|
|
777
|
-
/** Configured pass-through for {@link zohoRecruitGetRecordById}. */
|
|
778
|
-
get getRecordById() {
|
|
779
|
-
return zohoRecruitGetRecordById(this.recruitContext);
|
|
780
|
-
}
|
|
781
|
-
/** Configured pass-through for {@link zohoRecruitGetRecords}. */
|
|
782
|
-
get getRecords() {
|
|
783
|
-
return zohoRecruitGetRecords(this.recruitContext);
|
|
784
|
-
}
|
|
785
|
-
/** Configured pass-through for {@link zohoRecruitSearchRecords}. */
|
|
786
|
-
get searchRecords() {
|
|
787
|
-
return zohoRecruitSearchRecords(this.recruitContext);
|
|
788
|
-
}
|
|
789
|
-
/** Configured pass-through for {@link zohoRecruitSearchRecordsPageFactory}. */
|
|
790
|
-
get searchRecordsPageFactory() {
|
|
791
|
-
return zohoRecruitSearchRecordsPageFactory(this.recruitContext);
|
|
792
|
-
}
|
|
793
|
-
/** Configured pass-through for {@link zohoRecruitGetRelatedRecordsFunctionFactory}. */
|
|
794
|
-
get getRelatedRecordsFunctionFactory() {
|
|
795
|
-
return zohoRecruitGetRelatedRecordsFunctionFactory(this.recruitContext);
|
|
796
|
-
}
|
|
797
|
-
/** Configured pass-through for {@link zohoRecruitGetEmailsForRecord}. */
|
|
798
|
-
get getEmailsForRecord() {
|
|
799
|
-
return zohoRecruitGetEmailsForRecord(this.recruitContext);
|
|
800
|
-
}
|
|
801
|
-
/** Configured pass-through for {@link zohoRecruitGetEmailsForRecordPageFactory}. */
|
|
802
|
-
get getEmailsForRecordPageFactory() {
|
|
803
|
-
return zohoRecruitGetEmailsForRecordPageFactory(this.recruitContext);
|
|
804
|
-
}
|
|
805
|
-
/** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecord}. */
|
|
806
|
-
get getAttachmentsForRecord() {
|
|
807
|
-
return zohoRecruitGetAttachmentsForRecord(this.recruitContext);
|
|
808
|
-
}
|
|
809
|
-
/** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecordPageFactory}. */
|
|
810
|
-
get getAttachmentsForRecordPageFactory() {
|
|
811
|
-
return zohoRecruitGetAttachmentsForRecordPageFactory(this.recruitContext);
|
|
812
|
-
}
|
|
813
|
-
/** Configured pass-through for {@link zohoRecruitUploadAttachmentForRecord}. */
|
|
814
|
-
get uploadAttachmentForRecord() {
|
|
815
|
-
return zohoRecruitUploadAttachmentForRecord(this.recruitContext);
|
|
816
|
-
}
|
|
817
|
-
/** Configured pass-through for {@link zohoRecruitDownloadAttachmentForRecord}. */
|
|
818
|
-
get downloadAttachmentForRecord() {
|
|
819
|
-
return zohoRecruitDownloadAttachmentForRecord(this.recruitContext);
|
|
820
|
-
}
|
|
821
|
-
/** Configured pass-through for {@link zohoRecruitDeleteAttachmentFromRecord}. */
|
|
822
|
-
get deleteAttachmentFromRecord() {
|
|
823
|
-
return zohoRecruitDeleteAttachmentFromRecord(this.recruitContext);
|
|
824
|
-
}
|
|
825
|
-
/** Configured pass-through for {@link zohoRecruitCreateNotes}. */
|
|
826
|
-
get createNotes() {
|
|
827
|
-
return zohoRecruitCreateNotes(this.recruitContext);
|
|
1505
|
+
}))(config.zohoRecruit);
|
|
828
1506
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
1507
|
+
_create_class$2(ZohoRecruitApi, [
|
|
1508
|
+
{
|
|
1509
|
+
key: "recruitContext",
|
|
1510
|
+
get: /**
|
|
1511
|
+
* The authenticated Recruit context used by all operation accessors.
|
|
1512
|
+
*/ function get() {
|
|
1513
|
+
return this.zohoRecruit.recruitContext;
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
key: "zohoRateLimiter",
|
|
1518
|
+
get: /**
|
|
1519
|
+
* Rate limiter shared across all Recruit requests to respect Zoho API quotas.
|
|
1520
|
+
*/ function get() {
|
|
1521
|
+
return this.zohoRecruit.recruitContext.zohoRateLimiter;
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
key: "insertRecord",
|
|
1526
|
+
get: // MARK: Accessors
|
|
1527
|
+
/** Configured pass-through for {@link zohoRecruitInsertRecord}. */ function get() {
|
|
1528
|
+
return zohoRecruitInsertRecord(this.recruitContext);
|
|
1529
|
+
}
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
key: "upsertRecord",
|
|
1533
|
+
get: /** Configured pass-through for {@link zohoRecruitUpsertRecord}. */ function get() {
|
|
1534
|
+
return zohoRecruitUpsertRecord(this.recruitContext);
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
key: "updateRecord",
|
|
1539
|
+
get: /** Configured pass-through for {@link zohoRecruitUpdateRecord}. */ function get() {
|
|
1540
|
+
return zohoRecruitUpdateRecord(this.recruitContext);
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
{
|
|
1544
|
+
key: "deleteRecord",
|
|
1545
|
+
get: /** Configured pass-through for {@link zohoRecruitDeleteRecord}. */ function get() {
|
|
1546
|
+
return zohoRecruitDeleteRecord(this.recruitContext);
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
{
|
|
1550
|
+
key: "getRecordById",
|
|
1551
|
+
get: /** Configured pass-through for {@link zohoRecruitGetRecordById}. */ function get() {
|
|
1552
|
+
return zohoRecruitGetRecordById(this.recruitContext);
|
|
1553
|
+
}
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
key: "getRecords",
|
|
1557
|
+
get: /** Configured pass-through for {@link zohoRecruitGetRecords}. */ function get() {
|
|
1558
|
+
return zohoRecruitGetRecords(this.recruitContext);
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
key: "searchRecords",
|
|
1563
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchRecords}. */ function get() {
|
|
1564
|
+
return zohoRecruitSearchRecords(this.recruitContext);
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
key: "searchRecordsPageFactory",
|
|
1569
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchRecordsPageFactory}. */ function get() {
|
|
1570
|
+
return zohoRecruitSearchRecordsPageFactory(this.recruitContext);
|
|
1571
|
+
}
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
key: "getRelatedRecordsFunctionFactory",
|
|
1575
|
+
get: /** Configured pass-through for {@link zohoRecruitGetRelatedRecordsFunctionFactory}. */ function get() {
|
|
1576
|
+
return zohoRecruitGetRelatedRecordsFunctionFactory(this.recruitContext);
|
|
1577
|
+
}
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
key: "getEmailsForRecord",
|
|
1581
|
+
get: /** Configured pass-through for {@link zohoRecruitGetEmailsForRecord}. */ function get() {
|
|
1582
|
+
return zohoRecruitGetEmailsForRecord(this.recruitContext);
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
key: "getEmailsForRecordPageFactory",
|
|
1587
|
+
get: /** Configured pass-through for {@link zohoRecruitGetEmailsForRecordPageFactory}. */ function get() {
|
|
1588
|
+
return zohoRecruitGetEmailsForRecordPageFactory(this.recruitContext);
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
key: "getAttachmentsForRecord",
|
|
1593
|
+
get: /** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecord}. */ function get() {
|
|
1594
|
+
return zohoRecruitGetAttachmentsForRecord(this.recruitContext);
|
|
1595
|
+
}
|
|
1596
|
+
},
|
|
1597
|
+
{
|
|
1598
|
+
key: "getAttachmentsForRecordPageFactory",
|
|
1599
|
+
get: /** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecordPageFactory}. */ function get() {
|
|
1600
|
+
return zohoRecruitGetAttachmentsForRecordPageFactory(this.recruitContext);
|
|
1601
|
+
}
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
key: "uploadAttachmentForRecord",
|
|
1605
|
+
get: /** Configured pass-through for {@link zohoRecruitUploadAttachmentForRecord}. */ function get() {
|
|
1606
|
+
return zohoRecruitUploadAttachmentForRecord(this.recruitContext);
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
key: "downloadAttachmentForRecord",
|
|
1611
|
+
get: /** Configured pass-through for {@link zohoRecruitDownloadAttachmentForRecord}. */ function get() {
|
|
1612
|
+
return zohoRecruitDownloadAttachmentForRecord(this.recruitContext);
|
|
1613
|
+
}
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
key: "deleteAttachmentFromRecord",
|
|
1617
|
+
get: /** Configured pass-through for {@link zohoRecruitDeleteAttachmentFromRecord}. */ function get() {
|
|
1618
|
+
return zohoRecruitDeleteAttachmentFromRecord(this.recruitContext);
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
key: "createNotes",
|
|
1623
|
+
get: /** Configured pass-through for {@link zohoRecruitCreateNotes}. */ function get() {
|
|
1624
|
+
return zohoRecruitCreateNotes(this.recruitContext);
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
key: "deleteNotes",
|
|
1629
|
+
get: /** Configured pass-through for {@link zohoRecruitDeleteNotes}. */ function get() {
|
|
1630
|
+
return zohoRecruitDeleteNotes(this.recruitContext);
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
key: "createNotesForRecord",
|
|
1635
|
+
get: /** Configured pass-through for {@link zohoRecruitCreateNotesForRecord}. */ function get() {
|
|
1636
|
+
return zohoRecruitCreateNotesForRecord(this.recruitContext);
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
{
|
|
1640
|
+
key: "getNotesForRecord",
|
|
1641
|
+
get: /** Configured pass-through for {@link zohoRecruitGetNotesForRecord}. */ function get() {
|
|
1642
|
+
return zohoRecruitGetNotesForRecord(this.recruitContext);
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1645
|
+
{
|
|
1646
|
+
key: "getNotesForRecordPageFactory",
|
|
1647
|
+
get: /** Configured pass-through for {@link zohoRecruitGetNotesForRecordPageFactory}. */ function get() {
|
|
1648
|
+
return zohoRecruitGetNotesForRecordPageFactory(this.recruitContext);
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
key: "executeRestApiFunction",
|
|
1653
|
+
get: /** Configured pass-through for {@link zohoRecruitExecuteRestApiFunction}. */ function get() {
|
|
1654
|
+
return zohoRecruitExecuteRestApiFunction(this.recruitContext);
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
{
|
|
1658
|
+
key: "associateCandidateRecordsWithJobOpenings",
|
|
1659
|
+
get: /** Configured pass-through for {@link zohoRecruitAssociateCandidateRecordsWithJobOpenings}. */ function get() {
|
|
1660
|
+
return zohoRecruitAssociateCandidateRecordsWithJobOpenings(this.recruitContext);
|
|
1661
|
+
}
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
key: "searchCandidateAssociatedJobOpeningRecords",
|
|
1665
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecords}. */ function get() {
|
|
1666
|
+
return zohoRecruitSearchCandidateAssociatedJobOpeningRecords(this.recruitContext);
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
key: "searchCandidateAssociatedJobOpeningRecordsPageFactory",
|
|
1671
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory}. */ function get() {
|
|
1672
|
+
return zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory(this.recruitContext);
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
key: "searchJobOpeningAssociatedCandidateRecords",
|
|
1677
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecords}. */ function get() {
|
|
1678
|
+
return zohoRecruitSearchJobOpeningAssociatedCandidateRecords(this.recruitContext);
|
|
1679
|
+
}
|
|
1680
|
+
},
|
|
1681
|
+
{
|
|
1682
|
+
key: "searchJobOpeningAssociatedCandidateRecordsPageFactory",
|
|
1683
|
+
get: /** Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory}. */ function get() {
|
|
1684
|
+
return zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory(this.recruitContext);
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
{
|
|
1688
|
+
key: "createTagsForModule",
|
|
1689
|
+
get: /** Configured pass-through for {@link zohoRecruitCreateTagsForModule}. */ function get() {
|
|
1690
|
+
return zohoRecruitCreateTagsForModule(this.recruitContext);
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
key: "getTagsForModule",
|
|
1695
|
+
get: /** Configured pass-through for {@link zohoRecruitGetTagsForModule}. */ function get() {
|
|
1696
|
+
return zohoRecruitGetTagsForModule(this.recruitContext);
|
|
1697
|
+
}
|
|
1698
|
+
},
|
|
1699
|
+
{
|
|
1700
|
+
key: "addTagsToRecords",
|
|
1701
|
+
get: /** Configured pass-through for {@link zohoRecruitAddTagsToRecords}. */ function get() {
|
|
1702
|
+
return zohoRecruitAddTagsToRecords(this.recruitContext);
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
key: "removeTagsFromRecords",
|
|
1707
|
+
get: /** Configured pass-through for {@link zohoRecruitRemoveTagsFromRecords}. */ function get() {
|
|
1708
|
+
return zohoRecruitRemoveTagsFromRecords(this.recruitContext);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
]);
|
|
1712
|
+
return ZohoRecruitApi;
|
|
1713
|
+
}();
|
|
886
1714
|
ZohoRecruitApi = __decorate([
|
|
887
1715
|
Injectable(),
|
|
888
1716
|
__param(0, Inject(ZohoRecruitServiceConfig)),
|
|
889
1717
|
__param(1, Inject(ZohoAccountsApi))
|
|
890
1718
|
], ZohoRecruitApi);
|
|
891
1719
|
|
|
1720
|
+
function _array_like_to_array$1(arr, len) {
|
|
1721
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1722
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1723
|
+
return arr2;
|
|
1724
|
+
}
|
|
1725
|
+
function _array_without_holes$1(arr) {
|
|
1726
|
+
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
|
|
1727
|
+
}
|
|
1728
|
+
function _iterable_to_array$1(iter) {
|
|
1729
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1730
|
+
}
|
|
1731
|
+
function _non_iterable_spread$1() {
|
|
1732
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1733
|
+
}
|
|
1734
|
+
function _to_consumable_array$1(arr) {
|
|
1735
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
|
|
1736
|
+
}
|
|
1737
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
1738
|
+
if (!o) return;
|
|
1739
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
1740
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1741
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1742
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1743
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
1744
|
+
}
|
|
892
1745
|
// MARK: Provider Factories
|
|
893
1746
|
/**
|
|
894
1747
|
* Reads Zoho Recruit connection settings from the NestJS ConfigService
|
|
@@ -909,10 +1762,9 @@ ZohoRecruitApi = __decorate([
|
|
|
909
1762
|
* useFactory: zohoRecruitServiceConfigFactory
|
|
910
1763
|
* }
|
|
911
1764
|
* ```
|
|
912
|
-
*/
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
const config = {
|
|
1765
|
+
*/ function zohoRecruitServiceConfigFactory(configService) {
|
|
1766
|
+
var getFromConfigService = zohoConfigServiceReaderFunction(ZOHO_RECRUIT_SERVICE_NAME, configService);
|
|
1767
|
+
var config = {
|
|
916
1768
|
zohoRecruit: {
|
|
917
1769
|
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
918
1770
|
}
|
|
@@ -935,10 +1787,9 @@ function zohoRecruitServiceConfigFactory(configService) {
|
|
|
935
1787
|
* useFactory: zohoRecruitAccountServiceConfigFactory
|
|
936
1788
|
* }
|
|
937
1789
|
* ```
|
|
938
|
-
*/
|
|
939
|
-
function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
1790
|
+
*/ function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
940
1791
|
return zohoAccountsServiceConfigFromConfigService({
|
|
941
|
-
configService,
|
|
1792
|
+
configService: configService,
|
|
942
1793
|
serviceAccessTokenKey: ZOHO_RECRUIT_SERVICE_NAME
|
|
943
1794
|
});
|
|
944
1795
|
}
|
|
@@ -977,136 +1828,299 @@ function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
|
977
1828
|
* @Module(appZohoRecruitModuleMetadata({ dependencyModule: ZohoRecruitDependencyModule }))
|
|
978
1829
|
* export class AppZohoRecruitModule {}
|
|
979
1830
|
* ```
|
|
980
|
-
*/
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1831
|
+
*/ function appZohoRecruitModuleMetadata(config) {
|
|
1832
|
+
var dependencyModule = config.dependencyModule, imports = config.imports, exports$1 = config.exports, providers = config.providers;
|
|
1833
|
+
var dependencyModuleImport = dependencyModule ? [
|
|
1834
|
+
dependencyModule
|
|
1835
|
+
] : [];
|
|
984
1836
|
return {
|
|
985
|
-
imports: [
|
|
986
|
-
|
|
1837
|
+
imports: [
|
|
1838
|
+
ConfigModule
|
|
1839
|
+
].concat(_to_consumable_array$1(dependencyModuleImport), _to_consumable_array$1(imports !== null && imports !== void 0 ? imports : [])),
|
|
1840
|
+
exports: [
|
|
1841
|
+
ZohoRecruitApi
|
|
1842
|
+
].concat(_to_consumable_array$1(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
987
1843
|
providers: [
|
|
988
1844
|
{
|
|
989
1845
|
provide: ZohoRecruitServiceConfig,
|
|
990
|
-
inject: [
|
|
1846
|
+
inject: [
|
|
1847
|
+
ConfigService
|
|
1848
|
+
],
|
|
991
1849
|
useFactory: zohoRecruitServiceConfigFactory
|
|
992
1850
|
},
|
|
993
1851
|
ZohoRecruitApi,
|
|
994
1852
|
// Accounts
|
|
995
1853
|
{
|
|
996
1854
|
provide: ZohoAccountsServiceConfig,
|
|
997
|
-
inject: [
|
|
1855
|
+
inject: [
|
|
1856
|
+
ConfigService
|
|
1857
|
+
],
|
|
998
1858
|
useFactory: zohoRecruitAccountServiceConfigFactory
|
|
999
1859
|
},
|
|
1000
|
-
ZohoAccountsApi
|
|
1001
|
-
|
|
1002
|
-
]
|
|
1860
|
+
ZohoAccountsApi
|
|
1861
|
+
].concat(_to_consumable_array$1(providers !== null && providers !== void 0 ? providers : []))
|
|
1003
1862
|
};
|
|
1004
1863
|
}
|
|
1005
1864
|
|
|
1865
|
+
function _class_call_check$1(instance, Constructor) {
|
|
1866
|
+
if (!(instance instanceof Constructor)) {
|
|
1867
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
function _defineProperties$1(target, props) {
|
|
1871
|
+
for(var i = 0; i < props.length; i++){
|
|
1872
|
+
var descriptor = props[i];
|
|
1873
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1874
|
+
descriptor.configurable = true;
|
|
1875
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
1876
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
1880
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
1881
|
+
return Constructor;
|
|
1882
|
+
}
|
|
1883
|
+
function _define_property$1(obj, key, value) {
|
|
1884
|
+
if (key in obj) {
|
|
1885
|
+
Object.defineProperty(obj, key, {
|
|
1886
|
+
value: value,
|
|
1887
|
+
enumerable: true,
|
|
1888
|
+
configurable: true,
|
|
1889
|
+
writable: true
|
|
1890
|
+
});
|
|
1891
|
+
} else {
|
|
1892
|
+
obj[key] = value;
|
|
1893
|
+
}
|
|
1894
|
+
return obj;
|
|
1895
|
+
}
|
|
1006
1896
|
/**
|
|
1007
1897
|
* Configuration for ZohoSignService
|
|
1008
|
-
*/
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1898
|
+
*/ var ZohoSignServiceConfig = /*#__PURE__*/ function() {
|
|
1899
|
+
function ZohoSignServiceConfig() {
|
|
1900
|
+
_class_call_check$1(this, ZohoSignServiceConfig);
|
|
1901
|
+
_define_property$1(this, "zohoSign", void 0);
|
|
1902
|
+
_define_property$1(this, "factoryConfig", void 0);
|
|
1903
|
+
}
|
|
1904
|
+
_create_class$1(ZohoSignServiceConfig, null, [
|
|
1905
|
+
{
|
|
1906
|
+
key: "assertValidConfig",
|
|
1907
|
+
value: function assertValidConfig(config) {
|
|
1908
|
+
assertValidZohoConfig(config.zohoSign);
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
]);
|
|
1912
|
+
return ZohoSignServiceConfig;
|
|
1913
|
+
}
|
|
1914
|
+
();
|
|
1915
|
+
|
|
1916
|
+
function _class_call_check(instance, Constructor) {
|
|
1917
|
+
if (!(instance instanceof Constructor)) {
|
|
1918
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1014
1919
|
}
|
|
1015
1920
|
}
|
|
1016
|
-
|
|
1921
|
+
function _defineProperties(target, props) {
|
|
1922
|
+
for(var i = 0; i < props.length; i++){
|
|
1923
|
+
var descriptor = props[i];
|
|
1924
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
1925
|
+
descriptor.configurable = true;
|
|
1926
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
1927
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
1931
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
1932
|
+
return Constructor;
|
|
1933
|
+
}
|
|
1934
|
+
function _define_property(obj, key, value) {
|
|
1935
|
+
if (key in obj) {
|
|
1936
|
+
Object.defineProperty(obj, key, {
|
|
1937
|
+
value: value,
|
|
1938
|
+
enumerable: true,
|
|
1939
|
+
configurable: true,
|
|
1940
|
+
writable: true
|
|
1941
|
+
});
|
|
1942
|
+
} else {
|
|
1943
|
+
obj[key] = value;
|
|
1944
|
+
}
|
|
1945
|
+
return obj;
|
|
1946
|
+
}
|
|
1947
|
+
function _object_spread(target) {
|
|
1948
|
+
for(var i = 1; i < arguments.length; i++){
|
|
1949
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1950
|
+
var ownKeys = Object.keys(source);
|
|
1951
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1952
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1953
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1954
|
+
}));
|
|
1955
|
+
}
|
|
1956
|
+
ownKeys.forEach(function(key) {
|
|
1957
|
+
_define_property(target, key, source[key]);
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
return target;
|
|
1961
|
+
}
|
|
1962
|
+
function ownKeys(object, enumerableOnly) {
|
|
1963
|
+
var keys = Object.keys(object);
|
|
1964
|
+
if (Object.getOwnPropertySymbols) {
|
|
1965
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1966
|
+
keys.push.apply(keys, symbols);
|
|
1967
|
+
}
|
|
1968
|
+
return keys;
|
|
1969
|
+
}
|
|
1970
|
+
function _object_spread_props(target, source) {
|
|
1971
|
+
source = source != null ? source : {};
|
|
1972
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
1973
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1974
|
+
} else {
|
|
1975
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
1976
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1979
|
+
return target;
|
|
1980
|
+
}
|
|
1017
1981
|
/**
|
|
1018
1982
|
* NestJS injectable service that wraps the Zoho Sign API.
|
|
1019
1983
|
*
|
|
1020
1984
|
* Provides convenient accessor getters for all Sign operations, each bound
|
|
1021
1985
|
* to the authenticated Sign context created during construction.
|
|
1022
|
-
*/
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1986
|
+
*/ var ZohoSignApi = /*#__PURE__*/ function() {
|
|
1987
|
+
function ZohoSignApi(config, zohoAccountsApi) {
|
|
1988
|
+
_class_call_check(this, ZohoSignApi);
|
|
1989
|
+
_define_property(this, "config", void 0);
|
|
1990
|
+
_define_property(this, "zohoAccountsApi", void 0);
|
|
1991
|
+
/**
|
|
1027
1992
|
* Underlying Zoho Sign client instance, initialized from the injected config and accounts context.
|
|
1028
|
-
*/
|
|
1029
|
-
zohoSign;
|
|
1030
|
-
/**
|
|
1031
|
-
* The authenticated Sign context used by all operation accessors.
|
|
1032
|
-
*/
|
|
1033
|
-
get signContext() {
|
|
1034
|
-
return this.zohoSign.signContext;
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Rate limiter shared across all Sign requests to respect Zoho API quotas.
|
|
1038
|
-
*/
|
|
1039
|
-
get zohoRateLimiter() {
|
|
1040
|
-
return this.zohoSign.signContext.zohoRateLimiter;
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
* Initializes the Sign client by combining the service config with the
|
|
1044
|
-
* accounts context for OAuth token management.
|
|
1045
|
-
*/
|
|
1046
|
-
constructor(config, zohoAccountsApi) {
|
|
1993
|
+
*/ _define_property(this, "zohoSign", void 0);
|
|
1047
1994
|
this.config = config;
|
|
1048
1995
|
this.zohoAccountsApi = zohoAccountsApi;
|
|
1049
|
-
this.zohoSign = zohoSignFactory({
|
|
1050
|
-
...config.factoryConfig,
|
|
1996
|
+
this.zohoSign = zohoSignFactory(_object_spread_props(_object_spread({}, config.factoryConfig), {
|
|
1051
1997
|
accountsContext: zohoAccountsApi.accountsContext
|
|
1052
|
-
})(config.zohoSign);
|
|
1053
|
-
}
|
|
1054
|
-
// MARK: Accessors
|
|
1055
|
-
/** Configured pass-through for {@link zohoSignGetDocument}. */
|
|
1056
|
-
get getDocument() {
|
|
1057
|
-
return zohoSignGetDocument(this.signContext);
|
|
1058
|
-
}
|
|
1059
|
-
/** Configured pass-through for {@link zohoSignGetDocuments}. */
|
|
1060
|
-
get getDocuments() {
|
|
1061
|
-
return zohoSignGetDocuments(this.signContext);
|
|
1062
|
-
}
|
|
1063
|
-
/** Configured pass-through for {@link zohoSignGetDocumentsPageFactory}. */
|
|
1064
|
-
get getDocumentsPageFactory() {
|
|
1065
|
-
return zohoSignGetDocumentsPageFactory(this.signContext);
|
|
1066
|
-
}
|
|
1067
|
-
/** Configured pass-through for {@link zohoSignGetDocumentFormData}. */
|
|
1068
|
-
get getDocumentFormData() {
|
|
1069
|
-
return zohoSignGetDocumentFormData(this.signContext);
|
|
1070
|
-
}
|
|
1071
|
-
/** Configured pass-through for {@link zohoSignRetrieveFieldTypes}. */
|
|
1072
|
-
get retrieveFieldTypes() {
|
|
1073
|
-
return zohoSignRetrieveFieldTypes(this.signContext);
|
|
1074
|
-
}
|
|
1075
|
-
/** Configured pass-through for {@link zohoSignDownloadPdf}. */
|
|
1076
|
-
get downloadPdf() {
|
|
1077
|
-
return zohoSignDownloadPdf(this.signContext);
|
|
1078
|
-
}
|
|
1079
|
-
/** Configured pass-through for {@link zohoSignDownloadCompletionCertificate}. */
|
|
1080
|
-
get downloadCompletionCertificate() {
|
|
1081
|
-
return zohoSignDownloadCompletionCertificate(this.signContext);
|
|
1082
|
-
}
|
|
1083
|
-
/** Configured pass-through for {@link zohoSignCreateDocument}. */
|
|
1084
|
-
get createDocument() {
|
|
1085
|
-
return zohoSignCreateDocument(this.signContext);
|
|
1086
|
-
}
|
|
1087
|
-
/** Configured pass-through for {@link zohoSignUpdateDocument}. */
|
|
1088
|
-
get updateDocument() {
|
|
1089
|
-
return zohoSignUpdateDocument(this.signContext);
|
|
1090
|
-
}
|
|
1091
|
-
/** Configured pass-through for {@link zohoSignSendDocumentForSignature}. */
|
|
1092
|
-
get sendDocumentForSignature() {
|
|
1093
|
-
return zohoSignSendDocumentForSignature(this.signContext);
|
|
1094
|
-
}
|
|
1095
|
-
/** Configured pass-through for {@link zohoSignExtendDocument}. */
|
|
1096
|
-
get extendDocument() {
|
|
1097
|
-
return zohoSignExtendDocument(this.signContext);
|
|
1098
|
-
}
|
|
1099
|
-
/** Configured pass-through for {@link zohoSignDeleteDocument}. */
|
|
1100
|
-
get deleteDocument() {
|
|
1101
|
-
return zohoSignDeleteDocument(this.signContext);
|
|
1998
|
+
}))(config.zohoSign);
|
|
1102
1999
|
}
|
|
1103
|
-
|
|
2000
|
+
_create_class(ZohoSignApi, [
|
|
2001
|
+
{
|
|
2002
|
+
key: "signContext",
|
|
2003
|
+
get: /**
|
|
2004
|
+
* The authenticated Sign context used by all operation accessors.
|
|
2005
|
+
*/ function get() {
|
|
2006
|
+
return this.zohoSign.signContext;
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
key: "zohoRateLimiter",
|
|
2011
|
+
get: /**
|
|
2012
|
+
* Rate limiter shared across all Sign requests to respect Zoho API quotas.
|
|
2013
|
+
*/ function get() {
|
|
2014
|
+
return this.zohoSign.signContext.zohoRateLimiter;
|
|
2015
|
+
}
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
key: "getDocument",
|
|
2019
|
+
get: // MARK: Accessors
|
|
2020
|
+
/** Configured pass-through for {@link zohoSignGetDocument}. */ function get() {
|
|
2021
|
+
return zohoSignGetDocument(this.signContext);
|
|
2022
|
+
}
|
|
2023
|
+
},
|
|
2024
|
+
{
|
|
2025
|
+
key: "getDocuments",
|
|
2026
|
+
get: /** Configured pass-through for {@link zohoSignGetDocuments}. */ function get() {
|
|
2027
|
+
return zohoSignGetDocuments(this.signContext);
|
|
2028
|
+
}
|
|
2029
|
+
},
|
|
2030
|
+
{
|
|
2031
|
+
key: "getDocumentsPageFactory",
|
|
2032
|
+
get: /** Configured pass-through for {@link zohoSignGetDocumentsPageFactory}. */ function get() {
|
|
2033
|
+
return zohoSignGetDocumentsPageFactory(this.signContext);
|
|
2034
|
+
}
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
key: "getDocumentFormData",
|
|
2038
|
+
get: /** Configured pass-through for {@link zohoSignGetDocumentFormData}. */ function get() {
|
|
2039
|
+
return zohoSignGetDocumentFormData(this.signContext);
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
key: "retrieveFieldTypes",
|
|
2044
|
+
get: /** Configured pass-through for {@link zohoSignRetrieveFieldTypes}. */ function get() {
|
|
2045
|
+
return zohoSignRetrieveFieldTypes(this.signContext);
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
{
|
|
2049
|
+
key: "downloadPdf",
|
|
2050
|
+
get: /** Configured pass-through for {@link zohoSignDownloadPdf}. */ function get() {
|
|
2051
|
+
return zohoSignDownloadPdf(this.signContext);
|
|
2052
|
+
}
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
key: "downloadCompletionCertificate",
|
|
2056
|
+
get: /** Configured pass-through for {@link zohoSignDownloadCompletionCertificate}. */ function get() {
|
|
2057
|
+
return zohoSignDownloadCompletionCertificate(this.signContext);
|
|
2058
|
+
}
|
|
2059
|
+
},
|
|
2060
|
+
{
|
|
2061
|
+
key: "createDocument",
|
|
2062
|
+
get: /** Configured pass-through for {@link zohoSignCreateDocument}. */ function get() {
|
|
2063
|
+
return zohoSignCreateDocument(this.signContext);
|
|
2064
|
+
}
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
key: "updateDocument",
|
|
2068
|
+
get: /** Configured pass-through for {@link zohoSignUpdateDocument}. */ function get() {
|
|
2069
|
+
return zohoSignUpdateDocument(this.signContext);
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
key: "sendDocumentForSignature",
|
|
2074
|
+
get: /** Configured pass-through for {@link zohoSignSendDocumentForSignature}. */ function get() {
|
|
2075
|
+
return zohoSignSendDocumentForSignature(this.signContext);
|
|
2076
|
+
}
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
key: "extendDocument",
|
|
2080
|
+
get: /** Configured pass-through for {@link zohoSignExtendDocument}. */ function get() {
|
|
2081
|
+
return zohoSignExtendDocument(this.signContext);
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
key: "deleteDocument",
|
|
2086
|
+
get: /** Configured pass-through for {@link zohoSignDeleteDocument}. */ function get() {
|
|
2087
|
+
return zohoSignDeleteDocument(this.signContext);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
]);
|
|
2091
|
+
return ZohoSignApi;
|
|
2092
|
+
}();
|
|
1104
2093
|
ZohoSignApi = __decorate([
|
|
1105
2094
|
Injectable(),
|
|
1106
2095
|
__param(0, Inject(ZohoSignServiceConfig)),
|
|
1107
2096
|
__param(1, Inject(ZohoAccountsApi))
|
|
1108
2097
|
], ZohoSignApi);
|
|
1109
2098
|
|
|
2099
|
+
function _array_like_to_array(arr, len) {
|
|
2100
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
2101
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2102
|
+
return arr2;
|
|
2103
|
+
}
|
|
2104
|
+
function _array_without_holes(arr) {
|
|
2105
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
2106
|
+
}
|
|
2107
|
+
function _iterable_to_array(iter) {
|
|
2108
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2109
|
+
}
|
|
2110
|
+
function _non_iterable_spread() {
|
|
2111
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2112
|
+
}
|
|
2113
|
+
function _to_consumable_array(arr) {
|
|
2114
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
2115
|
+
}
|
|
2116
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
2117
|
+
if (!o) return;
|
|
2118
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
2119
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2120
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2121
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2122
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
2123
|
+
}
|
|
1110
2124
|
// MARK: Provider Factories
|
|
1111
2125
|
/**
|
|
1112
2126
|
* Reads Zoho Sign connection settings from the NestJS ConfigService
|
|
@@ -1128,10 +2142,9 @@ ZohoSignApi = __decorate([
|
|
|
1128
2142
|
* useFactory: zohoSignServiceConfigFactory
|
|
1129
2143
|
* }
|
|
1130
2144
|
* ```
|
|
1131
|
-
*/
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
const config = {
|
|
2145
|
+
*/ function zohoSignServiceConfigFactory(configService) {
|
|
2146
|
+
var getFromConfigService = zohoConfigServiceReaderFunction(ZOHO_SIGN_SERVICE_NAME, configService);
|
|
2147
|
+
var config = {
|
|
1135
2148
|
zohoSign: {
|
|
1136
2149
|
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
1137
2150
|
}
|
|
@@ -1154,10 +2167,9 @@ function zohoSignServiceConfigFactory(configService) {
|
|
|
1154
2167
|
* useFactory: zohoSignAccountServiceConfigFactory
|
|
1155
2168
|
* }
|
|
1156
2169
|
* ```
|
|
1157
|
-
*/
|
|
1158
|
-
function zohoSignAccountServiceConfigFactory(configService) {
|
|
2170
|
+
*/ function zohoSignAccountServiceConfigFactory(configService) {
|
|
1159
2171
|
return zohoAccountsServiceConfigFromConfigService({
|
|
1160
|
-
configService,
|
|
2172
|
+
configService: configService,
|
|
1161
2173
|
serviceAccessTokenKey: ZOHO_SIGN_SERVICE_NAME
|
|
1162
2174
|
});
|
|
1163
2175
|
}
|
|
@@ -1196,29 +2208,37 @@ function zohoSignAccountServiceConfigFactory(configService) {
|
|
|
1196
2208
|
* @Module(appZohoSignModuleMetadata({ dependencyModule: ZohoSignDependencyModule }))
|
|
1197
2209
|
* export class AppZohoSignModule {}
|
|
1198
2210
|
* ```
|
|
1199
|
-
*/
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
2211
|
+
*/ function appZohoSignModuleMetadata(config) {
|
|
2212
|
+
var dependencyModule = config.dependencyModule, imports = config.imports, exports$1 = config.exports, providers = config.providers;
|
|
2213
|
+
var dependencyModuleImport = dependencyModule ? [
|
|
2214
|
+
dependencyModule
|
|
2215
|
+
] : [];
|
|
1203
2216
|
return {
|
|
1204
|
-
imports: [
|
|
1205
|
-
|
|
2217
|
+
imports: [
|
|
2218
|
+
ConfigModule
|
|
2219
|
+
].concat(_to_consumable_array(dependencyModuleImport), _to_consumable_array(imports !== null && imports !== void 0 ? imports : [])),
|
|
2220
|
+
exports: [
|
|
2221
|
+
ZohoSignApi
|
|
2222
|
+
].concat(_to_consumable_array(exports$1 !== null && exports$1 !== void 0 ? exports$1 : [])),
|
|
1206
2223
|
providers: [
|
|
1207
2224
|
{
|
|
1208
2225
|
provide: ZohoSignServiceConfig,
|
|
1209
|
-
inject: [
|
|
2226
|
+
inject: [
|
|
2227
|
+
ConfigService
|
|
2228
|
+
],
|
|
1210
2229
|
useFactory: zohoSignServiceConfigFactory
|
|
1211
2230
|
},
|
|
1212
2231
|
ZohoSignApi,
|
|
1213
2232
|
// Accounts
|
|
1214
2233
|
{
|
|
1215
2234
|
provide: ZohoAccountsServiceConfig,
|
|
1216
|
-
inject: [
|
|
2235
|
+
inject: [
|
|
2236
|
+
ConfigService
|
|
2237
|
+
],
|
|
1217
2238
|
useFactory: zohoSignAccountServiceConfigFactory
|
|
1218
2239
|
},
|
|
1219
|
-
ZohoAccountsApi
|
|
1220
|
-
|
|
1221
|
-
]
|
|
2240
|
+
ZohoAccountsApi
|
|
2241
|
+
].concat(_to_consumable_array(providers !== null && providers !== void 0 ? providers : []))
|
|
1222
2242
|
};
|
|
1223
2243
|
}
|
|
1224
2244
|
|