@hiver/connector-agent 4.14.0-userauth-beta.0 → 4.14.0-userlevelauth-beta.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.
package/index.umd.js CHANGED
@@ -1342,7 +1342,7 @@ Do you want to continue?`,nw="Select an object to create",rw="Select an object t
1342
1342
  color: ${((sh=l.theme.palette.common)==null?void 0:sh.white)??"#FFFFFF"};
1343
1343
  opacity: 0.55;
1344
1344
  }
1345
- `,hI=({color:e="#5C6470",size:t=22})=>u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[u.jsx("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3z",fill:e}),u.jsx("path",{d:"M21 9l-3.99-4v3H10v2h7.01v3L21 9z",fill:e})]}),gI=({connectorId:e,connectorName:t,connectorLogo:n,variant:r,reason:o,onConnected:s})=>{var y,C;const{connect:a}=iI(e,{onConnected:s}),i=I.useCallback(()=>{a()},[a]);if(r==="connected")return null;const c=r==="reauth_required"||r==="workspace_mismatch",d={disconnected:{title:`Sign in to use ${t}`,body:"Connect your account to view details directly from your inbox.",cta:"Authenticate"},in_progress:{title:`Connecting to ${t}`,body:"Complete authentication in the new window.",cta:"Authenticating…"},reauth_required:{title:"Authentication failed",body:"We couldn't verify your credentials. Please try signing in again.",cta:"Re-authenticate"},workspace_mismatch_workspace:{title:"Workspace access required",body:`Your ${t} account doesn't have access to the workspace your admin connected. Reconnect using an account with the right access.`,cta:"Re-authenticate"},workspace_mismatch_site:{title:"Site access required",body:`Your ${t} account doesn't have access to the site your admin connected. Reconnect using an account with the right access.`,cta:"Re-authenticate"},workspace_mismatch_generic:{title:"Access required",body:`Your ${t} account doesn't have the access your admin set up. Reconnect with the right account.`,cta:"Re-authenticate"},unknown:{title:`Sign in to use ${t}`,body:"Connect your account to view details directly from your inbox.",cta:"Authenticate"}};let f=r;r==="workspace_mismatch"&&(o==="site_access_denied"?f="workspace_mismatch_site":o==="workspace_mismatch"?f="workspace_mismatch_workspace":f="workspace_mismatch_generic");const g=d[f]??d.disconnected;return u.jsxs(lI,{children:[u.jsx(uI,{children:u.jsxs(dI,{children:[u.jsx(B1,{src:$w,alt:"Hiver"}),u.jsx(hI,{color:((y=l.theme.palette.gray)==null?void 0:y.gray3)??"#5C6470"}),u.jsxs(l.Stack,{sx:{position:"relative"},children:[u.jsx(B1,{src:n,alt:t}),c&&u.jsx(fI,{"aria-label":"error",children:"!"})]})]})}),u.jsxs(l.Stack,{gap:.5,alignItems:"center",sx:{padding:"0 8px",textAlign:"center"},children:[u.jsx(l.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:g.title}),u.jsx(l.Typography,{variant:"body2",sx:{color:(C=l.theme.palette.gray)==null?void 0:C.gray3},children:g.body})]}),u.jsx(pI,{variant:"contained",onClick:i,disabled:r==="in_progress",disableElevation:!0,children:g.cta})]})},mI=({card:e,email:t,specificCardData:n,specificConnectorApiStatus:r,defaultOpenState:o,onCardUnlinking:s})=>{const a=Cn(),i=e.connectorId??"",c=!!e.userAuthEnabled&&!!i;cI(i,c);const d=Ce(f=>P1(f,i));return c?d.state==="unknown"||d.state==="connected"?u.jsx(N1,{card:e,specificCardData:n,email:t,defaultOpenState:o,specificConnectorApiStatus:r,onCardUnlinking:s}):u.jsx(gI,{connectorId:i,connectorName:e.connectorName??e.title,connectorLogo:e.logoUrl??"",variant:d.state,reason:d.reason,onConnected:()=>{a.invalidateQueries({queryKey:["connectorCard",i]}),a.invalidateQueries({queryKey:["cards",i]})}}):u.jsx(N1,{card:e,specificCardData:n,email:t,defaultOpenState:o,specificConnectorApiStatus:r,onCardUnlinking:s})},bI=Number.MAX_SAFE_INTEGER,yI=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=I.useContext(He),i=nt(s,Q4)?bI:1;return u.jsx(l.Box,{flexGrow:1,children:e.map((c,d)=>{const{id:f,externalResourceId:g}=c;let y=f;return g&&(y=`${y}_${g}`),u.jsx("div",{children:u.jsx(mI,{card:c,specificCardData:n,email:t??"",defaultOpenState:d<i,specificConnectorApiStatus:r,onCardUnlinking:o})},y)})})},V1=e=>T.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),T.createElement("g",{filter:"url(#filter0_d_360_39563)"},T.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),T.createElement("g",{filter:"url(#filter1_d_360_39563)"},T.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),T.createElement("defs",null,T.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),T.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.createElement("feOffset",null),T.createElement("feGaussianBlur",{stdDeviation:.533333}),T.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),T.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),T.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),T.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),T.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.createElement("feOffset",null),T.createElement("feGaussianBlur",{stdDeviation:.533333}),T.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),T.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),T.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),xI=({color:e="#5C6470",size:t=26})=>u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[u.jsx("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3z",fill:e}),u.jsx("path",{d:"M21 9l-3.99-4v3H10v2h7.01v3L21 9z",fill:e})]}),CI=()=>{var r,o,s;const e=Ce(oI),t=Ce(y1),n=I.useMemo(()=>{if(!(!e||!t))return t.find(a=>a.id===e||a.connectorId===e)},[e,t]);return e?u.jsx(Zn,{shown:!0,setShown:()=>{},showCloseButton:!1,borderRadius:12,children:u.jsxs(l.Stack,{sx:{padding:"32px 48px",alignItems:"center",gap:3,minWidth:"320px",background:((r=l.theme.palette.purple)==null?void 0:r.light)??"#FAF5FE"},children:[u.jsxs(l.Stack,{direction:"row",alignItems:"center",gap:2,children:[u.jsx(V1,{width:48,height:48}),u.jsx(xI,{color:((o=l.theme.palette.gray)==null?void 0:o.gray3)??"#5C6470"}),(n==null?void 0:n.logoUrl)&&u.jsx("img",{src:n.logoUrl,alt:n.connectorName??"",width:48,height:48,style:{borderRadius:8}})]}),u.jsxs(l.Stack,{gap:.5,alignItems:"center",children:[u.jsx(l.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:"Connection in progress"}),u.jsx(l.Typography,{variant:"body2",sx:{color:(s=l.theme.palette.gray)==null?void 0:s.gray3},children:"Complete authentication in the new window"})]})]})}):null},uo=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function Sn({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}uo.CaseView=Sn;const EI="Bring your favourite tools into Hiver",vI="Plugin image",wI="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",II="Enable Connectors",_I="Enable Apps",SI="Enable Cards",AI="Learn more",TI="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",LI="Contact your admin to enable this",OI="https://youtu.be/ODcJnzZLb50",kI="connectors-module/assets/connectors-images/connector-mainpage.png",FI="connectors-module/assets/connectors-images/connector-mainpage-apps.png",DI="Explore connectors",NI="Connectors",RI=l.styled(l.Box)`
1345
+ `,hI=({color:e="#5C6470",size:t=22})=>u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[u.jsx("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3z",fill:e}),u.jsx("path",{d:"M21 9l-3.99-4v3H10v2h7.01v3L21 9z",fill:e})]}),gI=({connectorId:e,connectorName:t,connectorLogo:n,variant:r,reason:o,onConnected:s})=>{var y,C;const{connect:a}=iI(e,{onConnected:s}),i=I.useCallback(()=>{a()},[a]);if(r==="connected")return null;const c=r==="reauth_required"||r==="workspace_mismatch",d={disconnected:{title:`Sign in to use ${t}`,body:"Connect your account to view details directly from your inbox.",cta:"Authenticate"},in_progress:{title:`Connecting to ${t}`,body:"Complete authentication in the new window.",cta:"Authenticating…"},reauth_required:{title:"Authentication failed",body:"We couldn't verify your credentials. Please try signing in again.",cta:"Re-authenticate"},workspace_mismatch_workspace:{title:"Workspace access required",body:`Your ${t} account doesn't have access to the workspace your admin connected. Reconnect using an account with the right access.`,cta:"Re-authenticate"},workspace_mismatch_site:{title:"Site access required",body:`Your ${t} account doesn't have access to the site your admin connected. Reconnect using an account with the right access.`,cta:"Re-authenticate"},workspace_mismatch_generic:{title:"Access required",body:`Your ${t} account doesn't have the access your admin set up. Reconnect with the right account.`,cta:"Re-authenticate"},unknown:{title:`Sign in to use ${t}`,body:"Connect your account to view details directly from your inbox.",cta:"Authenticate"}};let f=r;r==="workspace_mismatch"&&(o==="site_access_denied"?f="workspace_mismatch_site":o==="workspace_mismatch"?f="workspace_mismatch_workspace":f="workspace_mismatch_generic");const g=d[f]??d.disconnected;return u.jsxs(lI,{children:[u.jsx(uI,{children:u.jsxs(dI,{children:[u.jsx(B1,{src:$w,alt:"Hiver"}),u.jsx(hI,{color:((y=l.theme.palette.gray)==null?void 0:y.gray3)??"#5C6470"}),u.jsxs(l.Stack,{sx:{position:"relative"},children:[u.jsx(B1,{src:n,alt:t}),c&&u.jsx(fI,{"aria-label":"error",children:"!"})]})]})}),u.jsxs(l.Stack,{gap:.5,alignItems:"center",sx:{padding:"0 8px",textAlign:"center"},children:[u.jsx(l.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:g.title}),u.jsx(l.Typography,{variant:"body2",sx:{color:(C=l.theme.palette.gray)==null?void 0:C.gray3},children:g.body})]}),u.jsx(pI,{variant:"contained",onClick:i,disabled:r==="in_progress",disableElevation:!0,children:g.cta})]})},mI=({card:e,email:t,specificCardData:n,specificConnectorApiStatus:r,defaultOpenState:o,onCardUnlinking:s,isPrimaryUserAuthCard:a=!0})=>{const i=Cn(),c=e.connectorId??"",d=!!e.userAuthEnabled&&!!c;cI(c,d);const f=Ce(g=>P1(g,c));return d?f.state==="unknown"||f.state==="connected"?u.jsx(N1,{card:e,specificCardData:n,email:t,defaultOpenState:o,specificConnectorApiStatus:r,onCardUnlinking:s}):a?u.jsx(gI,{connectorId:c,connectorName:e.connectorName??e.title,connectorLogo:e.logoUrl??"",variant:f.state,reason:f.reason,onConnected:()=>{i.invalidateQueries({queryKey:["connectorCard",c]}),i.invalidateQueries({queryKey:["cards",c]})}}):null:u.jsx(N1,{card:e,specificCardData:n,email:t,defaultOpenState:o,specificConnectorApiStatus:r,onCardUnlinking:s})},bI=Number.MAX_SAFE_INTEGER,yI=({cards:e,email:t,specificCardData:n,specificConnectorApiStatus:r,onCardUnlinking:o})=>{const{availableFeatures:s}=I.useContext(He),i=nt(s,Q4)?bI:1,c=new Map;return e.forEach(d=>{d.userAuthEnabled&&d.connectorId&&!c.has(d.connectorId)&&c.set(d.connectorId,d.id)}),u.jsx(l.Box,{flexGrow:1,children:e.map((d,f)=>{const{id:g,externalResourceId:y}=d;let C=g;return y&&(C=`${C}_${y}`),u.jsx("div",{children:u.jsx(mI,{card:d,specificCardData:n,email:t??"",defaultOpenState:f<i,specificConnectorApiStatus:r,onCardUnlinking:o,isPrimaryUserAuthCard:!d.connectorId||c.get(d.connectorId)===d.id})},C)})})},V1=e=>T.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),T.createElement("g",{filter:"url(#filter0_d_360_39563)"},T.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),T.createElement("g",{filter:"url(#filter1_d_360_39563)"},T.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),T.createElement("defs",null,T.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),T.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.createElement("feOffset",null),T.createElement("feGaussianBlur",{stdDeviation:.533333}),T.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),T.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),T.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),T.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),T.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.createElement("feOffset",null),T.createElement("feGaussianBlur",{stdDeviation:.533333}),T.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),T.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),T.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),xI=({color:e="#5C6470",size:t=26})=>u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[u.jsx("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3z",fill:e}),u.jsx("path",{d:"M21 9l-3.99-4v3H10v2h7.01v3L21 9z",fill:e})]}),CI=()=>{var r,o,s;const e=Ce(oI),t=Ce(y1),n=I.useMemo(()=>{if(!(!e||!t))return t.find(a=>a.id===e||a.connectorId===e)},[e,t]);return e?u.jsx(Zn,{shown:!0,setShown:()=>{},showCloseButton:!1,borderRadius:12,children:u.jsxs(l.Stack,{sx:{padding:"32px 48px",alignItems:"center",gap:3,minWidth:"320px",background:((r=l.theme.palette.purple)==null?void 0:r.light)??"#FAF5FE"},children:[u.jsxs(l.Stack,{direction:"row",alignItems:"center",gap:2,children:[u.jsx(V1,{width:48,height:48}),u.jsx(xI,{color:((o=l.theme.palette.gray)==null?void 0:o.gray3)??"#5C6470"}),(n==null?void 0:n.logoUrl)&&u.jsx("img",{src:n.logoUrl,alt:n.connectorName??"",width:48,height:48,style:{borderRadius:8}})]}),u.jsxs(l.Stack,{gap:.5,alignItems:"center",children:[u.jsx(l.Typography,{variant:"subtitle1",sx:{fontWeight:600},children:"Connection in progress"}),u.jsx(l.Typography,{variant:"body2",sx:{color:(s=l.theme.palette.gray)==null?void 0:s.gray3},children:"Complete authentication in the new window"})]})]})}):null},uo=({children:e})=>{if(!Array.isArray(e))return e;let t=null;return e.find(r=>typeof(r==null?void 0:r.type)!="function"?!1:(r.props.fallback&&(t=r),r.props.condition))??t};function Sn({children:e,condition:t,fallback:n=!1}){return!t&&!n?null:e}uo.CaseView=Sn;const EI="Bring your favourite tools into Hiver",vI="Plugin image",wI="Integrate tools like Salesforce, HubSpot, and Shopify to boost productivity",II="Enable Connectors",_I="Enable Apps",SI="Enable Cards",AI="Learn more",TI="https://help.hiverhq.com/custom-connectors/hiver-s-custom-connectors",LI="Contact your admin to enable this",OI="https://youtu.be/ODcJnzZLb50",kI="connectors-module/assets/connectors-images/connector-mainpage.png",FI="connectors-module/assets/connectors-images/connector-mainpage-apps.png",DI="Explore connectors",NI="Connectors",RI=l.styled(l.Box)`
1346
1346
  padding-top: 20px;
1347
1347
  `,MI=l.styled(l.Stack)`
1348
1348
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "4.14.0-userauth-beta.0",
3
+ "version": "4.14.0-userlevelauth-beta.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",