@dereekb/zoho 13.32.0 → 13.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.js +5 -5
- package/cli/package.json +7 -7
- package/index.cjs.js +365 -43
- package/index.esm.js +341 -43
- package/nestjs/index.cjs.js +350 -36
- package/nestjs/index.esm.js +346 -38
- package/nestjs/package.json +5 -5
- package/nestjs/src/lib/accounts/accounts.oauth.api.d.ts +107 -0
- package/nestjs/src/lib/accounts/accounts.oauth.config.d.ts +45 -0
- package/nestjs/src/lib/accounts/accounts.oauth.module.d.ts +22 -0
- package/nestjs/src/lib/accounts/index.d.ts +3 -0
- package/package.json +8 -8
- package/src/lib/accounts/accounts.api.d.ts +112 -2
- package/src/lib/accounts/accounts.authorize.d.ts +119 -0
- package/src/lib/accounts/accounts.config.d.ts +65 -2
- package/src/lib/accounts/accounts.factory.d.ts +69 -0
- package/src/lib/accounts/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -9405,6 +9405,185 @@ function joinAgentInclude(include) {
|
|
|
9405
9405
|
return zohoDeskFetchPageFactory(zohoDeskGetAgents(context));
|
|
9406
9406
|
}
|
|
9407
9407
|
|
|
9408
|
+
/**
|
|
9409
|
+
* The Zoho Accounts API URL for the US datacenter.
|
|
9410
|
+
*/ var ZOHO_ACCOUNTS_US_API_URL = 'https://accounts.zoho.com';
|
|
9411
|
+
/**
|
|
9412
|
+
* The Zoho Accounts API URL for the EU datacenter.
|
|
9413
|
+
*/ var ZOHO_ACCOUNTS_EU_API_URL = 'https://accounts.zoho.eu';
|
|
9414
|
+
/**
|
|
9415
|
+
* The Zoho Accounts API URL for the India datacenter.
|
|
9416
|
+
*/ var ZOHO_ACCOUNTS_IN_API_URL = 'https://accounts.zoho.in';
|
|
9417
|
+
/**
|
|
9418
|
+
* The Zoho Accounts API URL for the Australia datacenter.
|
|
9419
|
+
*/ var ZOHO_ACCOUNTS_AU_API_URL = 'https://accounts.zoho.com.au';
|
|
9420
|
+
/**
|
|
9421
|
+
* The Zoho Accounts API URL for the Japan datacenter.
|
|
9422
|
+
*/ var ZOHO_ACCOUNTS_JP_API_URL = 'https://accounts.zoho.jp';
|
|
9423
|
+
/**
|
|
9424
|
+
* The Zoho Accounts API URL for the United Kingdom datacenter.
|
|
9425
|
+
*/ var ZOHO_ACCOUNTS_UK_API_URL = 'https://accounts.zoho.uk';
|
|
9426
|
+
/**
|
|
9427
|
+
* The Zoho Accounts API URL for the Canada datacenter.
|
|
9428
|
+
*/ var ZOHO_ACCOUNTS_CA_API_URL = 'https://accounts.zohocloud.ca';
|
|
9429
|
+
/**
|
|
9430
|
+
* The Zoho Accounts API URL for the Saudi Arabia datacenter.
|
|
9431
|
+
*/ var ZOHO_ACCOUNTS_SA_API_URL = 'https://accounts.zoho.sa';
|
|
9432
|
+
/**
|
|
9433
|
+
* Every Zoho Accounts host this package will talk to, keyed by datacenter.
|
|
9434
|
+
*
|
|
9435
|
+
* A closed set rather than an open string, because a value echoed back on an OAuth callback
|
|
9436
|
+
* (`accounts-server`) is checked against it before being used as a token-exchange target — an
|
|
9437
|
+
* unchecked host there would receive the client secret.
|
|
9438
|
+
*/ var ZOHO_ACCOUNTS_API_URLS = {
|
|
9439
|
+
us: ZOHO_ACCOUNTS_US_API_URL,
|
|
9440
|
+
eu: ZOHO_ACCOUNTS_EU_API_URL,
|
|
9441
|
+
in: ZOHO_ACCOUNTS_IN_API_URL,
|
|
9442
|
+
au: ZOHO_ACCOUNTS_AU_API_URL,
|
|
9443
|
+
jp: ZOHO_ACCOUNTS_JP_API_URL,
|
|
9444
|
+
uk: ZOHO_ACCOUNTS_UK_API_URL,
|
|
9445
|
+
ca: ZOHO_ACCOUNTS_CA_API_URL,
|
|
9446
|
+
sa: ZOHO_ACCOUNTS_SA_API_URL
|
|
9447
|
+
};
|
|
9448
|
+
/**
|
|
9449
|
+
* Resolves a Zoho Accounts API URL input to the full base URL. A datacenter key maps to that
|
|
9450
|
+
* datacenter's host; custom URLs pass through unchanged.
|
|
9451
|
+
*
|
|
9452
|
+
* @param input - A well-known datacenter key or a custom Zoho Accounts API URL.
|
|
9453
|
+
* @returns The resolved full Zoho Accounts API base URL.
|
|
9454
|
+
*/ function zohoAccountsConfigApiUrl(input) {
|
|
9455
|
+
var _ZOHO_ACCOUNTS_API_URLS_input;
|
|
9456
|
+
return (_ZOHO_ACCOUNTS_API_URLS_input = ZOHO_ACCOUNTS_API_URLS[input]) !== null && _ZOHO_ACCOUNTS_API_URLS_input !== void 0 ? _ZOHO_ACCOUNTS_API_URLS_input : input;
|
|
9457
|
+
}
|
|
9458
|
+
/**
|
|
9459
|
+
* Returns whether the input is one of the known Zoho Accounts hosts.
|
|
9460
|
+
*
|
|
9461
|
+
* Exists to gate a value that arrives from OUTSIDE the process: Zoho echoes the issuing datacenter
|
|
9462
|
+
* back as the `accounts-server` OAuth callback parameter, and that host becomes the POST target the
|
|
9463
|
+
* client secret is sent to. An attacker can compose that redirect, so only an exact match against
|
|
9464
|
+
* {@link ZOHO_ACCOUNTS_API_URLS} may be honored.
|
|
9465
|
+
*
|
|
9466
|
+
* @param url - The candidate accounts host.
|
|
9467
|
+
* @returns True when the value is exactly one of the known Zoho Accounts hosts.
|
|
9468
|
+
*
|
|
9469
|
+
* @__NO_SIDE_EFFECTS__
|
|
9470
|
+
*/ function isKnownZohoAccountsApiUrl(url) {
|
|
9471
|
+
return url != null && zohoAccountsApiUrlKeyForApiUrl(url) != null;
|
|
9472
|
+
}
|
|
9473
|
+
/**
|
|
9474
|
+
* Returns the datacenter key for a known Zoho Accounts host.
|
|
9475
|
+
*
|
|
9476
|
+
* A trailing slash is tolerated, since Zoho's `accounts-server` value is URL-encoded and some
|
|
9477
|
+
* datacenters echo it back with one; nothing else about the value is normalized.
|
|
9478
|
+
*
|
|
9479
|
+
* @param url - The candidate accounts host.
|
|
9480
|
+
* @returns The matching datacenter key, or undefined when the host is not a known one.
|
|
9481
|
+
*
|
|
9482
|
+
* @__NO_SIDE_EFFECTS__
|
|
9483
|
+
*/ function zohoAccountsApiUrlKeyForApiUrl(url) {
|
|
9484
|
+
var result;
|
|
9485
|
+
if (url != null) {
|
|
9486
|
+
var normalized = url.replace(/\/+$/, '');
|
|
9487
|
+
result = Object.keys(ZOHO_ACCOUNTS_API_URLS).find(function(key) {
|
|
9488
|
+
return ZOHO_ACCOUNTS_API_URLS[key] === normalized;
|
|
9489
|
+
});
|
|
9490
|
+
}
|
|
9491
|
+
return result;
|
|
9492
|
+
}
|
|
9493
|
+
|
|
9494
|
+
/**
|
|
9495
|
+
* Path of the Zoho Accounts authorization (consent screen) endpoint.
|
|
9496
|
+
*/ var ZOHO_ACCOUNTS_AUTHORIZE_PATH = '/oauth/v2/auth';
|
|
9497
|
+
/**
|
|
9498
|
+
* Path of the Zoho Accounts token endpoint.
|
|
9499
|
+
*/ var ZOHO_ACCOUNTS_TOKEN_PATH = '/oauth/v2/token';
|
|
9500
|
+
/**
|
|
9501
|
+
* The delimiter Zoho joins and returns granted scopes with.
|
|
9502
|
+
*
|
|
9503
|
+
* A comma, NOT the space OAuth 2.0 specifies. Both halves of the round trip use this: the authorize
|
|
9504
|
+
* request joins on it, and the granted `scope` string comes back split on it.
|
|
9505
|
+
*/ var ZOHO_OAUTH_SCOPE_DELIMITER = ',';
|
|
9506
|
+
/**
|
|
9507
|
+
* The `response_type` used by the authorization-code flow.
|
|
9508
|
+
*/ var ZOHO_OAUTH_AUTHORIZE_RESPONSE_TYPE = 'code';
|
|
9509
|
+
/**
|
|
9510
|
+
* Required for Zoho to return a `refresh_token` at all.
|
|
9511
|
+
*/ var ZOHO_OAUTH_OFFLINE_ACCESS_TYPE = 'offline';
|
|
9512
|
+
/**
|
|
9513
|
+
* Forces the consent screen.
|
|
9514
|
+
*
|
|
9515
|
+
* Without it Zoho returns a refresh token only on a user's FIRST authorization, so a reconnect would
|
|
9516
|
+
* come back with an access token alone — and a persisted exchange that omits the refresh token
|
|
9517
|
+
* silently breaks the connection.
|
|
9518
|
+
*/ var ZOHO_OAUTH_CONSENT_PROMPT = 'consent';
|
|
9519
|
+
/**
|
|
9520
|
+
* Creates a {@link ZohoAccountsAuthorizeUrlFactory} that composes the Zoho authorize URL a user's
|
|
9521
|
+
* browser is redirected to in order to begin the authorization-code flow.
|
|
9522
|
+
*
|
|
9523
|
+
* The client id, redirect URI, and scopes are fixed by the config, since a consumer holds those
|
|
9524
|
+
* constant and varies only the per-request `state`.
|
|
9525
|
+
*
|
|
9526
|
+
* @param config - The client id, redirect URI, scopes, and optional datacenter/consent overrides.
|
|
9527
|
+
* @returns A factory that builds an authorize URL for the given params.
|
|
9528
|
+
* @throws {Error} When no client id is given, or when no scopes are requested — Zoho refuses an
|
|
9529
|
+
* authorize request carrying no scope, and failing at construction beats failing at the consent
|
|
9530
|
+
* screen.
|
|
9531
|
+
*
|
|
9532
|
+
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/authorization.html
|
|
9533
|
+
*
|
|
9534
|
+
* @example
|
|
9535
|
+
* ```typescript
|
|
9536
|
+
* const authorizeUrlFactory = zohoAccountsAuthorizeUrlFactory({
|
|
9537
|
+
* clientId: 'client-id',
|
|
9538
|
+
* redirectUri: 'http://localhost:9901/oauth/zoho/callback',
|
|
9539
|
+
* scopes: ['AaaServer.profile.READ']
|
|
9540
|
+
* });
|
|
9541
|
+
*
|
|
9542
|
+
* const url = authorizeUrlFactory({ state: 'signed-state' });
|
|
9543
|
+
* ```
|
|
9544
|
+
*
|
|
9545
|
+
* @__NO_SIDE_EFFECTS__
|
|
9546
|
+
*/ function zohoAccountsAuthorizeUrlFactory(config) {
|
|
9547
|
+
var clientId = config.clientId, redirectUri = config.redirectUri, scopes = config.scopes, accountsApiUrl = config.accountsApiUrl, accessType = config.accessType, prompt = config.prompt;
|
|
9548
|
+
if (!clientId) {
|
|
9549
|
+
throw new Error('zohoAccountsAuthorizeUrlFactory() requires a clientId.');
|
|
9550
|
+
}
|
|
9551
|
+
if (!scopes.length) {
|
|
9552
|
+
throw new Error('zohoAccountsAuthorizeUrlFactory() requires at least one scope. Zoho refuses an authorize request that carries no scope.');
|
|
9553
|
+
}
|
|
9554
|
+
var apiUrl = zohoAccountsConfigApiUrl(accountsApiUrl !== null && accountsApiUrl !== void 0 ? accountsApiUrl : 'us');
|
|
9555
|
+
var scope = scopes.join(ZOHO_OAUTH_SCOPE_DELIMITER);
|
|
9556
|
+
var authorizeAccessType = accessType !== null && accessType !== void 0 ? accessType : ZOHO_OAUTH_OFFLINE_ACCESS_TYPE;
|
|
9557
|
+
var authorizePrompt = prompt !== null && prompt !== void 0 ? prompt : ZOHO_OAUTH_CONSENT_PROMPT;
|
|
9558
|
+
return function(params) {
|
|
9559
|
+
var url = new URL(ZOHO_ACCOUNTS_AUTHORIZE_PATH, apiUrl);
|
|
9560
|
+
var state = params === null || params === void 0 ? void 0 : params.state;
|
|
9561
|
+
url.searchParams.set('client_id', clientId);
|
|
9562
|
+
url.searchParams.set('redirect_uri', redirectUri);
|
|
9563
|
+
url.searchParams.set('response_type', ZOHO_OAUTH_AUTHORIZE_RESPONSE_TYPE);
|
|
9564
|
+
url.searchParams.set('scope', scope);
|
|
9565
|
+
url.searchParams.set('access_type', authorizeAccessType);
|
|
9566
|
+
url.searchParams.set('prompt', authorizePrompt);
|
|
9567
|
+
if (state != null) {
|
|
9568
|
+
url.searchParams.set('state', state);
|
|
9569
|
+
}
|
|
9570
|
+
return url.toString();
|
|
9571
|
+
};
|
|
9572
|
+
}
|
|
9573
|
+
/**
|
|
9574
|
+
* Splits a granted Zoho `scope` string on the same delimiter the authorize request joins with.
|
|
9575
|
+
*
|
|
9576
|
+
* @param scope - The granted scope string returned on a token response.
|
|
9577
|
+
* @returns The granted scopes, or undefined when none were granted.
|
|
9578
|
+
*
|
|
9579
|
+
* @__NO_SIDE_EFFECTS__
|
|
9580
|
+
*/ function zohoOAuthScopesFromScopeString(scope) {
|
|
9581
|
+
var scopes = scope ? scope.split(ZOHO_OAUTH_SCOPE_DELIMITER).filter(function(x) {
|
|
9582
|
+
return x.length > 0;
|
|
9583
|
+
}) : undefined;
|
|
9584
|
+
return (scopes === null || scopes === void 0 ? void 0 : scopes.length) ? scopes : undefined;
|
|
9585
|
+
}
|
|
9586
|
+
|
|
9408
9587
|
/**
|
|
9409
9588
|
* Creates a function that exchanges a refresh token for a new short-lived access token
|
|
9410
9589
|
* via the Zoho OAuth `/oauth/v2/token` endpoint.
|
|
@@ -9444,7 +9623,47 @@ function joinAgentInclude(include) {
|
|
|
9444
9623
|
client_secret: clientSecret,
|
|
9445
9624
|
refresh_token: refreshToken
|
|
9446
9625
|
});
|
|
9447
|
-
return context.fetchJson("
|
|
9626
|
+
return context.fetchJson("".concat(ZOHO_ACCOUNTS_TOKEN_PATH, "?").concat(params), zohoAccountsApiFetchJsonInput('POST'));
|
|
9627
|
+
};
|
|
9628
|
+
}
|
|
9629
|
+
/**
|
|
9630
|
+
* Creates a function that exchanges a SPECIFIC USER's refresh token for a new access token.
|
|
9631
|
+
*
|
|
9632
|
+
* The per-user counterpart of {@link zohoAccountsAccessToken}, and narrowed the same way
|
|
9633
|
+
* {@link zohoAccountsRefreshTokenFromAuthorizationCode} is: it takes a
|
|
9634
|
+
* {@link ZohoAccountsOAuthClientContext} rather than a full {@link ZohoAccountsContext}. That matters
|
|
9635
|
+
* because a `ZohoAccountsContext`'s config REQUIRES a `refreshToken` — the app's own — so it cannot
|
|
9636
|
+
* describe a client that refreshes on behalf of many users. A full context stays structurally
|
|
9637
|
+
* assignable, so this is usable from either.
|
|
9638
|
+
*
|
|
9639
|
+
* Zoho does not rotate refresh tokens and its refresh response carries NO `refresh_token`, so the
|
|
9640
|
+
* token passed in here stays valid and must be retained by the caller. The response does carry
|
|
9641
|
+
* `api_domain`, which can differ from the one the grant was created with, so persist it.
|
|
9642
|
+
*
|
|
9643
|
+
* @param context - A Zoho Accounts client context providing fetch and client credentials.
|
|
9644
|
+
* @returns Function that exchanges a user's refresh token for an access token.
|
|
9645
|
+
*
|
|
9646
|
+
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token-expiry.html
|
|
9647
|
+
*
|
|
9648
|
+
* @example
|
|
9649
|
+
* ```typescript
|
|
9650
|
+
* const userAccessToken = zohoAccountsUserAccessToken(accountsClientContext);
|
|
9651
|
+
* const { access_token, api_domain, expires_in } = await userAccessToken({ refreshToken: user.zohoRefreshToken });
|
|
9652
|
+
* ```
|
|
9653
|
+
*/ function zohoAccountsUserAccessToken(context) {
|
|
9654
|
+
return function(input) {
|
|
9655
|
+
var _ref, _ref1;
|
|
9656
|
+
var _context_config = context.config, configClientId = _context_config.clientId, configClientSecret = _context_config.clientSecret;
|
|
9657
|
+
var client = input.client, refreshToken = input.refreshToken;
|
|
9658
|
+
var clientId = (_ref = client === null || client === void 0 ? void 0 : client.clientId) !== null && _ref !== void 0 ? _ref : configClientId;
|
|
9659
|
+
var clientSecret = (_ref1 = client === null || client === void 0 ? void 0 : client.clientSecret) !== null && _ref1 !== void 0 ? _ref1 : configClientSecret;
|
|
9660
|
+
var params = makeUrlSearchParams({
|
|
9661
|
+
grant_type: 'refresh_token',
|
|
9662
|
+
client_id: clientId,
|
|
9663
|
+
client_secret: clientSecret,
|
|
9664
|
+
refresh_token: refreshToken
|
|
9665
|
+
});
|
|
9666
|
+
return context.fetchJson("".concat(ZOHO_ACCOUNTS_TOKEN_PATH, "?").concat(params), zohoAccountsApiFetchJsonInput('POST'));
|
|
9448
9667
|
};
|
|
9449
9668
|
}
|
|
9450
9669
|
/**
|
|
@@ -9488,7 +9707,34 @@ function joinAgentInclude(include) {
|
|
|
9488
9707
|
code: code,
|
|
9489
9708
|
redirect_uri: redirectUri
|
|
9490
9709
|
});
|
|
9491
|
-
return context.fetchJson("
|
|
9710
|
+
return context.fetchJson("".concat(ZOHO_ACCOUNTS_TOKEN_PATH, "?").concat(params), zohoAccountsApiFetchJsonInput('POST'));
|
|
9711
|
+
};
|
|
9712
|
+
}
|
|
9713
|
+
// MARK: User Info
|
|
9714
|
+
/**
|
|
9715
|
+
* Path of the Zoho Accounts endpoint that describes the authorizing user.
|
|
9716
|
+
*/ var ZOHO_ACCOUNTS_USER_INFO_PATH = '/oauth/user/info';
|
|
9717
|
+
/**
|
|
9718
|
+
* Scope required to read {@link zohoAccountsUserInfo}.
|
|
9719
|
+
*/ var ZOHO_ACCOUNTS_PROFILE_READ_SCOPE = 'AaaServer.profile.READ';
|
|
9720
|
+
/**
|
|
9721
|
+
* Creates a function that reads the authorizing user's Zoho identity, so a connection can be
|
|
9722
|
+
* labelled with the account it belongs to.
|
|
9723
|
+
*
|
|
9724
|
+
* Requires the {@link ZOHO_ACCOUNTS_PROFILE_READ_SCOPE} scope on the access token.
|
|
9725
|
+
*
|
|
9726
|
+
* @param context - Zoho Accounts OAuth client context providing fetch.
|
|
9727
|
+
* @returns Function that reads the user info for an access token.
|
|
9728
|
+
*
|
|
9729
|
+
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/get-user-info.html
|
|
9730
|
+
*/ function zohoAccountsUserInfo(context) {
|
|
9731
|
+
return function(input) {
|
|
9732
|
+
return context.fetchJson(ZOHO_ACCOUNTS_USER_INFO_PATH, {
|
|
9733
|
+
method: 'GET',
|
|
9734
|
+
headers: {
|
|
9735
|
+
Authorization: "Zoho-oauthtoken ".concat(input.accessToken)
|
|
9736
|
+
}
|
|
9737
|
+
});
|
|
9492
9738
|
};
|
|
9493
9739
|
}
|
|
9494
9740
|
/**
|
|
@@ -9504,27 +9750,6 @@ function joinAgentInclude(include) {
|
|
|
9504
9750
|
};
|
|
9505
9751
|
}
|
|
9506
9752
|
|
|
9507
|
-
/**
|
|
9508
|
-
* The Zoho Accounts API URL for the US datacenter.
|
|
9509
|
-
*/ var ZOHO_ACCOUNTS_US_API_URL = 'https://accounts.zoho.com';
|
|
9510
|
-
/**
|
|
9511
|
-
* Resolves a Zoho Accounts API URL input to the full base URL. The 'us' key maps to the US datacenter; custom URLs pass through unchanged.
|
|
9512
|
-
*
|
|
9513
|
-
* @param input - A well-known datacenter key or a custom Zoho Accounts API URL.
|
|
9514
|
-
* @returns The resolved full Zoho Accounts API base URL.
|
|
9515
|
-
*/ function zohoAccountsConfigApiUrl(input) {
|
|
9516
|
-
var result;
|
|
9517
|
-
switch(input){
|
|
9518
|
-
case 'us':
|
|
9519
|
-
result = ZOHO_ACCOUNTS_US_API_URL;
|
|
9520
|
-
break;
|
|
9521
|
-
default:
|
|
9522
|
-
result = input;
|
|
9523
|
-
break;
|
|
9524
|
-
}
|
|
9525
|
-
return result;
|
|
9526
|
-
}
|
|
9527
|
-
|
|
9528
9753
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
9529
9754
|
try {
|
|
9530
9755
|
var info = gen[key](arg);
|
|
@@ -9700,6 +9925,50 @@ function _ts_generator(thisArg, body) {
|
|
|
9700
9925
|
};
|
|
9701
9926
|
}
|
|
9702
9927
|
}
|
|
9928
|
+
/**
|
|
9929
|
+
* Creates the {@link ZohoAccountsFetchFactory} the Zoho Accounts clients use when none is supplied.
|
|
9930
|
+
*
|
|
9931
|
+
* @param fetchHandler - The handler the produced fetches route through.
|
|
9932
|
+
* @returns The default Zoho Accounts fetch factory.
|
|
9933
|
+
*
|
|
9934
|
+
* @__NO_SIDE_EFFECTS__
|
|
9935
|
+
*/ function defaultZohoAccountsFetchFactory(fetchHandler) {
|
|
9936
|
+
return function(input) {
|
|
9937
|
+
return fetchApiFetchService.makeFetch({
|
|
9938
|
+
baseUrl: input.apiUrl,
|
|
9939
|
+
baseRequest: {
|
|
9940
|
+
headers: {
|
|
9941
|
+
'Content-Type': 'application/json'
|
|
9942
|
+
}
|
|
9943
|
+
},
|
|
9944
|
+
fetchHandler: fetchHandler,
|
|
9945
|
+
timeout: 20 * 1000,
|
|
9946
|
+
requireOkResponse: true,
|
|
9947
|
+
useTimeout: true // use timeout
|
|
9948
|
+
});
|
|
9949
|
+
};
|
|
9950
|
+
}
|
|
9951
|
+
/**
|
|
9952
|
+
* Builds the error-handling fetch pair shared by the full and client-credentials-only clients.
|
|
9953
|
+
*
|
|
9954
|
+
* Shared rather than duplicated because {@link interceptZohoAccounts200StatusWithErrorResponse} is
|
|
9955
|
+
* load-bearing: Zoho answers a failed token exchange with HTTP 200 and an `{ "error": … }` body, so
|
|
9956
|
+
* a hand-rolled fetch would treat a failed exchange as a success with an undefined access token.
|
|
9957
|
+
*
|
|
9958
|
+
* @param baseFetch - The configured base fetch to wrap.
|
|
9959
|
+
* @param logZohoServerErrorFunction - Optional error logging override.
|
|
9960
|
+
* @returns The wrapped fetch and its JSON counterpart.
|
|
9961
|
+
*/ function zohoAccountsClientFetch(baseFetch, logZohoServerErrorFunction) {
|
|
9962
|
+
var fetch = handleZohoAccountsErrorFetch(baseFetch, logZohoServerErrorFunction);
|
|
9963
|
+
var fetchJson = fetchJsonFunction(fetch, {
|
|
9964
|
+
interceptJsonResponse: interceptZohoAccounts200StatusWithErrorResponse,
|
|
9965
|
+
handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
|
|
9966
|
+
});
|
|
9967
|
+
return {
|
|
9968
|
+
fetch: fetch,
|
|
9969
|
+
fetchJson: fetchJson
|
|
9970
|
+
};
|
|
9971
|
+
}
|
|
9703
9972
|
/**
|
|
9704
9973
|
* Creates a {@link ZohoAccountsFactory} from the given configuration.
|
|
9705
9974
|
*
|
|
@@ -9735,20 +10004,7 @@ function _ts_generator(thisArg, body) {
|
|
|
9735
10004
|
* @__NO_SIDE_EFFECTS__
|
|
9736
10005
|
*/ function zohoAccountsFactory(factoryConfig) {
|
|
9737
10006
|
var fetchHandler = zohoRateLimitedFetchHandler();
|
|
9738
|
-
var logZohoServerErrorFunction = factoryConfig.logZohoServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ?
|
|
9739
|
-
return fetchApiFetchService.makeFetch({
|
|
9740
|
-
baseUrl: input.apiUrl,
|
|
9741
|
-
baseRequest: {
|
|
9742
|
-
headers: {
|
|
9743
|
-
'Content-Type': 'application/json'
|
|
9744
|
-
}
|
|
9745
|
-
},
|
|
9746
|
-
fetchHandler: fetchHandler,
|
|
9747
|
-
timeout: 20 * 1000,
|
|
9748
|
-
requireOkResponse: true,
|
|
9749
|
-
useTimeout: true // use timeout
|
|
9750
|
-
});
|
|
9751
|
-
} : _factoryConfig_fetchFactory;
|
|
10007
|
+
var logZohoServerErrorFunction = factoryConfig.logZohoServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? defaultZohoAccountsFetchFactory(fetchHandler) : _factoryConfig_fetchFactory;
|
|
9752
10008
|
return function(config) {
|
|
9753
10009
|
var _config_apiUrl;
|
|
9754
10010
|
if (!config.refreshToken) {
|
|
@@ -9762,11 +10018,7 @@ function _ts_generator(thisArg, body) {
|
|
|
9762
10018
|
var baseFetch = fetchFactory({
|
|
9763
10019
|
apiUrl: apiUrl
|
|
9764
10020
|
});
|
|
9765
|
-
var
|
|
9766
|
-
var fetchJson = fetchJsonFunction(fetch, {
|
|
9767
|
-
interceptJsonResponse: interceptZohoAccounts200StatusWithErrorResponse,
|
|
9768
|
-
handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
|
|
9769
|
-
});
|
|
10021
|
+
var _zohoAccountsClientFetch = zohoAccountsClientFetch(baseFetch, logZohoServerErrorFunction), fetch = _zohoAccountsClientFetch.fetch, fetchJson = _zohoAccountsClientFetch.fetchJson;
|
|
9770
10022
|
var tokenRefresher = function tokenRefresher() {
|
|
9771
10023
|
return _async_to_generator(function() {
|
|
9772
10024
|
var createdAt, _ref, access_token, api_domain, scope, expires_in, result;
|
|
@@ -9824,6 +10076,52 @@ function _ts_generator(thisArg, body) {
|
|
|
9824
10076
|
return zohoAccounts;
|
|
9825
10077
|
};
|
|
9826
10078
|
}
|
|
10079
|
+
/**
|
|
10080
|
+
* Creates a {@link ZohoAccountsOAuthClientFactory}, producing Zoho Accounts clients authenticated by
|
|
10081
|
+
* CLIENT CREDENTIALS ALONE.
|
|
10082
|
+
*
|
|
10083
|
+
* {@link zohoAccountsFactory} requires a refresh token, which a per-user authorization-code handoff
|
|
10084
|
+
* does not have yet — the handoff is how the refresh token is obtained. This client covers exactly
|
|
10085
|
+
* the two endpoints that need no user token: the authorization-code exchange and
|
|
10086
|
+
* `/oauth/user/info`.
|
|
10087
|
+
*
|
|
10088
|
+
* It builds its fetch through the same error handling as the full client, which matters more than it
|
|
10089
|
+
* looks: Zoho answers a failed token exchange with HTTP 200 and an `{ "error": … }` body, and
|
|
10090
|
+
* `interceptZohoAccounts200StatusWithErrorResponse` is what turns that into a thrown error instead
|
|
10091
|
+
* of a "successful" exchange with an undefined access token.
|
|
10092
|
+
*
|
|
10093
|
+
* @param factoryConfig - Configuration providing optional fetch and logging overrides.
|
|
10094
|
+
* @returns A factory function that creates client-credentials-only Zoho Accounts clients.
|
|
10095
|
+
*
|
|
10096
|
+
* @__NO_SIDE_EFFECTS__
|
|
10097
|
+
*/ function zohoAccountsOAuthClientFactory(factoryConfig) {
|
|
10098
|
+
var _factoryConfig_fetchHandler;
|
|
10099
|
+
var fetchHandler = (_factoryConfig_fetchHandler = factoryConfig.fetchHandler) !== null && _factoryConfig_fetchHandler !== void 0 ? _factoryConfig_fetchHandler : zohoRateLimitedFetchHandler();
|
|
10100
|
+
var logZohoServerErrorFunction = factoryConfig.logZohoServerErrorFunction, _factoryConfig_fetchFactory = factoryConfig.fetchFactory, fetchFactory = _factoryConfig_fetchFactory === void 0 ? defaultZohoAccountsFetchFactory(fetchHandler) : _factoryConfig_fetchFactory;
|
|
10101
|
+
return function(config) {
|
|
10102
|
+
var _config_apiUrl;
|
|
10103
|
+
if (!config.clientId) {
|
|
10104
|
+
throw new Error('ZohoAccountsOAuthClientConfig missing clientId.');
|
|
10105
|
+
} else if (!config.clientSecret) {
|
|
10106
|
+
throw new Error('ZohoAccountsOAuthClientConfig missing clientSecret.');
|
|
10107
|
+
}
|
|
10108
|
+
var apiUrl = zohoAccountsConfigApiUrl((_config_apiUrl = config.apiUrl) !== null && _config_apiUrl !== void 0 ? _config_apiUrl : 'us');
|
|
10109
|
+
var baseFetch = fetchFactory({
|
|
10110
|
+
apiUrl: apiUrl
|
|
10111
|
+
});
|
|
10112
|
+
var fetchJson = zohoAccountsClientFetch(baseFetch, logZohoServerErrorFunction).fetchJson;
|
|
10113
|
+
var resolvedConfig = _object_spread_props(_object_spread({}, config), {
|
|
10114
|
+
apiUrl: apiUrl
|
|
10115
|
+
});
|
|
10116
|
+
var oauthClientContext = {
|
|
10117
|
+
fetchJson: fetchJson,
|
|
10118
|
+
config: resolvedConfig
|
|
10119
|
+
};
|
|
10120
|
+
return {
|
|
10121
|
+
oauthClientContext: oauthClientContext
|
|
10122
|
+
};
|
|
10123
|
+
};
|
|
10124
|
+
}
|
|
9827
10125
|
/**
|
|
9828
10126
|
* Creates a {@link ZohoAccessTokenFactory} that manages access token lifecycle with
|
|
9829
10127
|
* in-memory caching, optional external cache support, and automatic refresh.
|
|
@@ -9967,4 +10265,4 @@ function safeZohoDateTimeString(date) {
|
|
|
9967
10265
|
return isoDate.substring(0, isoDate.length - 5) + 'Z';
|
|
9968
10266
|
}
|
|
9969
10267
|
|
|
9970
|
-
export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_DESK_API_RATE_LIMIT, DEFAULT_ZOHO_DESK_PAGE_LIMIT, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA, MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA, ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE, ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE, ZOHO_ACCOUNTS_US_API_URL, ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED, ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE, ZOHO_CRM_ATTACHMENTS_MODULE, ZOHO_CRM_ATTACHMENT_MAX_SIZE, ZOHO_CRM_CONTACTS_MODULE, ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT, ZOHO_CRM_EMAILS_MODULE, ZOHO_CRM_LEADS_MODULE, ZOHO_CRM_NOTES_MODULE, ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME, ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED, ZOHO_CRM_SERVICE_NAME, ZOHO_CRM_TAG_NAME_MAX_LENGTH, ZOHO_CRM_TASKS_MODULE, ZOHO_DATA_ARRAY_BLANK_ERROR_CODE, ZOHO_DESK_MAX_PAGE_LIMIT, ZOHO_DESK_RATE_LIMIT_REMAINING_HEADER, ZOHO_DESK_RATE_LIMIT_WEIGHT_HEADER, ZOHO_DESK_RETRY_AFTER_HEADER, ZOHO_DESK_SERVICE_NAME, ZOHO_DUPLICATE_DATA_ERROR_CODE, ZOHO_ERROR_STATUS, ZOHO_FAILURE_ERROR_CODE, ZOHO_INTERNAL_ERROR_CODE, ZOHO_INVALID_AUTHORIZATION_ERROR_CODE, ZOHO_INVALID_DATA_ERROR_CODE, ZOHO_INVALID_QUERY_ERROR_CODE, ZOHO_INVALID_TOKEN_ERROR_CODE, ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE, ZOHO_RATE_LIMIT_LIMIT_HEADER, ZOHO_RATE_LIMIT_REMAINING_HEADER, ZOHO_RATE_LIMIT_RESET_HEADER, ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED, ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE, ZOHO_RECRUIT_ATTACHMENTS_MODULE, ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE, ZOHO_RECRUIT_CANDIDATES_MODULE, ZOHO_RECRUIT_CRUD_FUNCTION_MAX_RECORDS_LIMIT, ZOHO_RECRUIT_EMAILS_MODULE, ZOHO_RECRUIT_JOB_OPENINGS_MODULE, ZOHO_RECRUIT_NOTES_MODULE, ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME, ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH, ZOHO_SIGN_PRODUCTION_API_URL, ZOHO_SIGN_SANDBOX_API_URL, ZOHO_SIGN_SERVICE_NAME, ZOHO_SUCCESS_CODE, ZOHO_SUCCESS_STATUS, ZOHO_TOO_MANY_REQUESTS_ERROR_CODE, ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZohoAccountsAccessTokenError, ZohoAccountsAuthFailureError, ZohoCrmExecuteRestApiFunctionError, ZohoCrmRecordCrudDuplicateDataError, ZohoCrmRecordCrudError, ZohoCrmRecordCrudInvalidDataError, ZohoCrmRecordCrudMandatoryFieldNotFoundError, ZohoCrmRecordCrudNoMatchingRecordError, ZohoCrmRecordNoContentError, ZohoInternalError, ZohoInvalidAuthorizationError, ZohoInvalidQueryError, ZohoInvalidTokenError, ZohoRecruitExecuteRestApiFunctionError, ZohoRecruitRecordCrudDuplicateDataError, ZohoRecruitRecordCrudError, ZohoRecruitRecordCrudInvalidDataError, ZohoRecruitRecordCrudMandatoryFieldNotFoundError, ZohoRecruitRecordCrudNoMatchingRecordError, ZohoRecruitRecordNoContentError, ZohoServerError, ZohoServerFetchResponseDataArrayError, ZohoServerFetchResponseError, ZohoTooManyRequestsError, addTagsToRecords, assertRecordDataArrayResultHasContent, assertZohoCrmRecordDataArrayResultHasContent, assertZohoRecruitRecordDataArrayResultHasContent, createNotes, createNotesForRecord, createTagsForModule, deleteAttachmentFromRecord, deleteNotes, deleteRecord, downloadAttachmentForRecord, emptyZohoPageResult, escapeZohoCrmFieldValueForCriteriaString, executeRestApiFunction, getAttachmentsForRecord, getAttachmentsForRecordPageFactory, getEmailsForRecord, getEmailsForRecordPageFactory, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, getTagsForModule, getTagsForModulePageFactory, handleZohoAccountsErrorFetch, handleZohoCrmErrorFetch, handleZohoDeskErrorFetch, handleZohoErrorFetchFactory, handleZohoRecruitErrorFetch, handleZohoSignErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoCrm200StatusWithErrorResponse, interceptZohoDesk200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, interceptZohoSign200StatusWithErrorResponse, isZohoCrmValidUrl, isZohoRecruitValidUrl, isZohoServerErrorResponseDataArrayRef, logZohoAccountsErrorToConsole, logZohoCrmErrorToConsole, logZohoDeskErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, logZohoSignErrorToConsole, makeZohoRateLimitedFetchHandler, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoCrmError, parseZohoCrmServerErrorResponseData, parseZohoDeskError, parseZohoDeskServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, parseZohoSignError, parseZohoSignServerErrorResponseData, removeTagsFromRecords, safeZohoDateTimeString, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, uploadAttachmentForRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsAccessToken, zohoAccountsApiFetchJsonInput, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsRefreshTokenFromAuthorizationCode, zohoAccountsZohoAccessTokenFactory, zohoCrmAddTagsToRecords, zohoCrmAddTagsToRecordsRequestBody, zohoCrmApiFetchJsonInput, zohoCrmCatchZohoCrmChangeObjectLikeResponseError, zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs, zohoCrmConfigApiUrl, zohoCrmCreateNotes, zohoCrmCreateNotesForRecord, zohoCrmCreateTagsForModule, zohoCrmDeleteAttachmentFromRecord, zohoCrmDeleteNotes, zohoCrmDeleteRecord, zohoCrmDeleteTag, zohoCrmDownloadAttachmentForRecord, zohoCrmExecuteRestApiFunction, zohoCrmFactory, zohoCrmGetAttachmentsForRecord, zohoCrmGetAttachmentsForRecordPageFactory, zohoCrmGetEmailsForRecord, zohoCrmGetEmailsForRecordPageFactory, zohoCrmGetNotesForRecord, zohoCrmGetNotesForRecordPageFactory, zohoCrmGetRecordById, zohoCrmGetRecords, zohoCrmGetRelatedRecordsFunctionFactory, zohoCrmGetTagsForModule, zohoCrmGetTagsForModulePageFactory, zohoCrmInsertRecord, zohoCrmMultiRecordResult, zohoCrmRecordCrudError, zohoCrmRemoveTagsFromRecords, zohoCrmSearchRecords, zohoCrmSearchRecordsCriteriaEntryToCriteriaString, zohoCrmSearchRecordsCriteriaString, zohoCrmSearchRecordsCriteriaStringForTree, zohoCrmSearchRecordsPageFactory, zohoCrmUpdateRecord, zohoCrmUploadAttachmentForRecord, zohoCrmUpsertRecord, zohoCrmUrlSearchParams, zohoCrmUrlSearchParamsMinusIdAndModule, zohoCrmUrlSearchParamsMinusModule, zohoDateTimeString, zohoDeskAddTicketFollowers, zohoDeskApiFetchJsonInput, zohoDeskAssociateTicketTags, zohoDeskConfigApiUrl, zohoDeskCreateTicketComment, zohoDeskDeleteTicketAttachment, zohoDeskDeleteTicketComment, zohoDeskDissociateTicketTag, zohoDeskFactory, zohoDeskFetchPageFactory, zohoDeskGetAgentById, zohoDeskGetAgents, zohoDeskGetAgentsByIds, zohoDeskGetAgentsPageFactory, zohoDeskGetAgentsTicketsCount, zohoDeskGetAllTags, zohoDeskGetContactById, zohoDeskGetContacts, zohoDeskGetContactsByIds, zohoDeskGetContactsPageFactory, zohoDeskGetDepartmentById, zohoDeskGetDepartments, zohoDeskGetMyInfo, zohoDeskGetTicketActivities, zohoDeskGetTicketActivitiesPageFactory, zohoDeskGetTicketAttachments, zohoDeskGetTicketById, zohoDeskGetTicketCommentById, zohoDeskGetTicketComments, zohoDeskGetTicketFollowers, zohoDeskGetTicketMetrics, zohoDeskGetTicketTags, zohoDeskGetTicketThreadById, zohoDeskGetTicketThreads, zohoDeskGetTicketThreadsPageFactory, zohoDeskGetTicketTimeEntries, zohoDeskGetTicketTimeEntryById, zohoDeskGetTicketTimeEntrySummation, zohoDeskGetTicketTimer, zohoDeskGetTickets, zohoDeskGetTicketsForContact, zohoDeskGetTicketsForProduct, zohoDeskGetTicketsPageFactory, zohoDeskPerformTicketTimerAction, zohoDeskRateLimitDetailsReader, zohoDeskRateLimitedFetchHandler, zohoDeskRemoveTicketFollowers, zohoDeskSearchTags, zohoDeskSearchTickets, zohoDeskSearchTicketsPageFactory, zohoFetchPageFactory, zohoRateLimitHeaderDetails, zohoRateLimitedFetchHandler, zohoRecruitAddTagsToRecords, zohoRecruitApiFetchJsonInput, zohoRecruitAssociateCandidateRecordsWithJobOpenings, zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs, zohoRecruitConfigApiUrl, zohoRecruitCreateNotes, zohoRecruitCreateNotesForRecord, zohoRecruitCreateTagsForModule, zohoRecruitDeleteAttachmentFromRecord, zohoRecruitDeleteNotes, zohoRecruitDeleteRecord, zohoRecruitDownloadAttachmentForRecord, zohoRecruitExecuteRestApiFunction, zohoRecruitFactory, zohoRecruitGetAttachmentsForRecord, zohoRecruitGetAttachmentsForRecordPageFactory, zohoRecruitGetEmailsForRecord, zohoRecruitGetEmailsForRecordPageFactory, zohoRecruitGetNotesForRecord, zohoRecruitGetNotesForRecordPageFactory, zohoRecruitGetRecordById, zohoRecruitGetRecords, zohoRecruitGetRelatedRecordsFunctionFactory, zohoRecruitGetTagsForModule, zohoRecruitGetTagsForModulePageFactory, zohoRecruitInsertRecord, zohoRecruitMultiRecordResult, zohoRecruitRecordCrudError, zohoRecruitRemoveTagsFromRecords, zohoRecruitSearchAssociatedRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory, zohoRecruitSearchJobOpeningAssociatedCandidateRecords, zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory, zohoRecruitSearchRecords, zohoRecruitSearchRecordsCriteriaEntryToCriteriaString, zohoRecruitSearchRecordsCriteriaString, zohoRecruitSearchRecordsCriteriaStringForTree, zohoRecruitSearchRecordsPageFactory, zohoRecruitUpdateRecord, zohoRecruitUploadAttachmentForRecord, zohoRecruitUpsertRecord, zohoRecruitUrlSearchParams, zohoRecruitUrlSearchParamsMinusIdAndModule, zohoRecruitUrlSearchParamsMinusModule, zohoServerErrorData, zohoSignApiUrlRequiresHttpsHost, zohoSignConfigApiUrl, zohoSignCreateDocument, zohoSignCreateDocumentFromTemplate, zohoSignDeleteDocument, zohoSignDownloadCompletionCertificate, zohoSignDownloadPdf, zohoSignExtendDocument, zohoSignFactory, zohoSignFetchPageFactory, zohoSignGetDocument, zohoSignGetDocumentFormData, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignGetEmbeddedSigningUrl, zohoSignGetTemplate, zohoSignGetTemplates, zohoSignRetrieveFieldTypes, zohoSignSendDocumentForSignature, zohoSignUpdateDocument, zohoStandardRateLimitDetailsReader };
|
|
10268
|
+
export { DEFAULT_ZOHO_API_RATE_LIMIT, DEFAULT_ZOHO_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOHO_DESK_API_RATE_LIMIT, DEFAULT_ZOHO_DESK_PAGE_LIMIT, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUESTS_LOG_FUNCTION, DEFAULT_ZOHO_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, MAX_ZOHO_CRM_SEARCH_MODULE_RECORDS_CRITERIA, MAX_ZOHO_RECRUIT_SEARCH_MODULE_RECORDS_CRITERIA, ZOHO_ACCOUNTS_API_URLS, ZOHO_ACCOUNTS_AUTHORIZE_PATH, ZOHO_ACCOUNTS_AU_API_URL, ZOHO_ACCOUNTS_CA_API_URL, ZOHO_ACCOUNTS_EU_API_URL, ZOHO_ACCOUNTS_INVALID_CLIENT_ERROR_CODE, ZOHO_ACCOUNTS_INVALID_CODE_ERROR_CODE, ZOHO_ACCOUNTS_IN_API_URL, ZOHO_ACCOUNTS_JP_API_URL, ZOHO_ACCOUNTS_PROFILE_READ_SCOPE, ZOHO_ACCOUNTS_SA_API_URL, ZOHO_ACCOUNTS_TOKEN_PATH, ZOHO_ACCOUNTS_UK_API_URL, ZOHO_ACCOUNTS_USER_INFO_PATH, ZOHO_ACCOUNTS_US_API_URL, ZOHO_CRM_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED, ZOHO_CRM_ALREADY_ASSOCIATED_ERROR_CODE, ZOHO_CRM_ATTACHMENTS_MODULE, ZOHO_CRM_ATTACHMENT_MAX_SIZE, ZOHO_CRM_CONTACTS_MODULE, ZOHO_CRM_CRUD_FUNCTION_MAX_RECORDS_LIMIT, ZOHO_CRM_EMAILS_MODULE, ZOHO_CRM_LEADS_MODULE, ZOHO_CRM_NOTES_MODULE, ZOHO_CRM_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME, ZOHO_CRM_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED, ZOHO_CRM_SERVICE_NAME, ZOHO_CRM_TAG_NAME_MAX_LENGTH, ZOHO_CRM_TASKS_MODULE, ZOHO_DATA_ARRAY_BLANK_ERROR_CODE, ZOHO_DESK_MAX_PAGE_LIMIT, ZOHO_DESK_RATE_LIMIT_REMAINING_HEADER, ZOHO_DESK_RATE_LIMIT_WEIGHT_HEADER, ZOHO_DESK_RETRY_AFTER_HEADER, ZOHO_DESK_SERVICE_NAME, ZOHO_DUPLICATE_DATA_ERROR_CODE, ZOHO_ERROR_STATUS, ZOHO_FAILURE_ERROR_CODE, ZOHO_INTERNAL_ERROR_CODE, ZOHO_INVALID_AUTHORIZATION_ERROR_CODE, ZOHO_INVALID_DATA_ERROR_CODE, ZOHO_INVALID_QUERY_ERROR_CODE, ZOHO_INVALID_TOKEN_ERROR_CODE, ZOHO_MANDATORY_NOT_FOUND_ERROR_CODE, ZOHO_OAUTH_AUTHORIZE_RESPONSE_TYPE, ZOHO_OAUTH_CONSENT_PROMPT, ZOHO_OAUTH_OFFLINE_ACCESS_TYPE, ZOHO_OAUTH_SCOPE_DELIMITER, ZOHO_RATE_LIMIT_LIMIT_HEADER, ZOHO_RATE_LIMIT_REMAINING_HEADER, ZOHO_RATE_LIMIT_RESET_HEADER, ZOHO_RECRUIT_ADD_TAGS_TO_RECORDS_MAX_IDS_ALLOWED, ZOHO_RECRUIT_ALREADY_ASSOCIATED_ERROR_CODE, ZOHO_RECRUIT_ATTACHMENTS_MODULE, ZOHO_RECRUIT_ATTACHMENT_MAX_SIZE, ZOHO_RECRUIT_CANDIDATES_MODULE, ZOHO_RECRUIT_CRUD_FUNCTION_MAX_RECORDS_LIMIT, ZOHO_RECRUIT_EMAILS_MODULE, ZOHO_RECRUIT_JOB_OPENINGS_MODULE, ZOHO_RECRUIT_NOTES_MODULE, ZOHO_RECRUIT_RECORD_ATTACHMENT_METADATA_ATTACH_TYPE_RESUME, ZOHO_RECRUIT_REMOVE_TAGS_FROM_RECORDS_MAX_IDS_ALLOWED, ZOHO_RECRUIT_SERVICE_NAME, ZOHO_RECRUIT_TAG_NAME_MAX_LENGTH, ZOHO_SIGN_PRODUCTION_API_URL, ZOHO_SIGN_SANDBOX_API_URL, ZOHO_SIGN_SERVICE_NAME, ZOHO_SUCCESS_CODE, ZOHO_SUCCESS_STATUS, ZOHO_TOO_MANY_REQUESTS_ERROR_CODE, ZOHO_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZohoAccountsAccessTokenError, ZohoAccountsAuthFailureError, ZohoCrmExecuteRestApiFunctionError, ZohoCrmRecordCrudDuplicateDataError, ZohoCrmRecordCrudError, ZohoCrmRecordCrudInvalidDataError, ZohoCrmRecordCrudMandatoryFieldNotFoundError, ZohoCrmRecordCrudNoMatchingRecordError, ZohoCrmRecordNoContentError, ZohoInternalError, ZohoInvalidAuthorizationError, ZohoInvalidQueryError, ZohoInvalidTokenError, ZohoRecruitExecuteRestApiFunctionError, ZohoRecruitRecordCrudDuplicateDataError, ZohoRecruitRecordCrudError, ZohoRecruitRecordCrudInvalidDataError, ZohoRecruitRecordCrudMandatoryFieldNotFoundError, ZohoRecruitRecordCrudNoMatchingRecordError, ZohoRecruitRecordNoContentError, ZohoServerError, ZohoServerFetchResponseDataArrayError, ZohoServerFetchResponseError, ZohoTooManyRequestsError, addTagsToRecords, assertRecordDataArrayResultHasContent, assertZohoCrmRecordDataArrayResultHasContent, assertZohoRecruitRecordDataArrayResultHasContent, createNotes, createNotesForRecord, createTagsForModule, defaultZohoAccountsFetchFactory, deleteAttachmentFromRecord, deleteNotes, deleteRecord, downloadAttachmentForRecord, emptyZohoPageResult, escapeZohoCrmFieldValueForCriteriaString, executeRestApiFunction, getAttachmentsForRecord, getAttachmentsForRecordPageFactory, getEmailsForRecord, getEmailsForRecordPageFactory, getNotesForRecord, getNotesForRecordPageFactory, getRecordById, getRecords, getRelatedRecordsFunctionFactory, getTagsForModule, getTagsForModulePageFactory, handleZohoAccountsErrorFetch, handleZohoCrmErrorFetch, handleZohoDeskErrorFetch, handleZohoErrorFetchFactory, handleZohoRecruitErrorFetch, handleZohoSignErrorFetch, insertRecord, interceptZohoAccounts200StatusWithErrorResponse, interceptZohoCrm200StatusWithErrorResponse, interceptZohoDesk200StatusWithErrorResponse, interceptZohoErrorResponseFactory, interceptZohoRecruit200StatusWithErrorResponse, interceptZohoSign200StatusWithErrorResponse, isKnownZohoAccountsApiUrl, isZohoCrmValidUrl, isZohoRecruitValidUrl, isZohoServerErrorResponseDataArrayRef, logZohoAccountsErrorToConsole, logZohoCrmErrorToConsole, logZohoDeskErrorToConsole, logZohoRecruitErrorToConsole, logZohoServerErrorFunction, logZohoSignErrorToConsole, makeZohoRateLimitedFetchHandler, parseZohoAccountsError, parseZohoAccountsServerErrorResponseData, parseZohoCrmError, parseZohoCrmServerErrorResponseData, parseZohoDeskError, parseZohoDeskServerErrorResponseData, parseZohoRecruitError, parseZohoRecruitServerErrorResponseData, parseZohoServerErrorResponseData, parseZohoSignError, parseZohoSignServerErrorResponseData, removeTagsFromRecords, safeZohoDateTimeString, searchRecords, searchRecordsPageFactory, tryFindZohoServerErrorData, updateRecord, uploadAttachmentForRecord, upsertRecord, zohoAccessTokenStringFactory, zohoAccountsAccessToken, zohoAccountsApiFetchJsonInput, zohoAccountsApiUrlKeyForApiUrl, zohoAccountsAuthorizeUrlFactory, zohoAccountsConfigApiUrl, zohoAccountsFactory, zohoAccountsOAuthClientFactory, zohoAccountsRefreshTokenFromAuthorizationCode, zohoAccountsUserAccessToken, zohoAccountsUserInfo, zohoAccountsZohoAccessTokenFactory, zohoCrmAddTagsToRecords, zohoCrmAddTagsToRecordsRequestBody, zohoCrmApiFetchJsonInput, zohoCrmCatchZohoCrmChangeObjectLikeResponseError, zohoCrmChangeObjectLikeResponseSuccessAndErrorPairs, zohoCrmConfigApiUrl, zohoCrmCreateNotes, zohoCrmCreateNotesForRecord, zohoCrmCreateTagsForModule, zohoCrmDeleteAttachmentFromRecord, zohoCrmDeleteNotes, zohoCrmDeleteRecord, zohoCrmDeleteTag, zohoCrmDownloadAttachmentForRecord, zohoCrmExecuteRestApiFunction, zohoCrmFactory, zohoCrmGetAttachmentsForRecord, zohoCrmGetAttachmentsForRecordPageFactory, zohoCrmGetEmailsForRecord, zohoCrmGetEmailsForRecordPageFactory, zohoCrmGetNotesForRecord, zohoCrmGetNotesForRecordPageFactory, zohoCrmGetRecordById, zohoCrmGetRecords, zohoCrmGetRelatedRecordsFunctionFactory, zohoCrmGetTagsForModule, zohoCrmGetTagsForModulePageFactory, zohoCrmInsertRecord, zohoCrmMultiRecordResult, zohoCrmRecordCrudError, zohoCrmRemoveTagsFromRecords, zohoCrmSearchRecords, zohoCrmSearchRecordsCriteriaEntryToCriteriaString, zohoCrmSearchRecordsCriteriaString, zohoCrmSearchRecordsCriteriaStringForTree, zohoCrmSearchRecordsPageFactory, zohoCrmUpdateRecord, zohoCrmUploadAttachmentForRecord, zohoCrmUpsertRecord, zohoCrmUrlSearchParams, zohoCrmUrlSearchParamsMinusIdAndModule, zohoCrmUrlSearchParamsMinusModule, zohoDateTimeString, zohoDeskAddTicketFollowers, zohoDeskApiFetchJsonInput, zohoDeskAssociateTicketTags, zohoDeskConfigApiUrl, zohoDeskCreateTicketComment, zohoDeskDeleteTicketAttachment, zohoDeskDeleteTicketComment, zohoDeskDissociateTicketTag, zohoDeskFactory, zohoDeskFetchPageFactory, zohoDeskGetAgentById, zohoDeskGetAgents, zohoDeskGetAgentsByIds, zohoDeskGetAgentsPageFactory, zohoDeskGetAgentsTicketsCount, zohoDeskGetAllTags, zohoDeskGetContactById, zohoDeskGetContacts, zohoDeskGetContactsByIds, zohoDeskGetContactsPageFactory, zohoDeskGetDepartmentById, zohoDeskGetDepartments, zohoDeskGetMyInfo, zohoDeskGetTicketActivities, zohoDeskGetTicketActivitiesPageFactory, zohoDeskGetTicketAttachments, zohoDeskGetTicketById, zohoDeskGetTicketCommentById, zohoDeskGetTicketComments, zohoDeskGetTicketFollowers, zohoDeskGetTicketMetrics, zohoDeskGetTicketTags, zohoDeskGetTicketThreadById, zohoDeskGetTicketThreads, zohoDeskGetTicketThreadsPageFactory, zohoDeskGetTicketTimeEntries, zohoDeskGetTicketTimeEntryById, zohoDeskGetTicketTimeEntrySummation, zohoDeskGetTicketTimer, zohoDeskGetTickets, zohoDeskGetTicketsForContact, zohoDeskGetTicketsForProduct, zohoDeskGetTicketsPageFactory, zohoDeskPerformTicketTimerAction, zohoDeskRateLimitDetailsReader, zohoDeskRateLimitedFetchHandler, zohoDeskRemoveTicketFollowers, zohoDeskSearchTags, zohoDeskSearchTickets, zohoDeskSearchTicketsPageFactory, zohoFetchPageFactory, zohoOAuthScopesFromScopeString, zohoRateLimitHeaderDetails, zohoRateLimitedFetchHandler, zohoRecruitAddTagsToRecords, zohoRecruitApiFetchJsonInput, zohoRecruitAssociateCandidateRecordsWithJobOpenings, zohoRecruitChangeObjectLikeResponseSuccessAndErrorPairs, zohoRecruitConfigApiUrl, zohoRecruitCreateNotes, zohoRecruitCreateNotesForRecord, zohoRecruitCreateTagsForModule, zohoRecruitDeleteAttachmentFromRecord, zohoRecruitDeleteNotes, zohoRecruitDeleteRecord, zohoRecruitDownloadAttachmentForRecord, zohoRecruitExecuteRestApiFunction, zohoRecruitFactory, zohoRecruitGetAttachmentsForRecord, zohoRecruitGetAttachmentsForRecordPageFactory, zohoRecruitGetEmailsForRecord, zohoRecruitGetEmailsForRecordPageFactory, zohoRecruitGetNotesForRecord, zohoRecruitGetNotesForRecordPageFactory, zohoRecruitGetRecordById, zohoRecruitGetRecords, zohoRecruitGetRelatedRecordsFunctionFactory, zohoRecruitGetTagsForModule, zohoRecruitGetTagsForModulePageFactory, zohoRecruitInsertRecord, zohoRecruitMultiRecordResult, zohoRecruitRecordCrudError, zohoRecruitRemoveTagsFromRecords, zohoRecruitSearchAssociatedRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecords, zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory, zohoRecruitSearchJobOpeningAssociatedCandidateRecords, zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory, zohoRecruitSearchRecords, zohoRecruitSearchRecordsCriteriaEntryToCriteriaString, zohoRecruitSearchRecordsCriteriaString, zohoRecruitSearchRecordsCriteriaStringForTree, zohoRecruitSearchRecordsPageFactory, zohoRecruitUpdateRecord, zohoRecruitUploadAttachmentForRecord, zohoRecruitUpsertRecord, zohoRecruitUrlSearchParams, zohoRecruitUrlSearchParamsMinusIdAndModule, zohoRecruitUrlSearchParamsMinusModule, zohoServerErrorData, zohoSignApiUrlRequiresHttpsHost, zohoSignConfigApiUrl, zohoSignCreateDocument, zohoSignCreateDocumentFromTemplate, zohoSignDeleteDocument, zohoSignDownloadCompletionCertificate, zohoSignDownloadPdf, zohoSignExtendDocument, zohoSignFactory, zohoSignFetchPageFactory, zohoSignGetDocument, zohoSignGetDocumentFormData, zohoSignGetDocuments, zohoSignGetDocumentsPageFactory, zohoSignGetEmbeddedSigningUrl, zohoSignGetTemplate, zohoSignGetTemplates, zohoSignRetrieveFieldTypes, zohoSignSendDocumentForSignature, zohoSignUpdateDocument, zohoStandardRateLimitDetailsReader };
|