@contentstack/datasync-manager 2.1.0 → 2.1.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/README.md CHANGED
@@ -154,6 +154,23 @@ And here's an example to get you started:
154
154
  }
155
155
  ```
156
156
 
157
+ ### Environment Variables
158
+
159
+ The following environment variables can be used to customize the behavior of Contentstack DataSync Manager:
160
+
161
+ | Variable | Description | Default |
162
+ |--------------|-----------------------------------------------------------------------------|------------------------|
163
+ | `TOKEN_PATH` | Path to the directory where token/checkpoint/ledger files are stored. | Project root directory |
164
+ | `PLUGIN_PATH`| Path to the directory where plugins are loaded from. | Project root directory |
165
+ | `NODE_ENV` | Node.js environment (affects config/environment selection). | `development` |
166
+ | `SYNC_ENV` | Overrides the environment used for sync operations. | Value of `NODE_ENV` |
167
+ | `KILLDURATION`| Time (in ms) before the process is forcefully killed (overrides config). | Value from config |
168
+
169
+ **Note:**
170
+ - `TOKEN_PATH` is especially useful for storing token data in a custom directory (e.g., for selective re-syncing based on timestamps).
171
+ - If a relative path is provided, it is resolved from the project root.
172
+ - These variables can be set in your shell or in your process manager configuration.
173
+
157
174
  ### Further Reading
158
175
 
159
176
  - [Getting started with Contentstack DataSync](https://www.contentstack.com/docs/guide/synchronization/contentstack-datasync)
@@ -310,6 +310,7 @@ const fire = (req) => {
310
310
  });
311
311
  return (0, promise_map_1.map)(contentTypeUids, (uid) => {
312
312
  return new Promise((mapResolve, mapReject) => {
313
+ debug(`API called with for content type: ${uid}`);
313
314
  return (0, api_1.get)({
314
315
  path: `${Contentstack.apis.content_types}${uid}`,
315
316
  qs: {
@@ -330,6 +331,7 @@ const fire = (req) => {
330
331
  err.code = 'ICTC';
331
332
  return mapReject(err);
332
333
  }).catch((error) => {
334
+ debug('Error [map] fetching content type schema:', error);
333
335
  if ((0, inet_1.netConnectivityIssues)(error)) {
334
336
  flag.SQ = false;
335
337
  }
@@ -345,14 +347,17 @@ const fire = (req) => {
345
347
  flag.SQ = false;
346
348
  }
347
349
  // Errorred while fetching content type schema
350
+ debug('Error [mapResolve]:', error);
348
351
  return reject(error);
349
352
  });
350
353
  }).catch((processError) => {
354
+ debug('Error [filterItems]:', processError);
351
355
  return reject(processError);
352
356
  });
353
357
  }
354
358
  return postProcess(req, syncResponse)
355
- .then(resolve);
359
+ .then(resolve)
360
+ .catch(reject);
356
361
  }).catch((error) => {
357
362
  debug('Error [fire]', error);
358
363
  if ((0, inet_1.netConnectivityIssues)(error)) {
@@ -394,6 +399,7 @@ const postProcess = (req, resp) => {
394
399
  flag.SQ = false;
395
400
  return resolve('');
396
401
  }
402
+ debug(`Re-Fire called with: ${JSON.stringify(req)}`);
397
403
  return fire(req)
398
404
  .then(resolve)
399
405
  .catch(reject);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/datasync-manager",
3
3
  "author": "Contentstack LLC <support@contentstack.com>",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "description": "The primary module of Contentstack DataSync. Syncs Contentstack data with your server using Contentstack Sync API",
6
6
  "main": "dist/index.js",
7
7
  "dependencies": {