@blotoutio/providers-pinterest-sdk 1.30.2 → 1.31.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.
Files changed (4) hide show
  1. package/index.cjs.js +18 -28
  2. package/index.js +18 -28
  3. package/index.mjs +18 -28
  4. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -38,33 +38,23 @@ const init = ({ manifest }) => {
38
38
  window.pintrk('page');
39
39
  };
40
40
 
41
- const getPinterestEventName = (name) => {
42
- switch (name) {
43
- case 'Purchase': {
44
- return 'checkout';
45
- }
46
- case 'PageView':
47
- case 'ViewContent': {
48
- return 'pagevisit';
49
- }
50
- case 'AddToCart': {
51
- return 'addtocart';
52
- }
53
- case 'Search': {
54
- return 'search';
55
- }
56
- case 'Lead': {
57
- return 'lead';
58
- }
59
- case 'SignUp': {
60
- return 'signup';
61
- }
62
- case 'WatchVideo': {
63
- return 'watchvideo';
64
- }
65
- }
66
- return name;
67
- };
41
+ const pinterestEventMap = new Map([
42
+ ['Purchase', 'checkout'],
43
+ ['Checkout', 'checkout'],
44
+ ['InitiateCheckout', 'initiatecheckout'],
45
+ ['PageView', 'pagevisit'],
46
+ ['ViewContent', 'viewcontent'],
47
+ ['ViewCategory', 'viewcategory'],
48
+ ['AddToCart', 'addtocart'],
49
+ ['AddToWishlist', 'addtowishlist'],
50
+ ['AddPaymentInfo', 'addpaymentinfo'],
51
+ ['Search', 'search'],
52
+ ['Lead', 'lead'],
53
+ ['SignUp', 'signup'],
54
+ ['Subscribe', 'lead'],
55
+ ['WatchVideo', 'watchvideo'],
56
+ ]);
57
+ const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
68
58
  const getProductIds = (item, productIdMapping) => {
69
59
  var _a, _b;
70
60
  if (productIdMapping === '1') {
@@ -145,7 +135,7 @@ const prepareData = (data, idMapping) => {
145
135
  return payload;
146
136
  };
147
137
  const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
148
- const result = { sdkVersion: "1.30.2" };
138
+ const result = { sdkVersion: "1.31.0" };
149
139
  if (executionContext.get('pixelFired')) {
150
140
  return result;
151
141
  }
package/index.js CHANGED
@@ -39,33 +39,23 @@ var ProvidersPinterestSdk = (function () {
39
39
  window.pintrk('page');
40
40
  };
41
41
 
42
- const getPinterestEventName = (name) => {
43
- switch (name) {
44
- case 'Purchase': {
45
- return 'checkout';
46
- }
47
- case 'PageView':
48
- case 'ViewContent': {
49
- return 'pagevisit';
50
- }
51
- case 'AddToCart': {
52
- return 'addtocart';
53
- }
54
- case 'Search': {
55
- return 'search';
56
- }
57
- case 'Lead': {
58
- return 'lead';
59
- }
60
- case 'SignUp': {
61
- return 'signup';
62
- }
63
- case 'WatchVideo': {
64
- return 'watchvideo';
65
- }
66
- }
67
- return name;
68
- };
42
+ const pinterestEventMap = new Map([
43
+ ['Purchase', 'checkout'],
44
+ ['Checkout', 'checkout'],
45
+ ['InitiateCheckout', 'initiatecheckout'],
46
+ ['PageView', 'pagevisit'],
47
+ ['ViewContent', 'viewcontent'],
48
+ ['ViewCategory', 'viewcategory'],
49
+ ['AddToCart', 'addtocart'],
50
+ ['AddToWishlist', 'addtowishlist'],
51
+ ['AddPaymentInfo', 'addpaymentinfo'],
52
+ ['Search', 'search'],
53
+ ['Lead', 'lead'],
54
+ ['SignUp', 'signup'],
55
+ ['Subscribe', 'lead'],
56
+ ['WatchVideo', 'watchvideo'],
57
+ ]);
58
+ const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
69
59
  const getProductIds = (item, productIdMapping) => {
70
60
  var _a, _b;
71
61
  if (productIdMapping === '1') {
@@ -146,7 +136,7 @@ var ProvidersPinterestSdk = (function () {
146
136
  return payload;
147
137
  };
148
138
  const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
149
- const result = { sdkVersion: "1.30.2" };
139
+ const result = { sdkVersion: "1.31.0" };
150
140
  if (executionContext.get('pixelFired')) {
151
141
  return result;
152
142
  }
package/index.mjs CHANGED
@@ -36,33 +36,23 @@ const init = ({ manifest }) => {
36
36
  window.pintrk('page');
37
37
  };
38
38
 
39
- const getPinterestEventName = (name) => {
40
- switch (name) {
41
- case 'Purchase': {
42
- return 'checkout';
43
- }
44
- case 'PageView':
45
- case 'ViewContent': {
46
- return 'pagevisit';
47
- }
48
- case 'AddToCart': {
49
- return 'addtocart';
50
- }
51
- case 'Search': {
52
- return 'search';
53
- }
54
- case 'Lead': {
55
- return 'lead';
56
- }
57
- case 'SignUp': {
58
- return 'signup';
59
- }
60
- case 'WatchVideo': {
61
- return 'watchvideo';
62
- }
63
- }
64
- return name;
65
- };
39
+ const pinterestEventMap = new Map([
40
+ ['Purchase', 'checkout'],
41
+ ['Checkout', 'checkout'],
42
+ ['InitiateCheckout', 'initiatecheckout'],
43
+ ['PageView', 'pagevisit'],
44
+ ['ViewContent', 'viewcontent'],
45
+ ['ViewCategory', 'viewcategory'],
46
+ ['AddToCart', 'addtocart'],
47
+ ['AddToWishlist', 'addtowishlist'],
48
+ ['AddPaymentInfo', 'addpaymentinfo'],
49
+ ['Search', 'search'],
50
+ ['Lead', 'lead'],
51
+ ['SignUp', 'signup'],
52
+ ['Subscribe', 'lead'],
53
+ ['WatchVideo', 'watchvideo'],
54
+ ]);
55
+ const getPinterestEventName = (name) => { var _a; return (_a = pinterestEventMap.get(name)) !== null && _a !== void 0 ? _a : name; };
66
56
  const getProductIds = (item, productIdMapping) => {
67
57
  var _a, _b;
68
58
  if (productIdMapping === '1') {
@@ -143,7 +133,7 @@ const prepareData = (data, idMapping) => {
143
133
  return payload;
144
134
  };
145
135
  const tag = ({ data, eventName, manifestVariables, eventId, executionContext, }) => {
146
- const result = { sdkVersion: "1.30.2" };
136
+ const result = { sdkVersion: "1.31.0" };
147
137
  if (executionContext.get('pixelFired')) {
148
138
  return result;
149
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-pinterest-sdk",
3
- "version": "1.30.2",
3
+ "version": "1.31.0",
4
4
  "description": "Pinterest Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",