wanas-zcrm-extractor 1.5.2 → 1.5.3
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/README.md +1 -1
- package/bin/cli.js +3 -2
- package/package.json +1 -1
- package/src/services/authService.js +5 -1
package/README.md
CHANGED
|
@@ -329,7 +329,7 @@ zcrm audit # last 3 years by default
|
|
|
329
329
|
zcrm audit --filter input.json # custom export criteria
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
-
> **Requires the `ZohoCRM.settings.audit_logs.
|
|
332
|
+
> **Requires the audit-log OAuth scopes** — `ZohoCRM.settings.audit_logs.CREATE`, `ZohoCRM.settings.audit_logs.READ`, and `ZohoFiles.files.READ`. They're in the default scopes, but if you authenticated *before* they were added you'll see `401 invalid oauth scope` — just re-authenticate: `zcrm logout` then `zcrm login`.
|
|
333
333
|
</details>
|
|
334
334
|
|
|
335
335
|
<br>
|
package/bin/cli.js
CHANGED
|
@@ -581,8 +581,9 @@ program
|
|
|
581
581
|
const isScope = error.response?.data?.code === 'OAUTH_SCOPE_MISMATCH' || /scope/i.test(apiMsg || '');
|
|
582
582
|
console.error(`\n❌ Audit log export failed: ${apiMsg}`);
|
|
583
583
|
if (isScope) {
|
|
584
|
-
console.error('\n\x1b[33mThis needs the \x1b[1mZohoCRM.settings.audit_logs.
|
|
585
|
-
console.error('
|
|
584
|
+
console.error('\n\x1b[33mThis needs the audit-log scopes — \x1b[1mZohoCRM.settings.audit_logs.CREATE\x1b[0m\x1b[33m,');
|
|
585
|
+
console.error('\x1b[1mZohoCRM.settings.audit_logs.READ\x1b[0m\x1b[33m and \x1b[1mZohoFiles.files.READ\x1b[0m\x1b[33m — which your current');
|
|
586
|
+
console.error('session was not granted. Re-authenticate to add them:\x1b[0m');
|
|
586
587
|
console.error(' \x1b[36mzcrm logout\x1b[0m then \x1b[36mzcrm login\x1b[0m');
|
|
587
588
|
}
|
|
588
589
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -54,7 +54,11 @@ class AuthService {
|
|
|
54
54
|
* @returns {string} Commas-separated list of scopes.
|
|
55
55
|
*/
|
|
56
56
|
getScopes() {
|
|
57
|
-
|
|
57
|
+
// Every scope below is documented in the Zoho CRM V8 API reference. Audit
|
|
58
|
+
// logs have NO `.ALL` variant — the export flow uses the three specific
|
|
59
|
+
// operation scopes (CREATE to initiate, READ to poll, ZohoFiles.files.READ
|
|
60
|
+
// to download the result file).
|
|
61
|
+
const defaultScopes = 'ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,ZohoCRM.users.ALL,ZohoCRM.org.ALL,ZohoCRM.bulk.ALL,ZohoCRM.notifications.ALL,ZohoCRM.coql.READ,ZohoCRM.settings.functions.ALL,ZohoCRM.settings.audit_logs.CREATE,ZohoCRM.settings.audit_logs.READ,ZohoFiles.files.READ';
|
|
58
62
|
if (process.env.ZCRM_CLI_MODE === 'true') {
|
|
59
63
|
return configStore.get('scopes') || process.env.ZOHO_SCOPES || defaultScopes;
|
|
60
64
|
}
|