@mparticle/web-adobe-server-kit 2.1.1 → 3.1.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.
@@ -28,12 +28,12 @@ var MediaEventType = {
28
28
  SegmentStart: 43,
29
29
  SegmentEnd: 44,
30
30
  SegmentSkip: 45,
31
- UpdateQoS: 46
31
+ UpdateQoS: 46,
32
32
  };
33
33
 
34
34
  var ContentType = {
35
35
  Audio: 'Audio',
36
- Video: 'Video'
36
+ Video: 'Video',
37
37
  };
38
38
 
39
39
  var StreamType = {
@@ -41,7 +41,7 @@ var StreamType = {
41
41
  OnDemand: 'OnDemand',
42
42
  Linear: 'Linear',
43
43
  Podcast: 'Podcast',
44
- Audiobook: 'Audiobook'
44
+ Audiobook: 'Audiobook',
45
45
  };
46
46
 
47
47
  function EventHandler(common) {
@@ -269,7 +269,7 @@ var getAdobeMetadataKeys = function(attributes, Heartbeat) {
269
269
  content_mvpd: Heartbeat.VideoMetadataKeys.MVPD,
270
270
  content_authorized: Heartbeat.VideoMetadataKeys.AUTHORIZED,
271
271
  content_daypart: Heartbeat.VideoMetadataKeys.DAY_PART,
272
- content_feed: Heartbeat.VideoMetadataKeys.FEED
272
+ content_feed: Heartbeat.VideoMetadataKeys.FEED,
273
273
  };
274
274
 
275
275
  var adobeMetadataKeys = {};
@@ -425,7 +425,7 @@ var Initialization = {
425
425
  }
426
426
 
427
427
  initHeartbeatCallback();
428
- }
428
+ },
429
429
  };
430
430
 
431
431
  var initialization = Initialization;
@@ -458,7 +458,7 @@ var MessageType = {
458
458
  CrashReport: 5,
459
459
  OptOut: 6,
460
460
  Commerce: 16,
461
- Media: 20
461
+ Media: 20,
462
462
  };
463
463
 
464
464
  function constructor() {
@@ -542,7 +542,7 @@ function constructor() {
542
542
  return true;
543
543
  } catch (e) {
544
544
  return {
545
- error: 'Error logging event on forwarder ' + name + '; ' + e
545
+ error: 'Error logging event on forwarder ' + name + '; ' + e,
546
546
  };
547
547
  }
548
548
  }
@@ -556,7 +556,7 @@ if (window.mParticle && window.mParticle.registerHBK) {
556
556
  }
557
557
 
558
558
  var src = {
559
- AdobeHbkConstructor: constructor
559
+ AdobeHbkConstructor: constructor,
560
560
  };
561
561
  var src_1 = src.AdobeHbkConstructor;
562
562
 
