@mindful-web/marko-web-omeda-identity-x 1.69.3 → 1.69.5
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-omeda-identity-x$1.69.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-omeda-identity-x$1.69.5/components/identify.marko",
|
|
6
6
|
marko_component = require("./identify.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_getCookieId = require("@mindful-web/marko-web-omeda-identity-x/utils/get-cookie-id"),
|
|
@@ -51,7 +51,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
51
51
|
}, marko_component);
|
|
52
52
|
|
|
53
53
|
marko_template.meta = {
|
|
54
|
-
id: "/@mindful-web/marko-web-omeda-identity-x$1.69.
|
|
54
|
+
id: "/@mindful-web/marko-web-omeda-identity-x$1.69.5/components/identify.marko",
|
|
55
55
|
component: "./identify.marko",
|
|
56
56
|
tags: [
|
|
57
57
|
"@mindful-web/marko-web-identity-x/components/identify.marko",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const { get } = require('@mindful-web/object-path');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns a promo code string based on the login source and event data.
|
|
5
|
+
* Pass brand-specific suffix overrides for any of the structured params
|
|
6
|
+
* (e.g. `contentMeterLogin`, `contentGate`) to customize generated codes
|
|
7
|
+
* without changing the shared function.
|
|
8
|
+
*
|
|
9
|
+
* @param {object} params
|
|
10
|
+
* @param {string} params.loginSource
|
|
11
|
+
* @param {object} [params.data={}]
|
|
12
|
+
* @param {string} [params.defaultPromoCode='Default']
|
|
13
|
+
* @param {string} [params.promoCodePrefix='P1']
|
|
14
|
+
* @param {object} [params.newsletterSignup]
|
|
15
|
+
* @param {string} [params.comments='Comments']
|
|
16
|
+
* @param {object} [params.contentMeterLogin]
|
|
17
|
+
* @param {string} [params.contentGate='HardGate']
|
|
18
|
+
* @param {object} [params.req]
|
|
19
|
+
* @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
module.exports = ({
|
|
22
|
+
loginSource,
|
|
23
|
+
data = {},
|
|
24
|
+
defaultPromoCode = 'Default',
|
|
25
|
+
promoCodePrefix = 'P1',
|
|
26
|
+
newsletterSignup = {
|
|
27
|
+
pushdown: 'eNLPushdown',
|
|
28
|
+
inlineContent: 'eNLInline',
|
|
29
|
+
inlineSection: 'eNLInline',
|
|
30
|
+
footer: 'eNLFooter',
|
|
31
|
+
default: 'eNL',
|
|
32
|
+
},
|
|
33
|
+
comments = 'Comments',
|
|
34
|
+
contentMeterLogin = {
|
|
35
|
+
default: 'Meter',
|
|
36
|
+
overlay: 'MeterGate',
|
|
37
|
+
},
|
|
38
|
+
contentGate = 'HardGate',
|
|
39
|
+
req,
|
|
40
|
+
}) => {
|
|
41
|
+
if (get(req, 'cookies.omeda_promo_code')) return get(req, 'cookies.omeda_promo_code');
|
|
42
|
+
switch (loginSource) {
|
|
43
|
+
case 'newsletterSignup':
|
|
44
|
+
if (data.newsletterSignupType === 'pushdown') return `${promoCodePrefix}${newsletterSignup.pushdown}`;
|
|
45
|
+
if (data.newsletterSignupType === 'inlineContent') return `${promoCodePrefix}${newsletterSignup.inlineContent}`;
|
|
46
|
+
if (data.newsletterSignupType === 'inlineSection') return `${promoCodePrefix}${newsletterSignup.inlineSection}`;
|
|
47
|
+
if (data.newsletterSignupType === 'footer') return `${promoCodePrefix}${newsletterSignup.footer}`;
|
|
48
|
+
return `${promoCodePrefix}${newsletterSignup.default}`;
|
|
49
|
+
case 'comments':
|
|
50
|
+
return `${promoCodePrefix}${comments}`;
|
|
51
|
+
case 'content_meter_login':
|
|
52
|
+
if (data.displayOverlay) return `${promoCodePrefix}${contentMeterLogin.overlay}`;
|
|
53
|
+
return `${promoCodePrefix}${contentMeterLogin.default}`;
|
|
54
|
+
case 'contentGate':
|
|
55
|
+
return `${promoCodePrefix}${contentGate}`;
|
|
56
|
+
default:
|
|
57
|
+
return `${promoCodePrefix}${defaultPromoCode}`;
|
|
58
|
+
}
|
|
59
|
+
};
|
package/omeda-data/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const getEncryptedOmedaId = require('./get-encrypted-omeda-id');
|
|
|
4
4
|
const getOmedaCustomerRecord = require('./get-omeda-customer-record');
|
|
5
5
|
const getOmedaLinkedFields = require('./get-omeda-linked-fields');
|
|
6
6
|
const getOmedaSubscriptionIds = require('./get-omeda-subscription-ids');
|
|
7
|
+
const getPromoCodeFor = require('./get-promo-code-for');
|
|
7
8
|
const setOmedaData = require('./set-omeda-data');
|
|
8
9
|
const setOmedaDemographics = require('./set-omeda-demographics');
|
|
9
10
|
const setOmedaDeploymentTypes = require('./set-omeda-deployment-types');
|
|
@@ -17,6 +18,7 @@ module.exports = {
|
|
|
17
18
|
getOmedaCustomerRecord,
|
|
18
19
|
getOmedaLinkedFields,
|
|
19
20
|
getOmedaSubscriptionIds,
|
|
21
|
+
getPromoCodeFor,
|
|
20
22
|
setOmedaData,
|
|
21
23
|
setOmedaDemographics,
|
|
22
24
|
setOmedaDeploymentTypes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindful-web/marko-web-omeda-identity-x",
|
|
3
|
-
"version": "1.69.
|
|
3
|
+
"version": "1.69.5",
|
|
4
4
|
"description": "Marko Omeda+IdentityX integration tools",
|
|
5
5
|
"repository": "https://github.com/parameter1/mindful-web/tree/main/packages/marko-web-omeda-identity-x",
|
|
6
6
|
"author": "Josh Worden <josh@parameter1.com>",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test": "yarn compile --no-clean && yarn lint"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@mindful-web/marko-web-identity-x": "^1.
|
|
16
|
+
"@mindful-web/marko-web-identity-x": "^1.69.5",
|
|
17
17
|
"@mindful-web/marko-web-omeda": "^1.57.0",
|
|
18
18
|
"@mindful-web/object-path": "^1.57.0",
|
|
19
19
|
"@mindful-web/utils": "^1.57.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "e767ed8a0bacbf6dcf8c15519ed19d2b2e0f3849"
|
|
33
33
|
}
|