wanas-zcrm-extractor 1.7.0 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wanas-zcrm-extractor",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Local Zoho CRM V8 Metadata Extractor CLI and Web Dashboard Utility",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -11,13 +11,14 @@ async function delay(ms) {
11
11
 
12
12
  async function exportAuditLog(filterFile) {
13
13
  try {
14
- // For a full export the request body is OPTIONAL. Sending an object WITH an
15
- // empty `criteria` is rejected (400), and sending NO body trips a 415
16
- // (missing content type). So the default (no filter) sends an empty JSON
17
- // object `{}` which carries the JSON content type and contains no
18
- // criteria, i.e. "export everything". A filter file (which must contain a
19
- // valid `audit_log_export` criteria object) overrides it when supplied.
20
- let requestBody = {};
14
+ // For a FULL export Zoho's docs say to "skip the input request" entirely
15
+ // i.e. send an EMPTY body. We send `null` (empty body); the apiClient adds
16
+ // the required `Content-Type: application/json` header on POSTs. This avoids
17
+ // BOTH the 415 (missing content type) and the 400 MANDATORY_NOT_FOUND that a
18
+ // present-but-incomplete object (`{}` or `[{}]`) triggers at $.audit_log_export[0].
19
+ // A filter file (which must contain a valid `audit_log_export[0].criteria`)
20
+ // overrides it when supplied.
21
+ let requestBody = null;
21
22
 
22
23
  if (filterFile) {
23
24
  const filterPath = path.resolve(process.cwd(), filterFile);