@dereekb/analytics 13.15.0 → 13.17.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.
@@ -409,7 +409,9 @@ function _object_spread_props(target, source) {
409
409
  if (!userId) {
410
410
  throw new Error('No userId was provided to track().');
411
411
  }
412
- if (!this.config.logOnly) {
412
+ if (this.config.logOnly) {
413
+ this.logger.debug("Segment (Log Only) - Track: ".concat(userId, " ").concat(event.event));
414
+ } else {
413
415
  this.segmentApi.analytics.track({
414
416
  userId: userId,
415
417
  event: event.event,
@@ -417,8 +419,6 @@ function _object_spread_props(target, source) {
417
419
  timestamp: event.timestamp,
418
420
  context: _object_spread({}, event.context, this._appContext())
419
421
  });
420
- } else {
421
- this.logger.debug("Segment (Log Only) - Track: ".concat(userId, " ").concat(event.event));
422
422
  }
423
423
  }
424
424
  },
@@ -454,12 +454,12 @@ function _object_spread_props(target, source) {
454
454
  * ```
455
455
  */ key: "identify",
456
456
  value: function identify(params) {
457
- if (!this.config.logOnly) {
457
+ if (this.config.logOnly) {
458
+ this.logger.debug("Segment (Log Only) - Identify: ".concat(params.userId));
459
+ } else {
458
460
  this.segmentApi.analytics.identify(_object_spread_props(_object_spread({}, params), {
459
461
  context: _object_spread({}, params.context, this._appContext())
460
462
  }));
461
- } else {
462
- this.logger.debug("Segment (Log Only) - Identify: ".concat(params.userId));
463
463
  }
464
464
  }
465
465
  },
@@ -407,7 +407,9 @@ function _object_spread_props(target, source) {
407
407
  if (!userId) {
408
408
  throw new Error('No userId was provided to track().');
409
409
  }
410
- if (!this.config.logOnly) {
410
+ if (this.config.logOnly) {
411
+ this.logger.debug("Segment (Log Only) - Track: ".concat(userId, " ").concat(event.event));
412
+ } else {
411
413
  this.segmentApi.analytics.track({
412
414
  userId: userId,
413
415
  event: event.event,
@@ -415,8 +417,6 @@ function _object_spread_props(target, source) {
415
417
  timestamp: event.timestamp,
416
418
  context: _object_spread({}, event.context, this._appContext())
417
419
  });
418
- } else {
419
- this.logger.debug("Segment (Log Only) - Track: ".concat(userId, " ").concat(event.event));
420
420
  }
421
421
  }
422
422
  },
@@ -452,12 +452,12 @@ function _object_spread_props(target, source) {
452
452
  * ```
453
453
  */ key: "identify",
454
454
  value: function identify(params) {
455
- if (!this.config.logOnly) {
455
+ if (this.config.logOnly) {
456
+ this.logger.debug("Segment (Log Only) - Identify: ".concat(params.userId));
457
+ } else {
456
458
  this.segmentApi.analytics.identify(_object_spread_props(_object_spread({}, params), {
457
459
  context: _object_spread({}, params.context, this._appContext())
458
460
  }));
459
- } else {
460
- this.logger.debug("Segment (Log Only) - Identify: ".concat(params.userId));
461
461
  }
462
462
  }
463
463
  },
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/analytics/nestjs",
3
- "version": "13.15.0",
3
+ "version": "13.17.0",
4
4
  "peerDependencies": {
5
- "@dereekb/analytics": "13.15.0",
6
- "@dereekb/nestjs": "13.15.0",
7
- "@dereekb/rxjs": "13.15.0",
8
- "@dereekb/util": "13.15.0",
5
+ "@dereekb/analytics": "13.17.0",
6
+ "@dereekb/nestjs": "13.17.0",
7
+ "@dereekb/rxjs": "13.17.0",
8
+ "@dereekb/util": "13.17.0",
9
9
  "@nestjs/common": "^11.1.19",
10
10
  "@nestjs/config": "^4.0.4",
11
11
  "@nestjs/core": "^11.1.19",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/analytics",
3
- "version": "13.15.0",
3
+ "version": "13.17.0",
4
4
  "exports": {
5
5
  "./nestjs": {
6
6
  "module": "./nestjs/index.esm.js",
@@ -17,9 +17,9 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@dereekb/nestjs": "13.15.0",
21
- "@dereekb/rxjs": "13.15.0",
22
- "@dereekb/util": "13.15.0",
20
+ "@dereekb/nestjs": "13.17.0",
21
+ "@dereekb/rxjs": "13.17.0",
22
+ "@dereekb/util": "13.17.0",
23
23
  "@nestjs/common": "^11.1.19",
24
24
  "@nestjs/config": "^4.0.4",
25
25
  "@nestjs/core": "^11.1.19",