This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch UNOMI-610-new-tracker
in repository https://gitbox.apache.org/repos/asf/unomi-tracker.git


The following commit(s) were added to refs/heads/UNOMI-610-new-tracker by this 
push:
     new 6c62c83  UNOMI-610: base tracker first draft
6c62c83 is described below

commit 6c62c83565171207de97bd679ecc331c077ad7c5
Author: Kevan <[email protected]>
AuthorDate: Wed Sep 7 12:22:23 2022 +0200

    UNOMI-610: base tracker first draft
---
 dist/apache-unomi-tracker.cjs.js | 18 ++++++++++++------
 dist/apache-unomi-tracker.esm.js | 18 ++++++++++++------
 dist/apache-unomi-tracker.umd.js | 18 ++++++++++++------
 src/tracker/tracker.js           | 12 ++++++------
 4 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/dist/apache-unomi-tracker.cjs.js b/dist/apache-unomi-tracker.cjs.js
index d8027fa..89448b7 100644
--- a/dist/apache-unomi-tracker.cjs.js
+++ b/dist/apache-unomi-tracker.cjs.js
@@ -555,7 +555,8 @@ var newTracker = function newTracker() {
      * @param {object} [targetProperties] The optional properties of the target
      * @returns {object} the target
      */
-    buildTarget: function buildTarget(targetId, targetType, targetProperties) {
+    buildTarget: function buildTarget(targetId, targetType) {
+      var targetProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
       return wem._buildObject(targetId, targetType, targetProperties);
     },
 
@@ -567,7 +568,8 @@ var newTracker = function newTracker() {
      * @param {object} [sourceProperties] The optional properties of the source
      * @returns {object} the source
      */
-    buildSource: function buildSource(sourceId, sourceType, sourceProperties) {
+    buildSource: function buildSource(sourceId, sourceType) {
+      var sourceProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
       return wem._buildObject(sourceId, sourceType, sourceProperties);
     },
 
@@ -1070,10 +1072,12 @@ var newTracker = function newTracker() {
      *
      * @private
      * @param {object} event the Unomi event to be registered
-     * @param {boolean} unshift if true, the event will be added at the 
beginning of the list otherwise at the end of the list.
+     * @param {boolean} unshift optional, if true, the event will be added at 
the beginning of the list otherwise at the end of the list. (default: false)
      * @return {undefined}
      */
-    _registerEvent: function _registerEvent(event, unshift) {
+    _registerEvent: function _registerEvent(event) {
+      var unshift = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : false;
+
       if (wem.digitalData) {
         if (wem.cxs) {
           console.error('[WEM] already loaded, too late...');
@@ -1177,7 +1181,8 @@ var newTracker = function newTracker() {
      * @private
      * @return {object} the built Unomi JSON object
      */
-    _buildObject: function _buildObject(itemId, itemType, properties) {
+    _buildObject: function _buildObject(itemId, itemType) {
+      var properties = arguments.length > 2 && arguments[2] !== undefined ? 
arguments[2] : undefined;
       var object = {
         scope: wem.digitalData.scope,
         itemId: itemId,
@@ -1450,7 +1455,8 @@ var newTracker = function newTracker() {
      * @private
      * @return {undefined}
      */
-    _enableWem: function _enableWem(enable, callback) {
+    _enableWem: function _enableWem(enable) {
+      var callback = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : undefined;
       // display fallback if wem is not enable
       wem.fallback = !enable; // remove cookies, reset cxs
 
diff --git a/dist/apache-unomi-tracker.esm.js b/dist/apache-unomi-tracker.esm.js
index 567e119..35872a4 100644
--- a/dist/apache-unomi-tracker.esm.js
+++ b/dist/apache-unomi-tracker.esm.js
@@ -547,7 +547,8 @@ var newTracker = function newTracker() {
      * @param {object} [targetProperties] The optional properties of the target
      * @returns {object} the target
      */
-    buildTarget: function buildTarget(targetId, targetType, targetProperties) {
+    buildTarget: function buildTarget(targetId, targetType) {
+      var targetProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
       return wem._buildObject(targetId, targetType, targetProperties);
     },
 
@@ -559,7 +560,8 @@ var newTracker = function newTracker() {
      * @param {object} [sourceProperties] The optional properties of the source
      * @returns {object} the source
      */
-    buildSource: function buildSource(sourceId, sourceType, sourceProperties) {
+    buildSource: function buildSource(sourceId, sourceType) {
+      var sourceProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
       return wem._buildObject(sourceId, sourceType, sourceProperties);
     },
 
@@ -1062,10 +1064,12 @@ var newTracker = function newTracker() {
      *
      * @private
      * @param {object} event the Unomi event to be registered
-     * @param {boolean} unshift if true, the event will be added at the 
beginning of the list otherwise at the end of the list.
+     * @param {boolean} unshift optional, if true, the event will be added at 
the beginning of the list otherwise at the end of the list. (default: false)
      * @return {undefined}
      */
-    _registerEvent: function _registerEvent(event, unshift) {
+    _registerEvent: function _registerEvent(event) {
+      var unshift = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : false;
+
       if (wem.digitalData) {
         if (wem.cxs) {
           console.error('[WEM] already loaded, too late...');
@@ -1169,7 +1173,8 @@ var newTracker = function newTracker() {
      * @private
      * @return {object} the built Unomi JSON object
      */
-    _buildObject: function _buildObject(itemId, itemType, properties) {
+    _buildObject: function _buildObject(itemId, itemType) {
+      var properties = arguments.length > 2 && arguments[2] !== undefined ? 
arguments[2] : undefined;
       var object = {
         scope: wem.digitalData.scope,
         itemId: itemId,
@@ -1442,7 +1447,8 @@ var newTracker = function newTracker() {
      * @private
      * @return {undefined}
      */
-    _enableWem: function _enableWem(enable, callback) {
+    _enableWem: function _enableWem(enable) {
+      var callback = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : undefined;
       // display fallback if wem is not enable
       wem.fallback = !enable; // remove cookies, reset cxs
 
diff --git a/dist/apache-unomi-tracker.umd.js b/dist/apache-unomi-tracker.umd.js
index 2477420..45383fc 100644
--- a/dist/apache-unomi-tracker.umd.js
+++ b/dist/apache-unomi-tracker.umd.js
@@ -2202,7 +2202,8 @@
        * @param {object} [targetProperties] The optional properties of the 
target
        * @returns {object} the target
        */
-      buildTarget: function buildTarget(targetId, targetType, 
targetProperties) {
+      buildTarget: function buildTarget(targetId, targetType) {
+        var targetProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
         return wem._buildObject(targetId, targetType, targetProperties);
       },
 
@@ -2214,7 +2215,8 @@
        * @param {object} [sourceProperties] The optional properties of the 
source
        * @returns {object} the source
        */
-      buildSource: function buildSource(sourceId, sourceType, 
sourceProperties) {
+      buildSource: function buildSource(sourceId, sourceType) {
+        var sourceProperties = arguments.length > 2 && arguments[2] !== 
undefined ? arguments[2] : undefined;
         return wem._buildObject(sourceId, sourceType, sourceProperties);
       },
 
@@ -2717,10 +2719,12 @@
        *
        * @private
        * @param {object} event the Unomi event to be registered
-       * @param {boolean} unshift if true, the event will be added at the 
beginning of the list otherwise at the end of the list.
+       * @param {boolean} unshift optional, if true, the event will be added 
at the beginning of the list otherwise at the end of the list. (default: false)
        * @return {undefined}
        */
-      _registerEvent: function _registerEvent(event, unshift) {
+      _registerEvent: function _registerEvent(event) {
+        var unshift = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : false;
+
         if (wem.digitalData) {
           if (wem.cxs) {
             console.error('[WEM] already loaded, too late...');
@@ -2824,7 +2828,8 @@
        * @private
        * @return {object} the built Unomi JSON object
        */
-      _buildObject: function _buildObject(itemId, itemType, properties) {
+      _buildObject: function _buildObject(itemId, itemType) {
+        var properties = arguments.length > 2 && arguments[2] !== undefined ? 
arguments[2] : undefined;
         var object = {
           scope: wem.digitalData.scope,
           itemId: itemId,
@@ -3097,7 +3102,8 @@
        * @private
        * @return {undefined}
        */
-      _enableWem: function _enableWem(enable, callback) {
+      _enableWem: function _enableWem(enable) {
+        var callback = arguments.length > 1 && arguments[1] !== undefined ? 
arguments[1] : undefined;
         // display fallback if wem is not enable
         wem.fallback = !enable; // remove cookies, reset cxs
 
diff --git a/src/tracker/tracker.js b/src/tracker/tracker.js
index 9ce78a0..0c31f9b 100644
--- a/src/tracker/tracker.js
+++ b/src/tracker/tracker.js
@@ -516,7 +516,7 @@ export const newTracker = () => {
          * @param {object} [targetProperties] The optional properties of the 
target
          * @returns {object} the target
          */
-        buildTarget: function (targetId, targetType, targetProperties) {
+        buildTarget: function (targetId, targetType, targetProperties = 
undefined) {
             return wem._buildObject(targetId, targetType, targetProperties);
         },
 
@@ -528,7 +528,7 @@ export const newTracker = () => {
          * @param {object} [sourceProperties] The optional properties of the 
source
          * @returns {object} the source
          */
-        buildSource: function (sourceId, sourceType, sourceProperties) {
+        buildSource: function (sourceId, sourceType, sourceProperties = 
undefined) {
             return wem._buildObject(sourceId, sourceType, sourceProperties);
         },
 
@@ -969,10 +969,10 @@ export const newTracker = () => {
          *
          * @private
          * @param {object} event the Unomi event to be registered
-         * @param {boolean} unshift if true, the event will be added at the 
beginning of the list otherwise at the end of the list.
+         * @param {boolean} unshift optional, if true, the event will be added 
at the beginning of the list otherwise at the end of the list. (default: false)
          * @return {undefined}
          */
-        _registerEvent: function (event, unshift) {
+        _registerEvent: function (event, unshift = false) {
             if (wem.digitalData) {
                 if (wem.cxs) {
                     console.error('[WEM] already loaded, too late...');
@@ -1063,7 +1063,7 @@ export const newTracker = () => {
          * @private
          * @return {object} the built Unomi JSON object
          */
-        _buildObject: function (itemId, itemType, properties) {
+        _buildObject: function (itemId, itemType, properties = undefined) {
             var object = {
                 scope: wem.digitalData.scope,
                 itemId: itemId,
@@ -1318,7 +1318,7 @@ export const newTracker = () => {
          * @private
          * @return {undefined}
          */
-        _enableWem: (enable, callback) => {
+        _enableWem: (enable, callback = undefined) => {
             // display fallback if wem is not enable
             wem.fallback = !enable;
             // remove cookies, reset cxs

Reply via email to