@zydon/common 2.0.4 → 2.0.5

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.
@@ -5,15 +5,15 @@ import '../../../chunk-D6NU2WRK.mjs';
5
5
  import { a as a$1 } from '../../../chunk-QHCGLZFD.mjs';
6
6
  import '../../../chunk-KLIYANST.mjs';
7
7
  import { useFormContext, useFieldArray } from 'react-hook-form';
8
- import w from '@mui/material/Divider';
8
+ import D from '@mui/material/Divider';
9
9
  import T from '@mui/material/IconButton';
10
10
  import q from '@mui/material/InputAdornment';
11
11
  import l from '@mui/material/Stack';
12
12
  import O from '@mui/material/Typography';
13
- import x from '@mui/material/Alert';
13
+ import I from '@mui/material/Alert';
14
14
  import { styled, alpha } from '@mui/material/styles';
15
15
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
16
16
 
17
- var s=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],c=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var b=styled(T)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}}));styled(T)(()=>({height:"38px",alignSelf:"center"}));var y=styled(O)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),h=styled(x)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var W=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(h,{severity:"info",children:jsxs(O,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(y,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},g=W;var U=({webhookData:o,isEditing:a$4=!1,haveTip:S=!1})=>{let{control:k}=useFormContext(),{fields:E,append:A,remove:C}=useFieldArray({name:"headers",control:k}),I=()=>{A({value:"",name:""});};return jsxs(Fragment,{children:[S&&jsx(g,{}),a$4&&jsx(a,{name:"name",label:"Nome do webhook"}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}}}),jsx(a,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:jsx(q,{position:"end",children:jsx(b,{onClick:()=>navigator.clipboard.writeText(o.resourceID),children:jsx(a$1,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),jsx(a,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a$2,{fullWidth:!0,options:s,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:{required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}}}),jsx(a$2,{fullWidth:!0,options:c,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:{required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}}})]}),jsx(O,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),E?.map((P,i)=>jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a,{name:`headers.${i}.name`,label:"Chave",required:!0,rules:{required:{value:!0,message:""}}}),jsx(a,{name:`headers.${i}.value`,label:"Valor"}),jsx(T,{color:"error",onClick:()=>C(i),children:jsx(a$1,{icon:"DELETE_MARK_BUTTON_02"})})]},P.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>I(),children:"Adicionar novo cabe\xE7alho"}),jsx(w,{})]})},se=U;
17
+ var s=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],c=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var b=styled(T)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}}));styled(T)(()=>({height:"38px",alignSelf:"center"}));var y=styled(O)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),h=styled(I)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var W=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(h,{severity:"info",children:jsxs(O,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(y,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},g=W;var _=({webhookData:o,isEditing:a$4=!1,haveTip:S=!1})=>{let{control:k}=useFormContext(),{fields:E,append:A,remove:C}=useFieldArray({name:"headers",control:k}),P=()=>{A({value:"",name:""});};return jsxs(Fragment,{children:[S&&jsx(g,{}),a$4&&jsx(a,{name:"name",label:"Nome do webhook"}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}}}),jsx(a,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a,{variant:"filled",name:"resource_id",label:"ID origem",disabled:!0,InputProps:{endAdornment:jsx(q,{position:"end",children:jsx(b,{onClick:()=>navigator.clipboard.writeText(o.resource_id),children:jsx(a$1,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),jsx(a,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a$2,{fullWidth:!0,options:s,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:{required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}}}),jsx(a$2,{fullWidth:!0,options:c,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:{required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}}})]}),jsx(O,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),E?.map((x,i)=>jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a,{name:`headers.${i}.name`,label:"Chave",required:!0,rules:{required:{value:!0,message:""}}}),jsx(a,{name:`headers.${i}.value`,label:"Valor"}),jsx(T,{color:"error",onClick:()=>C(i),children:jsx(a$1,{icon:"DELETE_MARK_BUTTON_02"})})]},x.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>P(),children:"Adicionar novo cabe\xE7alho"}),jsx(D,{})]})},se=_;
18
18
 
19
19
  export { se as default };
@@ -2,7 +2,7 @@ interface WebhookType {
2
2
  id: string;
3
3
  name: string;
4
4
  resource: string;
5
- resourceID: string;
5
+ resource_id: string;
6
6
  event: string;
7
7
  content_type: ContentTypeStatus;
8
8
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",