ha-nitrous-personalization 0.0.4 → 0.0.6
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/BeqztCOC.cjs +1 -0
- package/dist/cjs/{DUOWEPPk.cjs → CS4eNOMH.cjs} +1 -1
- package/dist/cjs/{DrtFMAn_.cjs → DAUZX0HE.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/6vLCTazk.js +21 -0
- package/dist/esm/{DbRLS8rI.js → DpdbaNZo.js} +1 -1
- package/dist/esm/{CzNdIE9n.js → DvFD-88W.js} +1 -1
- package/dist/esm/index.js +6 -4
- package/package.json +3 -3
- package/dist/cjs/CzA4yy-l.cjs +0 -1
- package/dist/esm/BUU6fvy1.js +0 -24
|
@@ -0,0 +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://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 +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("./BeqztCOC.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;
|
|
@@ -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("./CS4eNOMH.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;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./DAUZX0HE.cjs"),e=require("./CS4eNOMH.cjs"),t=require("./BeqztCOC.cjs");exports.PersonalizationWidget=a.PersonalizationWidget;exports.usePersonalizationData=e.usePersonalizationData;exports.getPersonalizationData=t.getPersonalizationData;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const n = async (r, a) => {
|
|
2
|
+
try {
|
|
3
|
+
if (!a)
|
|
4
|
+
return;
|
|
5
|
+
const e = new URLSearchParams(a), t = await (await fetch(
|
|
6
|
+
`https://https://eq47czqy1l.execute-api.us-west-2.amazonaws.com/v1/personalization?${e.toString()}`,
|
|
7
|
+
{
|
|
8
|
+
method: "GET"
|
|
9
|
+
}
|
|
10
|
+
)).json();
|
|
11
|
+
if (t.error)
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Failed to fetch personalization data: ${JSON.stringify(t.error)}`
|
|
14
|
+
);
|
|
15
|
+
return t;
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
n as getPersonalizationData
|
|
21
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPersonalizationData as f } from "./
|
|
1
|
+
import { getPersonalizationData as f } from "./6vLCTazk.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 "./DpdbaNZo.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({
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { PersonalizationWidget as
|
|
2
|
-
import {
|
|
1
|
+
import { PersonalizationWidget as t } from "./DvFD-88W.js";
|
|
2
|
+
import { usePersonalizationData as r } from "./DpdbaNZo.js";
|
|
3
|
+
import { getPersonalizationData as n } from "./6vLCTazk.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
t as PersonalizationWidget,
|
|
6
|
+
n as getPersonalizationData,
|
|
7
|
+
r as usePersonalizationData
|
|
6
8
|
};
|
package/package.json
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"vite-bundle-visualizer": "~1.2.1",
|
|
15
15
|
"vite-plugin-dts": "~4.5.3",
|
|
16
16
|
"vite-tsconfig-paths": "^5.1.4",
|
|
17
|
-
"@motortrend/
|
|
18
|
-
"@motortrend/
|
|
17
|
+
"@motortrend/eslint-plugin-nitrous": "0.0.12",
|
|
18
|
+
"@motortrend/prettier-config-nitrous": "0.0.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=19",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"type": "module",
|
|
44
|
-
"version": "0.0.
|
|
44
|
+
"version": "0.0.6",
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsc --noEmit && vite build",
|
|
47
47
|
"build:analyze": "vite-bundle-visualizer",
|
package/dist/cjs/CzA4yy-l.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=async(a,t)=>{try{if(!t)return;const r=new URLSearchParams(t),e=await(await fetch(`https://ha-personalize-api.kubeprod.hearstapps.com/recommendations?${r.toString()}`,{headers:{"api-key":a},method:"GET"})).json();if(e.error)throw new Error(`Failed to fetch personalization data: ${JSON.stringify(e.error)}`);return e}catch{}};exports.getPersonalizationData=o;
|
package/dist/esm/BUU6fvy1.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const n = async (t, e) => {
|
|
2
|
-
try {
|
|
3
|
-
if (!e)
|
|
4
|
-
return;
|
|
5
|
-
const a = new URLSearchParams(e), r = await (await fetch(
|
|
6
|
-
`https://ha-personalize-api.kubeprod.hearstapps.com/recommendations?${a.toString()}`,
|
|
7
|
-
{
|
|
8
|
-
headers: {
|
|
9
|
-
"api-key": t
|
|
10
|
-
},
|
|
11
|
-
method: "GET"
|
|
12
|
-
}
|
|
13
|
-
)).json();
|
|
14
|
-
if (r.error)
|
|
15
|
-
throw new Error(
|
|
16
|
-
`Failed to fetch personalization data: ${JSON.stringify(r.error)}`
|
|
17
|
-
);
|
|
18
|
-
return r;
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
n as getPersonalizationData
|
|
24
|
-
};
|