@@ -643,16 +643,18 @@ function s_gi(r){var a,h=window.s_c_il,q,p,m=r.split(","),s,u,t=0;if(h)for(q=0;!
643
643
  function s_pgicq(){var r=window,a=r.s_giq,h,q,p;if(a)for(h=0;h<a.length;h++)q=a[h],p=s_gi(q.oun),p.setAccount(q.un),p.setTagContainer(q.tagContainerName);r.s_giq=0;}s_pgicq();
644
644
 
645
645
  var MessageType$1 = {
646
- Media: 20
646
+ Media: 20,
647
647
  };
648
648
  var name = 'Adobe',
649
649
  MARKETINGCLOUDIDKEY = 'mid',
650
- ADOBEMODULENUMBER = 124;
650
+ ADOBEMODULENUMBER = 124,
651
+ suffix = 'Server';
651
652
 
652
653
  var constructor$1 = function() {
653
654
  var self = this,
654
655
  isAdobeServerKitInitialized;
655
656
  self.name = name;
657
+ self.suffix = suffix;
656
658
  self.adobeMediaSDK = new src_1();
657
659
 
658
660
  function initForwarder(forwarderSettings, service, testMode) {
@@ -723,15 +725,18 @@ function getId() {
723
725
  if (window && window.mParticle && window.mParticle.addForwarder) {
724
726
  window.mParticle.addForwarder({
725
727
  name: name,
728
+ suffix: suffix,
726
729
  constructor: constructor$1,
727
- getId: getId
730
+ getId: getId,
728
731
  });
729
732
  }
730
733
 
731
734
  function register(config) {
735
+ var forwarderNameWithSuffix = [name, suffix].join('-');
732
736
  if (!config) {
733
737
  window.console.log(
734
- 'You must pass a config object to register the kit ' + name
738
+ 'You must pass a config object to register the kit ' +
739
+ forwarderNameWithSuffix
735
740
  );
736
741
  return;
737
742
  }
@@ -744,17 +749,19 @@ function register(config) {
744
749
  }
745
750
 
746
751
  if (isObject(config.kits)) {
747
- config.kits[name] = {
748
- constructor: constructor$1
752
+ config.kits[forwarderNameWithSuffix] = {
753
+ constructor: constructor$1,
749
754
  };
750
755
  } else {
751
756
  config.kits = {};
752
- config.kits[name] = {
753
- constructor: constructor$1
757
+ config.kits[forwarderNameWithSuffix] = {
758
+ constructor: constructor$1,
754
759
  };
755
760
  }
756
761
  window.console.log(
757
- 'Successfully registered ' + name + ' to your mParticle configuration'
762
+ 'Successfully registered ' +
763
+ forwarderNameWithSuffix +
764
+ ' to your mParticle configuration'
758
765
  );
759
766
  }
760
767
 
@@ -765,7 +772,7 @@ function isObject(val) {
765
772
  }
766
773
 
767
774
  var AdobeServerSideKit_esm = {
768
- register: register
775
+ register: register,
769
776
  };
770
777
 
771
778
  module.exports = AdobeServerSideKit_esm;
@@ -1,4 +1,4 @@
1
- var mParticleAdobe = (function () {
1
+ var mParticleAdobeServer = (function () {
2
2
  function Common() {
3
3
  this.playheadPosition = 0;
4
4
  this.startupTime = 0;
@@ -29,12 +29,12 @@ var mParticleAdobe = (function () {
29
29
  SegmentStart: 43,
30
30
  SegmentEnd: 44,
31
31
  SegmentSkip: 45,
32
- UpdateQoS: 46
32
+ UpdateQoS: 46,
33
33
  };
34
34
 
35
35
  var ContentType = {
36
36
  Audio: 'Audio',
37
- Video: 'Video'
37
+ Video: 'Video',
38
38
  };
39
39
 
40
40
  var StreamType = {
@@ -42,7 +42,7 @@ var mParticleAdobe = (function () {
42
42
  OnDemand: 'OnDemand',
43
43
  Linear: 'Linear',
44
44
  Podcast: 'Podcast',
45
- Audiobook: 'Audiobook'
45
+ Audiobook: 'Audiobook',
46
46
  };
47
47
 
48
48
  function EventHandler(common) {
@@ -270,7 +270,7 @@ var mParticleAdobe = (function () {
270
270
  content_mvpd: Heartbeat.VideoMetadataKeys.MVPD,
271
271
  content_authorized: Heartbeat.VideoMetadataKeys.AUTHORIZED,
272
272
  content_daypart: Heartbeat.VideoMetadataKeys.DAY_PART,
273
- content_feed: Heartbeat.VideoMetadataKeys.FEED
273
+ content_feed: Heartbeat.VideoMetadataKeys.FEED,
274
274
  };
275
275
 
276
276
  var adobeMetadataKeys = {};
@@ -426,7 +426,7 @@ var mParticleAdobe = (function () {
426
426
  }
427
427
 
428
428
  initHeartbeatCallback();
429
- }
429
+ },
430
430
  };
431
431
 
432
432
  var initialization = Initialization;
@@ -459,7 +459,7 @@ var mParticleAdobe = (function () {
459
459
  CrashReport: 5,
460
460
  OptOut: 6,
461
461
  Commerce: 16,
462
- Media: 20
462
+ Media: 20,
463
463
  };
464
464
 
465
465
  function constructor() {
@@ -543,7 +543,7 @@ var mParticleAdobe = (function () {
543
543
  return true;
544
544
  } catch (e) {
545
545
  return {
546
- error: 'Error logging event on forwarder ' + name + '; ' + e
546
+ error: 'Error logging event on forwarder ' + name + '; ' + e,
547
547
  };
548
548
  }
549
549
  }
@@ -557,7 +557,7 @@ var mParticleAdobe = (function () {
557
557
  }
558
558
 
559
559
  var src = {
560
- AdobeHbkConstructor: constructor
560
+ AdobeHbkConstructor: constructor,
561
561
  };
562
562
  var src_1 = src.AdobeHbkConstructor;
563
563
 
@@ -644,16 +644,18 @@ var mParticleAdobe = (function () {
644
644
  function s_pgicq(){var r=window,a=r.s_giq,h,q,p;if(a)for(h=0;h<a.length;h++)q=a[h],p=s_gi(q.oun),p.setAccount(q.un),p.setTagContainer(q.tagContainerName);r.s_giq=0;}s_pgicq();
645
645
 
646
646
  var MessageType$1 = {
647
- Media: 20
647
+ Media: 20,
648
648
  };
649
649
  var name = 'Adobe',
650
650
  MARKETINGCLOUDIDKEY = 'mid',
651
- ADOBEMODULENUMBER = 124;
651
+ ADOBEMODULENUMBER = 124,
652
+ suffix = 'Server';
652
653
 
653
654
  var constructor$1 = function() {
654
655
  var self = this,
655
656
  isAdobeServerKitInitialized;
656
657
  self.name = name;
658
+ self.suffix = suffix;
657
659
  self.adobeMediaSDK = new src_1();
658
660
 
659
661
  function initForwarder(forwarderSettings, service, testMode) {
@@ -724,15 +726,18 @@ var mParticleAdobe = (function () {
724
726
  if (window && window.mParticle && window.mParticle.addForwarder) {
725
727
  window.mParticle.addForwarder({
726
728
  name: name,
729
+ suffix: suffix,
727
730
  constructor: constructor$1,
728
- getId: getId
731
+ getId: getId,
729
732
  });
730
733
  }
731
734
 
732
735
  function register(config) {
736
+ var forwarderNameWithSuffix = [name, suffix].join('-');
733
737
  if (!config) {
734
738
  window.console.log(
735
- 'You must pass a config object to register the kit ' + name
739
+ 'You must pass a config object to register the kit ' +
740
+ forwarderNameWithSuffix
736
741
  );
737
742
  return;
738
743
  }
@@ -745,17 +750,19 @@ var mParticleAdobe = (function () {
745
750
  }
746
751
 
747
752
  if (isObject(config.kits)) {
748
- config.kits[name] = {
749
- constructor: constructor$1
753
+ config.kits[forwarderNameWithSuffix] = {
754
+ constructor: constructor$1,
750
755
  };
751
756
  } else {
752
757
  config.kits = {};
753
- config.kits[name] = {
754
- constructor: constructor$1
758
+ config.kits[forwarderNameWithSuffix] = {
759
+ constructor: constructor$1,
755
760
  };
756
761
  }
757
762
  window.console.log(
758
- 'Successfully registered ' + name + ' to your mParticle configuration'
763
+ 'Successfully registered ' +
764
+ forwarderNameWithSuffix +
765
+ ' to your mParticle configuration'
759
766
  );
760
767
  }
761
768
 
@@ -766,7 +773,7 @@ var mParticleAdobe = (function () {
766
773
  }
767
774
 
768
775
  var AdobeServerSideKit_esm = {
769
- register: register
776
+ register: register,
770
777
  };
771
778
 
772
779
  return AdobeServerSideKit_esm;
package/package.json CHANGED
@@ -1,16 +1,23 @@
1
1
  {
2
- "name": "@mparticle/web-adobe-server-kit",
3
- "version": "2.1.1",
4
- "description": "mParticle integration sdk for Adobe (server side)",
5
- "main": "dist/AdobeServerSideKit.common.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
10
- "license": "Apache-2.0",
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "repository": "https://github.com/mparticle-integrations/mparticle-javascript-integration-adobe/tree/master/packages/AdobeServer",
15
- "gitHead": "5908cab653ec15470b290abc50e286e8986bbdc1"
2
+ "name": "@mparticle/web-adobe-server-kit",
3
+ "version": "3.1.0",
4
+ "description": "mParticle integration sdk for Adobe (server side)",
5
+ "main": "dist/AdobeServerSideKit.common.js",
6
+ "files": [
7
+ "dist/AdobeServerSideKit.common.js",
8
+ "dist/AdobeServerSideKit.iife.js"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
14
+ "license": "Apache-2.0",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/mParticle/mparticle-web-sdk",
21
+ "directory": "kits/adobe/packages/AdobeServer"
22
+ }
16
23
  }
@@ -1,146 +0,0 @@
1
- // START OF ADOBEKIT SERVERSIDE MPARTICLE JS INTEGRATION
2
-
3
- /* eslint-disable no-undef */
4
-
5
- //
6
- // Copyright 2018 mParticle, Inc.
7
- //
8
- // Licensed under the Apache License, Version 2.0 (the 'License');
9
- // you may not use this file except in compliance with the License.
10
- // You may obtain a copy of the License at
11
- //
12
- // http://www.apache.org/licenses/LICENSE-2.0
13
- //
14
- // Unless required by applicable law or agreed to in writing, software
15
- // distributed under the License is distributed on an 'AS IS' BASIS,
16
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- // See the License for the specific language governing permissions and
18
- // limitations under the License.
19
-
20
- import { AdobeHbkConstructor } from '../../../HeartbeatKit/dist/AdobeHBKit.esm.js';
21
-
22
- var MessageType = {
23
- Media: 20
24
- };
25
- var name = 'Adobe',
26
- MARKETINGCLOUDIDKEY = 'mid',
27
- ADOBEMODULENUMBER = 124;
28
-
29
- var constructor = function() {
30
- var self = this,
31
- isAdobeServerKitInitialized;
32
- self.name = name;
33
- self.adobeMediaSDK = new AdobeHbkConstructor();
34
-
35
- function initForwarder(forwarderSettings, service, testMode) {
36
- mParticle._setIntegrationDelay(ADOBEMODULENUMBER, true);
37
- try {
38
- // On first load, adobe will call the callback correctly if no MCID exists
39
- // On subsequent loads, it does not, so we need to manually call setMCIDOnIntegrationAttributes
40
- var visitorOptions = {};
41
- if (forwarderSettings.audienceManagerServer) {
42
- visitorOptions.audienceManagerServer =
43
- forwarderSettings.audienceManagerServer;
44
- }
45
-
46
- var mcID = Visitor.getInstance(
47
- forwarderSettings.organizationID,
48
- visitorOptions
49
- ).getMarketingCloudVisitorID(setMarketingCloudId);
50
- if (mcID && mcID.length > 0) {
51
- setMCIDOnIntegrationAttributes(mcID);
52
- }
53
-
54
- if (forwarderSettings.mediaTrackingServer) {
55
- self.adobeMediaSDK.init(forwarderSettings, service, testMode);
56
- }
57
- isAdobeServerKitInitialized = true;
58
- return 'Adobe Server Side Integration Ready';
59
- } catch (e) {
60
- return 'Failed to initialize: ' + e;
61
- }
62
- }
63
-
64
- function setMarketingCloudId(mcid) {
65
- setMCIDOnIntegrationAttributes(mcid);
66
- }
67
-
68
- function processEvent(event) {
69
- if (isAdobeServerKitInitialized) {
70
- try {
71
- if (event.EventDataType === MessageType.Media) {
72
- self.adobeMediaSDK.process(event);
73
- }
74
- } catch (e) {
75
- return 'Failed to send to: ' + name + ' ' + e;
76
- }
77
- } else {
78
- return "Can't send to forwarder " + name + ', not initialized.';
79
- }
80
- }
81
-
82
- this.init = initForwarder;
83
- this.process = processEvent;
84
- };
85
-
86
- function setMCIDOnIntegrationAttributes(mcid) {
87
- var adobeIntegrationAttributes = {};
88
- adobeIntegrationAttributes[MARKETINGCLOUDIDKEY] = mcid;
89
- mParticle.setIntegrationAttribute(
90
- ADOBEMODULENUMBER,
91
- adobeIntegrationAttributes
92
- );
93
- mParticle._setIntegrationDelay(ADOBEMODULENUMBER, false);
94
- }
95
-
96
- function getId() {
97
- return moduleId;
98
- }
99
-
100
- if (window && window.mParticle && window.mParticle.addForwarder) {
101
- window.mParticle.addForwarder({
102
- name: name,
103
- constructor: constructor,
104
- getId: getId
105
- });
106
- }
107
-
108
- function register(config) {
109
- if (!config) {
110
- window.console.log(
111
- 'You must pass a config object to register the kit ' + name
112
- );
113
- return;
114
- }
115
-
116
- if (!isObject(config)) {
117
- window.console.log(
118
- "'config' must be an object. You passed in a " + typeof config
119
- );
120
- return;
121
- }
122
-
123
- if (isObject(config.kits)) {
124
- config.kits[name] = {
125
- constructor: constructor
126
- };
127
- } else {
128
- config.kits = {};
129
- config.kits[name] = {
130
- constructor: constructor
131
- };
132
- }
133
- window.console.log(
134
- 'Successfully registered ' + name + ' to your mParticle configuration'
135
- );
136
- }
137
-
138
- function isObject(val) {
139
- return (
140
- val != null && typeof val === 'object' && Array.isArray(val) === false
141
- );
142
- }
143
-
144
- export default {
145
- register: register
146
- };