@airporting/tech-app 0.0.82 → 0.0.84
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/mf/@mf-types/compiled-types/api/tech/mcpAccess.types.d.ts +5 -1
- package/dist/mf/@mf-types/compiled-types/gen/TechApi/index.d.ts +4 -1
- package/dist/mf/@mf-types.zip +0 -0
- package/dist/mf/__federation_expose_mcp_access.js +1 -1
- package/dist/mf/index.js +3 -3
- package/dist/mf/mf-manifest.json +1 -1
- package/dist/mf/mf-stats.json +6 -6
- package/dist/mf/tech_app.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export type McpAccessValue = string[] | boolean;
|
|
2
2
|
export type UserAccess = Record<string, McpAccessValue>;
|
|
3
3
|
export type AccessMap = Record<string, UserAccess>;
|
|
4
|
-
export type
|
|
4
|
+
export type ConfiguredDossier = {
|
|
5
|
+
slug: string;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
export type ConfiguredDossiers = Record<string, ConfiguredDossier[]>;
|
|
5
9
|
export type SetUserAccessArgs = {
|
|
6
10
|
email: string;
|
|
7
11
|
access: UserAccess;
|
|
@@ -358,7 +358,10 @@ export interface GetMcpAccessResponse {
|
|
|
358
358
|
accessMap: object;
|
|
359
359
|
admins: string[];
|
|
360
360
|
canEdit: boolean;
|
|
361
|
-
|
|
361
|
+
configuredDossiers: Record<string, {
|
|
362
|
+
slug: string;
|
|
363
|
+
name: string;
|
|
364
|
+
}[]>;
|
|
362
365
|
mcpNames: string[];
|
|
363
366
|
multiDossierMcps: string[];
|
|
364
367
|
}
|
package/dist/mf/@mf-types.zip
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["6215"],{3897:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{O:()=>BrandLogo});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _src_components_logoDev_ts__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(243);function BrandLogo({domain,alt,size=24}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Image,{src:(0,_src_components_logoDev_ts__WEBPACK_IMPORTED_MODULE_2__.j)(domain),alt:alt,title:alt,w:size,h:size,fit:"contain",radius:"sm",style:{aspectRatio:1}})}},1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,leading,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[leading,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},9781:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{h:()=>QuickBooksIcon});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);function QuickBooksIcon(props){const size=props.size??20;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",role:"img","aria-label":"QuickBooks",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("title",{children:"QuickBooks"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#2CA01C"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text",{x:"12",y:"16.5",textAnchor:"middle",fontSize:"12",fontWeight:"700",fill:"#ffffff",fontFamily:"Arial, Helvetica, sans-serif",children:"qb"})]})}},243:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{j:()=>logoDevUrl});const LOGO_DEV_TOKEN="pk_BVN4OQv0Qs-bnqjdIgTppg";function logoDevUrl(domain){return`https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}`}},8908:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>McpAccess});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var index_mjs_=__webpack_require__(207);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);function useMcpAccessQuery(){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:["tech","mcp-access"],queryFn:async()=>(await api.mcpAccess.getAccessV1()).data,refetchOnWindowFocus:true})}function useInvalidate(){const queryClient=(0,modern_index_js_.useQueryClient)();return()=>queryClient.invalidateQueries({queryKey:["tech","mcp-access"]})}function useSetUserAccess(){const api=(0,useApi.h)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async({email,access})=>(await api.mcpAccess.setUserAccessV1({email},{access})).data,onSuccess:invalidate})}var PageHeader=__webpack_require__(1354);var BrandLogo=__webpack_require__(3897);var QuickBooksIcon=__webpack_require__(9781);const MCP_DOMAINS={pennylane:"pennylane.com",pipedrive:"pipedrive.com",odoo:"odoo.com","zoho-books":"zoho.com",xero:"xero.com",imessage:"apple.com",whatsapp:"whatsapp.com",gsheet:"google.com",airporting:"airporting.com",gmail:"gmail.com",linkedin:"linkedin.com"};function isRevocation(value){if(null===value||false===value)return true;if(Array.isArray(value)&&0===value.length)return true;return false}function McpAccessApp(){const query=useMcpAccessQuery();const data=query.data;const setAccess=useSetUserAccess();const accessMap=data?.accessMap??{};const
|
|
1
|
+
"use strict";(globalThis["chunk_tech_app"]=globalThis["chunk_tech_app"]||[]).push([["6215"],{3897:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{O:()=>BrandLogo});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _src_components_logoDev_ts__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(243);function BrandLogo({domain,alt,size=24}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Image,{src:(0,_src_components_logoDev_ts__WEBPACK_IMPORTED_MODULE_2__.j)(domain),alt:alt,title:alt,w:size,h:size,fit:"contain",radius:"sm",style:{aspectRatio:1}})}},1354:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{m:()=>PageHeader});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(207);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(9632);var react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(3106);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"\xe0 l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,leading,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(()=>Date.now());(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[leading,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"\xe9chec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Tooltip,{label:"Rafra\xeechir",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_2__.IconRefresh,{size:16})})}),actions]})]})}},9781:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{h:()=>QuickBooksIcon});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);function QuickBooksIcon(props){const size=props.size??20;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",role:"img","aria-label":"QuickBooks",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("title",{children:"QuickBooks"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#2CA01C"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text",{x:"12",y:"16.5",textAnchor:"middle",fontSize:"12",fontWeight:"700",fill:"#ffffff",fontFamily:"Arial, Helvetica, sans-serif",children:"qb"})]})}},243:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{j:()=>logoDevUrl});const LOGO_DEV_TOKEN="pk_BVN4OQv0Qs-bnqjdIgTppg";function logoDevUrl(domain){return`https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}`}},8908:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>McpAccess});var jsx_runtime=__webpack_require__(5893);var index_js_=__webpack_require__(3106);var index_mjs_=__webpack_require__(207);var modern_index_js_=__webpack_require__(6197);var useApi=__webpack_require__(4148);function useMcpAccessQuery(){const api=(0,useApi.h)();return(0,modern_index_js_.useQuery)({queryKey:["tech","mcp-access"],queryFn:async()=>(await api.mcpAccess.getAccessV1()).data,refetchOnWindowFocus:true})}function useInvalidate(){const queryClient=(0,modern_index_js_.useQueryClient)();return()=>queryClient.invalidateQueries({queryKey:["tech","mcp-access"]})}function useSetUserAccess(){const api=(0,useApi.h)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async({email,access})=>(await api.mcpAccess.setUserAccessV1({email},{access})).data,onSuccess:invalidate})}var PageHeader=__webpack_require__(1354);var BrandLogo=__webpack_require__(3897);var QuickBooksIcon=__webpack_require__(9781);const MCP_DOMAINS={pennylane:"pennylane.com",pipedrive:"pipedrive.com",odoo:"odoo.com","zoho-books":"zoho.com",xero:"xero.com",imessage:"apple.com",whatsapp:"whatsapp.com",gsheet:"google.com",airporting:"airporting.com",gmail:"gmail.com",linkedin:"linkedin.com"};function isRevocation(value){if(null===value||false===value)return true;if(Array.isArray(value)&&0===value.length)return true;return false}function McpAccessApp(){const query=useMcpAccessQuery();const data=query.data;const setAccess=useSetUserAccess();const accessMap=data?.accessMap??{};const configuredDossiers=data?.configuredDossiers??{};const mcpNames=data?.mcpNames??[];const multiDossierMcps=data?.multiDossierMcps??[];const canEdit=data?.canEdit??false;const emails=Object.keys(accessMap).sort();function updateCell(email,mcp,value){if(!canEdit)return;if(isRevocation(value)){const ok=window.confirm(`Retirer l'acc\xe8s ${mcp} \xe0 ${email} ?`);if(!ok)return}const next={...accessMap[email]??{}};if(isRevocation(value))delete next[mcp];else next[mcp]=value;setAccess.mutate({email,access:next})}return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{fluid:true,my:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.m,{title:"Acc\xe8s MCP",updatedAt:query.dataUpdatedAt,isFetching:query.isFetching,isError:query.isError,onRefresh:()=>query.refetch()}),!canEdit&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",fz:"sm",mb:"sm",children:"Lecture seule (non-admin)"}),data?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.ScrollContainer,{minWidth:1200,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{withTableBorder:true,withColumnBorders:true,stickyHeader:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Utilisateur"}),mcpNames.map(mcp=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:["quickbooks"===mcp?/*#__PURE__*/(0,jsx_runtime.jsx)(QuickBooksIcon.h,{size:18}):MCP_DOMAINS[mcp]?/*#__PURE__*/(0,jsx_runtime.jsx)(BrandLogo.O,{domain:MCP_DOMAINS[mcp],alt:mcp,size:18}):null,mcp]})},mcp))]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:emails.map(email=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:email}),mcpNames.map(mcp=>{const entry=accessMap[email]?.[mcp];if(multiDossierMcps.includes(mcp)){const slugs=Array.isArray(entry)?entry:[];return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TagsInput,{value:slugs,data:(configuredDossiers[mcp]??[]).map(d=>d.slug),renderOption:({option})=>{const dossier=(configuredDossiers[mcp]??[]).find(d=>d.slug===option.value);return/*#__PURE__*/(0,jsx_runtime.jsx)("span",{children:dossier?`${dossier.name} (${option.value})`:option.value})},disabled:!canEdit,placeholder:"slugs ou *",onChange:value=>updateCell(email,mcp,value)})},mcp)}return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Switch,{checked:true===entry,disabled:!canEdit,onChange:event=>updateCell(email,mcp,event.currentTarget.checked)})},mcp)})]},email))})]})}):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:"Chargement…"})]})}var providers=__webpack_require__(7034);function McpAccess(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.C,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(McpAccessApp,{})})})}}}]);
|