@amityco/ts-sdk 7.0.2-46b4d65.0 → 7.0.3-2e98d66.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.
@@ -1 +1 @@
1
- {"version":3,"file":"AnalyticsEventCapturer.d.ts","sourceRoot":"","sources":["../../../../src/analytic/service/analytic/AnalyticsEventCapturer.ts"],"names":[],"mappings":";AAQA,qBAAa,sBAAsB;IACjC,WAAW,SAAc;IAEzB,UAAU,SAAQ;IAElB,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;KAAE,CAAM;IAElE,yBAAyB,EAAE;QAAE,CAAC,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;KAAE,CAAM;IAGhF,mBAAmB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAa;IAE5D,+BAA+B,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAM;IAEnE,eAAe,CAAC,EACd,QAAQ,EACR,UAAU,EACV,cAAsB,GACvB,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B;IAoBD,MAAM,CAAC,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC;QAC5C,YAAY,EAAE,KAAK,CAAC,yBAAyB,CAAC;QAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC;IAmCD,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;IASrD,SAAS,CAAC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AAwB,CAAC;QAC5C,YAAY,EAAE,KAAK,CAAC,yBAAyB,CAAC;QAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC;IAmCD,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC;IASrD,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,CAAC,yBAAyB;IAuEnF,eAAe;IAQf,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAI5C,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAI7C,cAAc,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW;IAgBjE,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW;CAenE"}
package/dist/index.cjs.js CHANGED
@@ -102,8 +102,8 @@ const PostContentType = Object.freeze({
102
102
 
103
103
  function getVersion() {
104
104
  try {
105
- // the string ''v7.0.1-cjs'' should be replaced by actual value by @rollup/plugin-replace
106
- return 'v7.0.1-cjs';
105
+ // the string ''v7.0.2-cjs'' should be replaced by actual value by @rollup/plugin-replace
106
+ return 'v7.0.2-cjs';
107
107
  }
108
108
  catch (error) {
109
109
  return '__dev__';
@@ -4950,12 +4950,14 @@ class AnalyticsEventCapturer {
4950
4950
  }
4951
4951
  isAbleToEnqueue({ uniqueId, expireTime, isHighPriority = false, }) {
4952
4952
  const now = new Date();
4953
- const getRecentViewedDate = () => {
4954
- if (isHighPriority)
4955
- return this._recentHighPriorityViewed[uniqueId];
4956
- return this._recentViewed[uniqueId];
4957
- };
4958
- const recentViewedDate = getRecentViewedDate() || new Date(DAY * -1);
4953
+ // Get the recent view date (if any)
4954
+ const recentViewedDate = isHighPriority
4955
+ ? this._recentHighPriorityViewed[uniqueId]
4956
+ : this._recentViewed[uniqueId];
4957
+ // If this is the first view, always allow it
4958
+ if (!recentViewedDate) {
4959
+ return true;
4960
+ }
4959
4961
  const timeDiff = now.getTime() - recentViewedDate.getTime();
4960
4962
  if (timeDiff < expireTime) {
4961
4963
  // just recently view this post, ignore the event.
package/dist/index.esm.js CHANGED
@@ -87,8 +87,8 @@ const PostContentType = Object.freeze({
87
87
 
88
88
  function getVersion() {
89
89
  try {
90
- // the string ''v7.0.1-esm'' should be replaced by actual value by @rollup/plugin-replace
91
- return 'v7.0.1-esm';
90
+ // the string ''v7.0.2-esm'' should be replaced by actual value by @rollup/plugin-replace
91
+ return 'v7.0.2-esm';
92
92
  }
93
93
  catch (error) {
94
94
  return '__dev__';
@@ -21042,12 +21042,14 @@ class AnalyticsEventCapturer {
21042
21042
  }
21043
21043
  isAbleToEnqueue({ uniqueId, expireTime, isHighPriority = false, }) {
21044
21044
  const now = new Date();
21045
- const getRecentViewedDate = () => {
21046
- if (isHighPriority)
21047
- return this._recentHighPriorityViewed[uniqueId];
21048
- return this._recentViewed[uniqueId];
21049
- };
21050
- const recentViewedDate = getRecentViewedDate() || new Date(DAY * -1);
21045
+ // Get the recent view date (if any)
21046
+ const recentViewedDate = isHighPriority
21047
+ ? this._recentHighPriorityViewed[uniqueId]
21048
+ : this._recentViewed[uniqueId];
21049
+ // If this is the first view, always allow it
21050
+ if (!recentViewedDate) {
21051
+ return true;
21052
+ }
21051
21053
  const timeDiff = now.getTime() - recentViewedDate.getTime();
21052
21054
  if (timeDiff < expireTime) {
21053
21055
  // just recently view this post, ignore the event.