ha-nitrous-personalization 0.0.8 → 0.0.9
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.
- package/dist/cjs/{CS-I99k3.cjs → Bj5G2GlY.cjs} +1 -1
- package/dist/cjs/{Cpvude1L.cjs → DVLTyyhb.cjs} +1 -1
- package/dist/cjs/{fy0r-ppP.cjs → W2Pd_QS1.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/{C80AuR1w.js → Cdl0Vdv7.js} +1 -1
- package/dist/esm/{C6QPIeZz.js → CsXhIrP0.js} +1 -1
- package/dist/esm/{Wumphm1E.js → DEvFfClt.js} +7 -4
- package/dist/esm/index.js +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./W2Pd_QS1.cjs"),r=require("./D8aAR90g.cjs"),s=({brand:e,contentType:t,model:i})=>{const a=o.usePersonalizationData({brand:e,contentType:t,model:i});return n.jsx(r.PersonalizationGrid,{data:a})};exports.PersonalizationWidget=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=async(o,e)=>{try{if(!e)return;const a=new URLSearchParams(e),t=await(await fetch(`https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/personalization?${a.toString()}`,{method:"GET"})).json();if(t.error)throw new Error(`Failed to fetch personalization data: ${JSON.stringify(t.error)}`);return t}catch{}};exports.getPersonalizationData=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=async(o,e)=>{try{if(!e)return;const a=new URLSearchParams(e),t=await(await fetch(`https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/personalization?${a.toString()}`,{headers:{"X-API-Key":"WaHItmO5Oq9Veq4GjA5ty31pUCkZjtG98Aywra3D"},method:"GET"})).json();if(t.error)throw new Error(`Failed to fetch personalization data: ${JSON.stringify(t.error)}`);return t}catch{}};exports.getPersonalizationData=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./DVLTyyhb.cjs"),f=require("./BwR_6yUe.cjs"),l=require("./jsr503aW.cjs"),c=require("react"),d=({brand:e,contentType:t="article",model:a="recommended-for-you"})=>{const[n,r]=c.useState(void 0);return c.useEffect(()=>{(async()=>{if(t&&a&&e){const i=f.useCaseMap[a],s=l.getDeviceId();if(console.log("fetching data",i,s),s){const o=await u.getPersonalizationData("421efbf3760c201c62c2eddb51fbbe3b",{brand:e,type:t,useCase:i,userId:s});console.log("data",o),o&&r(o)}}})()},[e,t,a]),n};exports.usePersonalizationData=d;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./Bj5G2GlY.cjs"),e=require("./W2Pd_QS1.cjs"),t=require("./DVLTyyhb.cjs");exports.PersonalizationWidget=a.PersonalizationWidget;exports.usePersonalizationData=e.usePersonalizationData;exports.getPersonalizationData=t.getPersonalizationData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPersonalizationData as f } from "./
|
|
1
|
+
import { getPersonalizationData as f } from "./DEvFfClt.js";
|
|
2
2
|
import { useCaseMap as n } from "./FkYTBHnm.js";
|
|
3
3
|
import { getDeviceId as d } from "./BTMNbCyp.js";
|
|
4
4
|
import { useState as m, useEffect as u } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { usePersonalizationData as n } from "./
|
|
2
|
+
import { usePersonalizationData as n } from "./Cdl0Vdv7.js";
|
|
3
3
|
import { PersonalizationGrid as e } from "./DYPQQ1rv.js";
|
|
4
4
|
const l = ({ brand: o, contentType: t, model: a }) => {
|
|
5
5
|
const r = n({
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
const n = async (r,
|
|
1
|
+
const n = async (r, e) => {
|
|
2
2
|
try {
|
|
3
|
-
if (!
|
|
3
|
+
if (!e)
|
|
4
4
|
return;
|
|
5
|
-
const
|
|
6
|
-
`https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/personalization?${
|
|
5
|
+
const a = new URLSearchParams(e), t = await (await fetch(
|
|
6
|
+
`https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/personalization?${a.toString()}`,
|
|
7
7
|
{
|
|
8
|
+
headers: {
|
|
9
|
+
"X-API-Key": "WaHItmO5Oq9Veq4GjA5ty31pUCkZjtG98Aywra3D"
|
|
10
|
+
},
|
|
8
11
|
method: "GET"
|
|
9
12
|
}
|
|
10
13
|
)).json();
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PersonalizationWidget as t } from "./
|
|
2
|
-
import { usePersonalizationData as r } from "./
|
|
3
|
-
import { getPersonalizationData as n } from "./
|
|
1
|
+
import { PersonalizationWidget as t } from "./CsXhIrP0.js";
|
|
2
|
+
import { usePersonalizationData as r } from "./Cdl0Vdv7.js";
|
|
3
|
+
import { getPersonalizationData as n } from "./DEvFfClt.js";
|
|
4
4
|
export {
|
|
5
5
|
t as PersonalizationWidget,
|
|
6
6
|
n as getPersonalizationData,
|