aiware-js 1.0.0-master.749 → 1.0.0-master.750

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/js-core.esm.js CHANGED
@@ -1483,4 +1483,4 @@ createScheduledJob(input:{
1483
1483
  }
1484
1484
  `)}),n},[]).join("\r\n")}
1485
1485
  }
1486
- `,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$i(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$i(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$4.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$4.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$4.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$4.dispatch(logout())},1e3)):store$4.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$4.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$4.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$4.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$4.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$4.addModule(r),n},unmountPanel=e=>(store$4.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$4.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$4.dispatch(unmountAllPanel$1(""))};function init(e,t){var n;validateConfig(e)&&(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$4.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t}))))}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$4),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$4,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$4,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"15b473b55",releaseDate:"2023-07-27T18:30:01.605Z"});export{createReducer as $,AIWareIntlProvider as A,Box$1 as B,FormControl$1 as C,TextField$1 as D,classNames as E,FormattedMessage$1 as F,Grid$1 as G,resetPasswordRequest as H,InputLabel$1 as I,InputAdornment$1 as J,IconButton$1 as K,LoadingButton$1 as L,Select$1 as M,Location as N,OutlinedInput$1 as O,Provider$2 as P,MenuItem$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,Button$1 as U,Divider$1 as V,createTheme$1 as W,systemStyled as X,useThemeProps$1 as Y,createAction as Z,_extends$2 as _,generateUtilityClasses as a,Popper$1 as a$,createSlice as a0,ENGINE_OWNER_TYPES as a1,ENGINE_FILTER_TYPES as a2,DynamicModuleLoader as a3,preferredLanguageSelector as a4,baseUrlSelector as a5,rootApiSelector as a6,sessionTokenSelector as a7,graphEndpointSelector as a8,controllerNodeRedImageSelector as a9,fetchTemplateGallery as aA,isRevisionsExistOnServerRequest as aB,FormLabel$1 as aC,default_1$b as aD,FormGroup$1 as aE,FormControlLabel$1 as aF,Checkbox$1 as aG,fetchTemplateGalleryFallback as aH,Card$1 as aI,CardContent$1 as aJ,img$m as aK,CardActions$1 as aL,flowStyles as aM,NoResults as aN,CircularProgress$1 as aO,img$c as aP,Dialog$1 as aQ,setApiEndpoint as aR,TableContainer$1 as aS,Table$1 as aT,TableHead$1 as aU,TableRow$1 as aV,TableCell$1 as aW,TableSortLabel$1 as aX,TableBody$1 as aY,img$h as aZ,default_1 as a_,controllerUrlSelector as aa,automateControllerUrlSelector as ab,flowCenterDialogSelector as ac,automateUrlSelector as ad,Portal$1 as ae,flowCenterDialogReducer as af,List$2 as ag,ListItem$1 as ah,ListItemIcon$1 as ai,ListItemText$1 as aj,flowCenterDialogAction as ak,all as al,img$o as am,img$p as an,img$r as ao,img$s as ap,Tooltip$1 as aq,img$i as ar,img$H as as,Skeleton$1 as at,takeLatest$1 as au,fetchAllTags as av,put as aw,select as ax,fetchFlows as ay,call$i as az,styled$1 as b,FormHelperText$2 as b$,ClickAwayListener as b0,Fade$1 as b1,img$t as b2,img$q as b3,img$R as b4,img$D as b5,DialogTitle$1 as b6,DialogContent$1 as b7,DialogActions$1 as b8,Snackbar$1 as b9,React5 as bA,TransitionGroup$1 as bB,connect$1 as bC,Bookmark as bD,EngineFlagIcons as bE,createAsyncThunk as bF,withStyles as bG,getConfigModule as bH,getAuthModule as bI,getSnackbarModule as bJ,AIWareCacheProvider as bK,img$S as bL,img$e as bM,img$d as bN,isEmpty_1 as bO,Backdrop$1 as bP,getDefaultMiddleware as bQ,isNil_1 as bR,UpDown as bS,Icon$1 as bT,get_1 as bU,map_1 as bV,keys_1 as bW,RadioGroup$1 as bX,Avatar$1 as bY,img$x as bZ,baseGraphQLApi as b_,default_1$6 as ba,img$j as bb,img$l as bc,img$V as bd,Tabs$2 as be,Tab$2 as bf,deleteEngine as bg,fetchEngine as bh,img$k as bi,AIWareFormatMessage as bj,FormattedDate as bk,fetchVeritoneGraphQLApi as bl,useTheme as bm,KeyboardArrowRight as bn,KeyboardArrowLeft as bo,useId as bp,InputUnstyled as bq,isHostComponent as br,getDefaultExportFromNamespaceIfNotNamed as bs,commonjsRequire as bt,reactDom as bu,Transition$1 as bv,_defineProperty$1 as bw,__awaiter$d as bx,__generator$2 as by,__spread as bz,Paper$1 as c,isArray_1 as c$,img$g as c0,StyledEngineProvider as c1,ThemeProvider as c2,lightTheme$1 as c3,CssBaseline as c4,Hide as c5,has_1 as c6,showMessage as c7,MessageSeverity as c8,Radio$2 as c9,mountPanel$1 as cA,DialogContentText$1 as cB,userSelector$2 as cC,MoreVert$1 as cD,Menu$1 as cE,Edit as cF,Upload as cG,Delete as cH,CustomTabs as cI,useBackupImg as cJ,img$1A as cK,validate as cL,configSelector as cM,baseGraphQLApiWithError as cN,VerifiedFilled as cO,Add as cP,ExpandLess as cQ,ExpandMore as cR,Collapse$1 as cS,img$17 as cT,Filter$1 as cU,DynamicTable as cV,useTheme$3 as cW,getThemeProps as cX,useEnhancedEffect$1 as cY,React as cZ,_arrayPush as c_,createSvgIcon$2 as ca,_createCompounder as cb,_baseIteratee as cc,isArrayLike_1 as cd,toInteger_1 as ce,_typeof$4 as cf,_assertThisInitialized$1 as cg,_setPrototypeOf$3 as ch,_toPropertyKey as ci,_inheritsLoose$2 as cj,hoistNonReactStatics_cjs as ck,commonjsGlobal$1 as cl,combineReducers as cm,createSelector$1 as cn,fork as co,AIWareThemeProvider$1 as cp,Stack$4 as cq,Close$1 as cr,FullscreenExit as cs,Fullscreen as ct,TabPanel as cu,default_1$8 as cv,unmountPanel$1 as cw,AvailableComponents as cx,delay$1 as cy,hidePanel$1 as cz,capitalize$2 as d,_Symbol as d$,_baseToString as d0,_baseTrim as d1,_castSlice as d2,_stringToArray as d3,toString_1 as d4,ReactIs as d5,upperFirst_1 as d6,isString_1 as d7,_baseGet as d8,_baseSlice as d9,useTheme$2 as dA,useControlled as dB,useEventCallback as dC,ButtonBase$1 as dD,useForkRef as dE,getDefaultExportFromCjs as dF,_root as dG,isObject_1 as dH,MoreHor as dI,takeEvery$1 as dJ,EngineCategoryIcons as dK,selectApiConfigs$2 as dL,Chip$1 as dM,Badge$1 as dN,panelsSelector as dO,tabsClasses$1 as dP,AlarmTwo as dQ,EditList as dR,usePreviousProps$1 as dS,setRef as dT,inputClasses$1 as dU,inputBaseClasses$1 as dV,outlinedInputClasses$1 as dW,filledInputClasses$1 as dX,ClearIcon as dY,ArrowDropDownIcon as dZ,_arrayMap as d_,_castPath as da,_toKey as db,_isIndex as dc,channel$1 as dd,useIntl as de,VideoCamera as df,Image$1 as dg,Sound as dh,Description as di,toNumber_1 as dj,ProgressStepper as dk,size_1 as dl,take as dm,CurlyBraces as dn,UnknownDocument as dp,sdkEventManager as dq,SdkEvents as dr,SdkError as ds,EngineClassIcons as dt,Mode2 as du,EngineModeIcons as dv,DeploymentModelIcons as dw,guid as dx,forceReflow as dy,alpha as dz,_objectWithoutPropertiesLoose$2 as e,index as e$,isArguments_1 as e0,_baseEach as e1,_arrayFilter as e2,_getNative as e3,eq_1 as e4,_Uint8Array as e5,_overArg as e6,_isPrototype as e7,isObjectLike_1 as e8,_baseGetTag as e9,img$L as eA,img$1y as eB,img$K as eC,authSelector as eD,ListItemAvatar$1 as eE,emphasize as eF,useSlotProps as eG,_arraySome as eH,EntityType as eI,injectIntl as eJ,ErrorBoundary$1 as eK,EPermissionAction as eL,Process as eM,Information as eN,Download as eO,NewFolder as eP,SpecialFolder as eQ,User as eR,Source as eS,Search$1 as eT,selectIsOLPEnabled as eU,ListItemSecondaryAction$1 as eV,getLibraryModule as eW,cmsUrlSelector as eX,betaFeaturesSelector as eY,SearchStructuredData as eZ,Grow$1 as e_,_arrayLikeKeys as ea,isBuffer$3 as eb,isFunction_1 as ec,isTypedArray_1 as ed,_Stack as ee,_baseFor as ef,identity_1 as eg,_isIterateeCall as eh,isSymbol_1 as ei,_baseMap as ej,_baseUnary as ek,memoizeOne as el,createBox$1 as em,StepperContext$1 as en,StepContext$1 as eo,SvgIcon$1 as ep,StepConnector$1 as eq,_Set as er,_setToArray as es,_SetCache as et,_cacheHas as eu,img$O as ev,img$N as ew,img$1w as ex,img$1v as ey,img$1u as ez,clsx as f,SecurityGroup as f$,actions as f0,hasPermission as f1,UserAddFilled as f2,Popover$1 as f3,MenuList$1 as f4,MoveFolder as f5,EAuthResourceType as f6,Slide$1 as f7,img$a as f8,selectPanelByPanelName as f9,selectOrgId as fA,navSectionStyles as fB,selectIsUserAdmin as fC,AvatarGroup$1 as fD,ErrorState$2 as fE,NullState$2 as fF,Group as fG,PermissionChangedAction as fH,Lock as fI,useOrganizationPermissions as fJ,EAuthSubResourceType as fK,AddGroup as fL,initialConfigSelector as fM,ConfirmationModal as fN,EnumHelpers as fO,formatBytes as fP,LinearProgress$1 as fQ,NotInterested as fR,mountPanelForResponse$1 as fS,tableStyles as fT,ArrowDown as fU,ArrowUp as fV,useInterval as fW,Iam as fX,contextMenuStyles as fY,safeFormatMessage as fZ,Users as f_,FullScreenContainer as fa,isPermissionLoading as fb,Settings$2 as fc,Hamburger as fd,List as fe,convertEntityToAuthResource as ff,selectUserOrgEdgeVersion as fg,EditAttributes as fh,gqlIntrospection as fi,ProcessingDetail as fj,img$w as fk,img$y as fl,img$4 as fm,FilterRemove as fn,CheckCircle as fo,FolderOpen as fp,Voice as fq,useDoubleClick as fr,FolderFilled as fs,Time as ft,img$z as fu,Undefined as fv,PodcastSource as fw,YoutubeSource as fx,TVSource as fy,RadioSource as fz,generateUtilityClass as g,ArrowBack as g$,getOrganizationPanelModule as g0,Lock2 as g1,EApplicationConfigLevel as g2,NoApps as g3,EApplicationConfigType as g4,green$1 as g5,md5 as g6,selectIsSuperAdmin as g7,organizations_selector as g8,actions$5 as g9,compile as gA,Check as gB,FormattedRelativeTime$1 as gC,BottomQueue as gD,TopQueue as gE,Pause as gF,Cancel as gG,Folder as gH,Hidden as gI,setDuration as gJ,resetDuration as gK,toFinite_1 as gL,_baseForOwn as gM,_arrayReduce as gN,hasIn_1 as gO,useSyncExternalStoreExports as gP,getTabPanelWidthBySize as gQ,Packages as gR,Resources$1 as gS,selectUserCanCreatePackage as gT,Engines as gU,PackagesAvatar as gV,actionChannel as gW,cancelled as gX,flush$3 as gY,cancel as gZ,FlowCenter2 as g_,AddUser as ga,selectors as gb,LibraryDropdown as gc,Remove as gd,Save as ge,Input$3 as gf,getElement as gg,client$1 as gh,Copy as gi,ArrowForward as gj,Modal$1 as gk,_baseIsEqual as gl,Slider$1 as gm,_getSymbols as gn,stubArray_1 as go,_baseGetAllKeys as gp,_getTag as gq,_nodeUtil as gr,_getAllKeys as gs,_castFunction as gt,Article as gu,Task as gv,View as gw,_objectSpread2 as gx,serialize as gy,stringify$2 as gz,composeClasses as h,img$v as h0,FlowTemplate as h1,Schema as h2,registry as h3,registerComponent as h4,AvailableWidgets as h5,updatePanelMicroFrontendProps as h6,setData as h7,root as h8,mountWidget as h9,unmountWidget as ha,mountPanel as hb,unmountPanel as hc,hidePanel as hd,unmountAllPanel as he,init as hf,aiwareEvents as hg,createSvgIcon$1 as i,jsxRuntime as j,interopRequireDefault as k,Route as l,makeStyles as m,useDispatch as n,useSelector as o,authStatusSelector as p,authContextSelector as q,react as r,store$4 as s,AuthContext as t,useThemeProps as u,lodash as v,Alert$1 as w,useNavigate as x,useLocation as y,authErrorMessage as z};
1486
+ `,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$i(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$i(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$4.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$4.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$4.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$4.dispatch(logout())},1e3)):store$4.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$4.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$4},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$4.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$4.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$4.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$4.addModule(r),n},unmountPanel=e=>(store$4.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$4.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$4.dispatch(unmountAllPanel$1(""))};function init(e,t){var n;validateConfig(e)&&(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$4.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t}))))}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$4),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$4,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$4,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"f5cb1fd79",releaseDate:"2023-07-27T20:14:27.902Z"});export{createReducer as $,AIWareIntlProvider as A,Box$1 as B,FormControl$1 as C,TextField$1 as D,classNames as E,FormattedMessage$1 as F,Grid$1 as G,resetPasswordRequest as H,InputLabel$1 as I,InputAdornment$1 as J,IconButton$1 as K,LoadingButton$1 as L,Select$1 as M,Location as N,OutlinedInput$1 as O,Provider$2 as P,MenuItem$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,Button$1 as U,Divider$1 as V,createTheme$1 as W,systemStyled as X,useThemeProps$1 as Y,createAction as Z,_extends$2 as _,generateUtilityClasses as a,Popper$1 as a$,createSlice as a0,ENGINE_OWNER_TYPES as a1,ENGINE_FILTER_TYPES as a2,DynamicModuleLoader as a3,preferredLanguageSelector as a4,baseUrlSelector as a5,rootApiSelector as a6,sessionTokenSelector as a7,graphEndpointSelector as a8,controllerNodeRedImageSelector as a9,fetchTemplateGallery as aA,isRevisionsExistOnServerRequest as aB,FormLabel$1 as aC,default_1$b as aD,FormGroup$1 as aE,FormControlLabel$1 as aF,Checkbox$1 as aG,fetchTemplateGalleryFallback as aH,Card$1 as aI,CardContent$1 as aJ,img$m as aK,CardActions$1 as aL,flowStyles as aM,NoResults as aN,CircularProgress$1 as aO,img$c as aP,Dialog$1 as aQ,setApiEndpoint as aR,TableContainer$1 as aS,Table$1 as aT,TableHead$1 as aU,TableRow$1 as aV,TableCell$1 as aW,TableSortLabel$1 as aX,TableBody$1 as aY,img$h as aZ,default_1 as a_,controllerUrlSelector as aa,automateControllerUrlSelector as ab,flowCenterDialogSelector as ac,automateUrlSelector as ad,Portal$1 as ae,flowCenterDialogReducer as af,List$2 as ag,ListItem$1 as ah,ListItemIcon$1 as ai,ListItemText$1 as aj,flowCenterDialogAction as ak,all as al,img$o as am,img$p as an,img$r as ao,img$s as ap,Tooltip$1 as aq,img$i as ar,img$H as as,Skeleton$1 as at,takeLatest$1 as au,fetchAllTags as av,put as aw,select as ax,fetchFlows as ay,call$i as az,styled$1 as b,FormHelperText$2 as b$,ClickAwayListener as b0,Fade$1 as b1,img$t as b2,img$q as b3,img$R as b4,img$D as b5,DialogTitle$1 as b6,DialogContent$1 as b7,DialogActions$1 as b8,Snackbar$1 as b9,React5 as bA,TransitionGroup$1 as bB,connect$1 as bC,Bookmark as bD,EngineFlagIcons as bE,createAsyncThunk as bF,withStyles as bG,getConfigModule as bH,getAuthModule as bI,getSnackbarModule as bJ,AIWareCacheProvider as bK,img$S as bL,img$e as bM,img$d as bN,isEmpty_1 as bO,Backdrop$1 as bP,getDefaultMiddleware as bQ,isNil_1 as bR,UpDown as bS,Icon$1 as bT,get_1 as bU,map_1 as bV,keys_1 as bW,RadioGroup$1 as bX,Avatar$1 as bY,img$x as bZ,baseGraphQLApi as b_,default_1$6 as ba,img$j as bb,img$l as bc,img$V as bd,Tabs$2 as be,Tab$2 as bf,deleteEngine as bg,fetchEngine as bh,img$k as bi,AIWareFormatMessage as bj,FormattedDate as bk,fetchVeritoneGraphQLApi as bl,useTheme as bm,KeyboardArrowRight as bn,KeyboardArrowLeft as bo,useId as bp,InputUnstyled as bq,isHostComponent as br,getDefaultExportFromNamespaceIfNotNamed as bs,commonjsRequire as bt,reactDom as bu,Transition$1 as bv,_defineProperty$1 as bw,__awaiter$d as bx,__generator$2 as by,__spread as bz,Paper$1 as c,isArray_1 as c$,img$g as c0,StyledEngineProvider as c1,ThemeProvider as c2,lightTheme$1 as c3,CssBaseline as c4,Hide as c5,has_1 as c6,showMessage as c7,MessageSeverity as c8,Radio$2 as c9,mountPanel$1 as cA,DialogContentText$1 as cB,userSelector$2 as cC,MoreVert$1 as cD,Menu$1 as cE,Edit as cF,Upload as cG,Delete as cH,CustomTabs as cI,useBackupImg as cJ,img$1A as cK,validate as cL,configSelector as cM,baseGraphQLApiWithError as cN,VerifiedFilled as cO,Add as cP,ExpandLess as cQ,ExpandMore as cR,Collapse$1 as cS,img$17 as cT,Filter$1 as cU,DynamicTable as cV,useTheme$3 as cW,getThemeProps as cX,useEnhancedEffect$1 as cY,React as cZ,_arrayPush as c_,createSvgIcon$2 as ca,_createCompounder as cb,_baseIteratee as cc,isArrayLike_1 as cd,toInteger_1 as ce,_typeof$4 as cf,_assertThisInitialized$1 as cg,_setPrototypeOf$3 as ch,_toPropertyKey as ci,_inheritsLoose$2 as cj,hoistNonReactStatics_cjs as ck,commonjsGlobal$1 as cl,combineReducers as cm,createSelector$1 as cn,fork as co,AIWareThemeProvider$1 as cp,Stack$4 as cq,Close$1 as cr,FullscreenExit as cs,Fullscreen as ct,TabPanel as cu,default_1$8 as cv,unmountPanel$1 as cw,AvailableComponents as cx,delay$1 as cy,hidePanel$1 as cz,capitalize$2 as d,_Symbol as d$,_baseToString as d0,_baseTrim as d1,_castSlice as d2,_stringToArray as d3,toString_1 as d4,ReactIs as d5,upperFirst_1 as d6,isString_1 as d7,_baseGet as d8,_baseSlice as d9,useTheme$2 as dA,useControlled as dB,useEventCallback as dC,ButtonBase$1 as dD,useForkRef as dE,getDefaultExportFromCjs as dF,_root as dG,isObject_1 as dH,MoreHor as dI,takeEvery$1 as dJ,EngineCategoryIcons as dK,selectApiConfigs$2 as dL,Chip$1 as dM,Badge$1 as dN,panelsSelector as dO,tabsClasses$1 as dP,AlarmTwo as dQ,EditList as dR,usePreviousProps$1 as dS,setRef as dT,inputClasses$1 as dU,inputBaseClasses$1 as dV,outlinedInputClasses$1 as dW,filledInputClasses$1 as dX,ClearIcon as dY,ArrowDropDownIcon as dZ,_arrayMap as d_,_castPath as da,_toKey as db,_isIndex as dc,channel$1 as dd,useIntl as de,VideoCamera as df,Image$1 as dg,Sound as dh,Description as di,toNumber_1 as dj,ProgressStepper as dk,size_1 as dl,take as dm,CurlyBraces as dn,UnknownDocument as dp,sdkEventManager as dq,SdkEvents as dr,SdkError as ds,EngineClassIcons as dt,Mode2 as du,EngineModeIcons as dv,DeploymentModelIcons as dw,guid as dx,forceReflow as dy,alpha as dz,_objectWithoutPropertiesLoose$2 as e,index as e$,isArguments_1 as e0,_baseEach as e1,_arrayFilter as e2,_getNative as e3,eq_1 as e4,_Uint8Array as e5,_overArg as e6,_isPrototype as e7,isObjectLike_1 as e8,_baseGetTag as e9,img$L as eA,img$1y as eB,img$K as eC,authSelector as eD,ListItemAvatar$1 as eE,emphasize as eF,useSlotProps as eG,_arraySome as eH,EntityType as eI,injectIntl as eJ,ErrorBoundary$1 as eK,EPermissionAction as eL,Process as eM,Information as eN,Download as eO,NewFolder as eP,SpecialFolder as eQ,User as eR,Source as eS,Search$1 as eT,selectIsOLPEnabled as eU,ListItemSecondaryAction$1 as eV,getLibraryModule as eW,cmsUrlSelector as eX,betaFeaturesSelector as eY,SearchStructuredData as eZ,Grow$1 as e_,_arrayLikeKeys as ea,isBuffer$3 as eb,isFunction_1 as ec,isTypedArray_1 as ed,_Stack as ee,_baseFor as ef,identity_1 as eg,_isIterateeCall as eh,isSymbol_1 as ei,_baseMap as ej,_baseUnary as ek,memoizeOne as el,createBox$1 as em,StepperContext$1 as en,StepContext$1 as eo,SvgIcon$1 as ep,StepConnector$1 as eq,_Set as er,_setToArray as es,_SetCache as et,_cacheHas as eu,img$O as ev,img$N as ew,img$1w as ex,img$1v as ey,img$1u as ez,clsx as f,SecurityGroup as f$,actions as f0,hasPermission as f1,UserAddFilled as f2,Popover$1 as f3,MenuList$1 as f4,MoveFolder as f5,EAuthResourceType as f6,Slide$1 as f7,img$a as f8,selectPanelByPanelName as f9,selectOrgId as fA,navSectionStyles as fB,selectIsUserAdmin as fC,AvatarGroup$1 as fD,ErrorState$2 as fE,NullState$2 as fF,Group as fG,PermissionChangedAction as fH,Lock as fI,useOrganizationPermissions as fJ,EAuthSubResourceType as fK,AddGroup as fL,initialConfigSelector as fM,ConfirmationModal as fN,EnumHelpers as fO,formatBytes as fP,LinearProgress$1 as fQ,NotInterested as fR,mountPanelForResponse$1 as fS,tableStyles as fT,ArrowDown as fU,ArrowUp as fV,useInterval as fW,Iam as fX,contextMenuStyles as fY,safeFormatMessage as fZ,Users as f_,FullScreenContainer as fa,isPermissionLoading as fb,Settings$2 as fc,Hamburger as fd,List as fe,convertEntityToAuthResource as ff,selectUserOrgEdgeVersion as fg,EditAttributes as fh,gqlIntrospection as fi,ProcessingDetail as fj,img$w as fk,img$y as fl,img$4 as fm,FilterRemove as fn,CheckCircle as fo,FolderOpen as fp,Voice as fq,useDoubleClick as fr,FolderFilled as fs,Time as ft,img$z as fu,Undefined as fv,PodcastSource as fw,YoutubeSource as fx,TVSource as fy,RadioSource as fz,generateUtilityClass as g,ArrowBack as g$,getOrganizationPanelModule as g0,Lock2 as g1,EApplicationConfigLevel as g2,NoApps as g3,EApplicationConfigType as g4,green$1 as g5,md5 as g6,selectIsSuperAdmin as g7,organizations_selector as g8,actions$5 as g9,compile as gA,Check as gB,FormattedRelativeTime$1 as gC,BottomQueue as gD,TopQueue as gE,Pause as gF,Cancel as gG,Folder as gH,Hidden as gI,setDuration as gJ,resetDuration as gK,toFinite_1 as gL,_baseForOwn as gM,_arrayReduce as gN,hasIn_1 as gO,useSyncExternalStoreExports as gP,getTabPanelWidthBySize as gQ,Packages as gR,Resources$1 as gS,selectUserCanCreatePackage as gT,Engines as gU,PackagesAvatar as gV,actionChannel as gW,cancelled as gX,flush$3 as gY,cancel as gZ,FlowCenter2 as g_,AddUser as ga,selectors as gb,LibraryDropdown as gc,Remove as gd,Save as ge,Input$3 as gf,getElement as gg,client$1 as gh,Copy as gi,ArrowForward as gj,Modal$1 as gk,_baseIsEqual as gl,Slider$1 as gm,_getSymbols as gn,stubArray_1 as go,_baseGetAllKeys as gp,_getTag as gq,_nodeUtil as gr,_getAllKeys as gs,_castFunction as gt,Article as gu,Task as gv,View as gw,_objectSpread2 as gx,serialize as gy,stringify$2 as gz,composeClasses as h,img$v as h0,FlowTemplate as h1,Schema as h2,registry as h3,registerComponent as h4,AvailableWidgets as h5,updatePanelMicroFrontendProps as h6,setData as h7,root as h8,mountWidget as h9,unmountWidget as ha,mountPanel as hb,unmountPanel as hc,hidePanel as hd,unmountAllPanel as he,init as hf,aiwareEvents as hg,createSvgIcon$1 as i,jsxRuntime as j,interopRequireDefault as k,Route as l,makeStyles as m,useDispatch as n,useSelector as o,authStatusSelector as p,authContextSelector as q,react as r,store$4 as s,AuthContext as t,useThemeProps as u,lodash as v,Alert$1 as w,useNavigate as x,useLocation as y,authErrorMessage as z};
package/js-core.esm.js.gz CHANGED
Binary file