vobi_lib 1.0.21 → 1.0.23

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/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import moment from 'moment-timezone';
2
-
3
1
  interface ICustomErrorParams {
4
2
  message?: string;
5
3
  statusCode?: number;
@@ -27,146 +25,4 @@ type Encode = {
27
25
  uudi?: string;
28
26
  };
29
27
 
30
- declare const IsJsonString: (str: string) => boolean;
31
-
32
- declare const PromiseEach: (arr: any, fn: any) => Promise<void>;
33
-
34
- declare const asArray: (value: unknown) => unknown[];
35
-
36
- declare const asyncForEach: <T>(array: T[], callback: (item: T, index: number, array: T[]) => Promise<void> | void) => Promise<void>;
37
-
38
- declare const capitalize: (value: string) => string;
39
-
40
- declare const checkCnpj: (strCnpj: string) => boolean;
41
-
42
- declare const checkCpf: (strCPF: string, allowEqualDigits?: boolean) => boolean;
43
-
44
- declare const checkEmail: (email: string) => boolean;
45
-
46
- declare const containsEncodedComponents: (x: any) => boolean;
47
-
48
- declare const curry: <T extends (...args: any[]) => any>(fn: T) => (...args: Parameters<T>) => ReturnType<T> | ((...args: any[]) => ReturnType<T>);
49
-
50
- declare const decrypt: (data: any, secret: any) => string;
51
-
52
- declare const diffObject: (a: any, b: any) => {};
53
-
54
- declare const dynamici18nString: (message: string, res: any) => any;
55
-
56
- declare const elasticTransformOr: (or: any) => any;
57
-
58
- declare const encrypt: (data: any, secret: string) => string;
59
-
60
- declare const enumHelper: Record<string, any>;
61
-
62
- declare const eventBus: {
63
- on(event: any, callback: any): void;
64
- dispatch(event: any, data: any): void;
65
- remove(event: any, callback: any): void;
66
- };
67
-
68
- declare const extractAsaasError: (err: any) => any;
69
-
70
- declare const extractValueFromWhere: (where: any, property: any) => any;
71
-
72
- declare const getNameWithoutExtension: (name: string) => string;
73
-
74
- declare const filterAttributes: (data: any, attributes: any) => any;
75
-
76
- declare const filterEmpty: (array: any) => any;
77
-
78
- declare const findValue: (arr: any, predicate: any) => null;
79
-
80
- interface FormatAmountProps {
81
- decimalCount?: number;
82
- decimal?: string;
83
- thousands?: string;
84
- currencySymbol?: string;
85
- }
86
- declare const formatAmount: (amount: any, props?: FormatAmountProps) => string;
87
-
88
- declare const brazilianDateTime: (date: string) => Date;
89
- declare const formatDate: (date: string, format: string, locale: string, utc: string, formatMoment: string) => string | moment.Moment | null;
90
- declare const getNextDay: (date: string, format?: string) => string | Date;
91
- declare const getNextWeekday: any;
92
- declare const getPreviewsWeekday: any;
93
- declare const asDate: (date: string) => moment.Moment | null;
94
- declare const asBrazilianDate: (date: any) => any;
95
- declare const brazilianDateToDate: (date: any, customFormat: any) => any;
96
- declare const monthsBetween: (initialDate: any, endDate: any) => number | null;
97
- declare const isAfter: (date1: any, date2: any) => boolean | null | undefined;
98
- declare const getToday: (onlyDate?: boolean) => Date;
99
- declare const getYesterday: (onlyDate?: boolean) => Date;
100
- declare const getTomorrow: (onlyDate?: boolean) => Date;
101
- declare const getMonthNumber: (date: string) => string;
102
- declare const isOfAge: (dob: any, age: any) => boolean;
103
- declare const maxDateToList: (list: any) => moment.Moment;
104
- declare const minDateToList: (list: any) => moment.Moment;
105
- declare const dateIsValid: (date: string) => boolean;
106
-
107
- declare const formatNumber: (value?: any) => any;
108
-
109
- declare const getExtension: (fileName: any) => any;
110
-
111
- declare const imgSrcRegex: RegExp;
112
-
113
- declare const isNumber: (n: any) => boolean;
114
-
115
- declare const isValidUrl: (str: string) => boolean;
116
-
117
- declare const getToken: (req: any) => any;
118
- declare const decodeToken: (req: any, res: any, next: any) => any;
119
-
120
- declare const makeRefurbishFileUrl: (refurbish: any, userType: any, file: any, isPreview: any) => string;
121
-
122
- declare const nullIfEmpty: (value: any) => any;
123
-
124
- declare const padLeft: (number: number, pad?: string) => string;
125
-
126
- interface ArrayItem {
127
- value: string;
128
- label: string;
129
- [key: string]: any;
130
- }
131
- declare const parseArrayAsObject: (array: ArrayItem[], shouldSetValueAsObject?: boolean) => {
132
- [key: string]: any;
133
- };
134
-
135
- declare const parseRouteToModel: (route: any) => any;
136
-
137
- declare const prepareDoc: (cpfCnpj: string) => string;
138
-
139
- declare const prepareSession: ({ id, name, email, idCompany, userType, type, isOwner, MGMCode, groupPermission, isActive, limitAccess, company, }: any) => {
140
- id: any;
141
- name: any;
142
- email: any;
143
- idCompany: any;
144
- userType: any;
145
- type: any;
146
- isOwner: any;
147
- MGMCode: any;
148
- groupPermission: any;
149
- isActive: any;
150
- limitAccess: any;
151
- idPlan: any;
152
- };
153
-
154
- declare const promiseAny: <T>(promisesArray: Promise<T>[]) => Promise<T>;
155
-
156
- declare const removeProperty: (prop: any, obj: any) => {};
157
-
158
- declare const removeSpecialChar: (s: any, trim: any, removeSpace?: boolean) => any;
159
-
160
- declare const slugify: (str: string) => string;
161
-
162
- declare const splitList: (inputArray: any, perChunk: any) => any;
163
-
164
- declare const sum: (array: any, prop: any) => any;
165
-
166
- declare const sumByFunction: (array: any, func: any) => any;
167
-
168
- declare const validateMobilePhoneNumber: (data: any) => boolean;
169
-
170
- declare const valueReplacer: (value: any) => any;
171
-
172
- export { type ArrayItem, BAD_GATEWAY, BAD_REQUEST, type Encode, FORBIDDEN, type FormatAmountProps, type ICustomErrorParams, INTERNAL_SERVER_ERROR, IsJsonString, METHOD_NOT_ALLOWED, NOT_ALLOWED, NOT_FOUND, PromiseEach, SERVICE_UNAVAILABLE, UNAUTHORIZED, asArray, asBrazilianDate, asDate, asyncForEach, brazilianDateTime, brazilianDateToDate, capitalize, checkCnpj, checkCpf, checkEmail, containsEncodedComponents, curry, dateIsValid, decodeToken, decrypt, diffObject, dynamici18nString, elasticTransformOr, encrypt, enumHelper, error, eventBus, extractAsaasError, extractValueFromWhere, filterAttributes, filterEmpty, findValue, formatAmount, formatDate, formatNumber, getExtension, getMonthNumber, getNameWithoutExtension, getNextDay, getNextWeekday, getPreviewsWeekday, getToday, getToken, getTomorrow, getYesterday, imgSrcRegex, isAfter, isNumber, isOfAge, isValidUrl, makeRefurbishFileUrl, maxDateToList, minDateToList, monthsBetween, nullIfEmpty, padLeft, parseArrayAsObject, parseRouteToModel, prepareDoc, prepareSession, promiseAny, removeProperty, removeSpecialChar, slugify, splitList, sum, sumByFunction, validateMobilePhoneNumber, valueReplacer };
28
+ export { BAD_GATEWAY, BAD_REQUEST, type Encode, FORBIDDEN, type ICustomErrorParams, INTERNAL_SERVER_ERROR, METHOD_NOT_ALLOWED, NOT_ALLOWED, NOT_FOUND, SERVICE_UNAVAILABLE, UNAUTHORIZED, error };
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";var G=Object.create;var h=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Q=(e,a)=>{for(var o in a)h(e,o,{get:a[o],enumerable:!0})},I=(e,a,o,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of j(a))!Y.call(e,s)&&s!==o&&h(e,s,{get:()=>a[s],enumerable:!(n=M(a,s))||n.enumerable});return e};var y=(e,a,o)=>(o=e!=null?G(z(e)):{},I(a||!e||!e.__esModule?h(o,"default",{value:e,enumerable:!0}):o,e)),$=e=>I(h({},"__esModule",{value:!0}),e);var ea={};Q(ea,{BAD_GATEWAY:()=>K,BAD_REQUEST:()=>l,FORBIDDEN:()=>H,INTERNAL_SERVER_ERROR:()=>R,IsJsonString:()=>X,METHOD_NOT_ALLOWED:()=>J,NOT_ALLOWED:()=>S,NOT_FOUND:()=>D,PromiseEach:()=>ee,SERVICE_UNAVAILABLE:()=>Z,UNAUTHORIZED:()=>b,asArray:()=>A,asBrazilianDate:()=>U,asDate:()=>v,asyncForEach:()=>ae,brazilianDateTime:()=>w,brazilianDateToDate:()=>Ce,capitalize:()=>B,checkCnpj:()=>te,checkCpf:()=>oe,checkEmail:()=>ne,containsEncodedComponents:()=>re,curry:()=>se,dateIsValid:()=>Te,decodeToken:()=>Fe,decrypt:()=>ie,diffObject:()=>le,dynamici18nString:()=>de,elasticTransformOr:()=>ue,encrypt:()=>ce,enumHelper:()=>t,error:()=>f,eventBus:()=>pe,extractAsaasError:()=>me,extractValueFromWhere:()=>fe,filterAttributes:()=>ye,filterEmpty:()=>he,findValue:()=>N,formatAmount:()=>be,formatDate:()=>Ee,formatNumber:()=>we,getExtension:()=>Oe,getMonthNumber:()=>Be,getNameWithoutExtension:()=>ge,getNextDay:()=>ve,getNextWeekday:()=>O,getPreviewsWeekday:()=>k,getToday:()=>De,getToken:()=>q,getTomorrow:()=>Ae,getYesterday:()=>Re,imgSrcRegex:()=>ke,isAfter:()=>Se,isNumber:()=>Ue,isOfAge:()=>Ne,isValidUrl:()=>_e,makeRefurbishFileUrl:()=>qe,maxDateToList:()=>Ie,minDateToList:()=>Pe,monthsBetween:()=>xe,nullIfEmpty:()=>Ve,padLeft:()=>Ge,parseArrayAsObject:()=>Me,parseRouteToModel:()=>je,prepareDoc:()=>ze,prepareSession:()=>Ye,promiseAny:()=>Qe,removeProperty:()=>$e,removeSpecialChar:()=>We,slugify:()=>He,splitList:()=>Je,sum:()=>Ke,sumByFunction:()=>Ze,validateMobilePhoneNumber:()=>Xe,valueReplacer:()=>C});module.exports=$(ea);var P={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"N\xE3o autorizado.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado."};var f={},T={en:P,"pt-br":"PT_BR_LOCALE"},r=T.en||T.en,l=400,S=405,b=401,H=403,D=404,J=405,R=500,K=502,Z=503;f.NOT_FOUND={userNotFound:{statusCode:D,code:"NF-00001",message:r.userNotFound},pageNotFound:{statusCode:D,code:"NF-00002",message:r.pageNotFound}};f.UNAUTHORIZED={notAuthorized:{statusCode:b,code:"UA-00001",message:r.notAuthorized},tokenExpired:{statusCode:b,code:"UA-00002",message:r.tokenExpired},invalidToken:{statusCode:b,code:"UA-00003",message:r.invalidToken}};f.NOT_ALLOWED={notUpdated:{statusCode:S,code:"NA-00001",message:r.notUpdated},cantDelete:{statusCode:S,code:"NA-00002",message:r.cantDelete}};f.INTERNAL_SERVER_ERROR={general:{statusCode:R,code:"ISE-00001",message:r.general},sentError:{statusCode:R,code:"ISE-00002",message:r.sentError}};f.BAD_REQUEST={noUser:{statusCode:l,code:"LIB-B-00001",message:r.noUser},noEmail:{statusCode:l,code:"LIB-B-00002",message:r.noEmail},noPassword:{statusCode:l,code:"LIB-B-00003",message:r.noPassword},invalidEmail:{statusCode:l,code:"LIB-B-00004",message:r.invalidEmail},uniqueEmail:{statusCode:l,code:"LIB-B-00005",message:r.uniqueEmail},invalidCPF:{statusCode:l,code:"LIB-B-00006",message:r.invalidCPF},invalidCNPJ:{statusCode:l,code:"LIB-B-00007",message:r.invalidCNPJ},uniqueName:{statusCode:l,code:"LIB-B-00008",message:r.uniqueName},noName:{statusCode:l,code:"LIB-B-00009",message:r.noName},noData:{statusCode:l,code:"LIB-B-00010",message:r.noData},invalidCredentials:{statusCode:l,code:"LIB-B-00011",message:r.invalidCredentials},tokenPasswordError:{statusCode:l,code:"LIB-B-00012",message:r.tokenPasswordError},errPassword:{statusCode:l,code:"LIB-B-00013",message:r.errPassword},noPhone:{statusCode:l,code:"LIB-B-00014",message:r.noPhone},noCPF:{statusCode:l,code:"LIB-B-00015",message:r.noCPF},noRG:{statusCode:l,code:"LIB-B-00016",message:r.noRG},noZipcode:{statusCode:l,code:"LIB-B-00017",message:r.noZipcode},noStreet:{statusCode:l,code:"LIB-B-00018",message:r.noStreet},noNumber:{statusCode:l,code:"LIB-B-00019",message:r.noNumber},noState:{statusCode:l,code:"LIB-B-00020",message:r.noState},noCity:{statusCode:l,code:"LIB-B-00021",message:r.noCity},noNeighborhood:{statusCode:l,code:"LIB-B-00022",message:r.noNeighborhood},noCNPJ:{statusCode:l,code:"LIB-B-00023",message:r.noCNPJ},noCompanyName:{statusCode:l,code:"LIB-B-00024",message:r.noCompanyName},noTrademarkName:{statusCode:l,code:"LIB-B-00025",message:r.noTrademarkName},noCompanyZipcode:{statusCode:l,code:"LIB-B-00026",message:r.noCompanyZipcode},noCompanyStreet:{statusCode:l,code:"LIB-B-00027",message:r.noCompanyStreet},noCompanyNumber:{statusCode:l,code:"LIB-B-00028",message:r.noCompanyNumber},noCompanyState:{statusCode:l,code:"LIB-B-00029",message:r.noCompanyState},noCompanyCity:{statusCode:l,code:"LIB-B-00030",message:r.noCompanyCity},noCompanyNeighborhood:{statusCode:l,code:"PRO-00031",message:r.noCompanyNeighborhood},noBirthdate:{statusCode:l,code:"LIB-B-00032",message:r.noBirthdate},noCompany:{statusCode:l,code:"LIB-B-00033",message:r.noCompany},noParameters:{statusCode:l,code:"LIB-B-00034",message:r.noParameters},invalidDoc:{statusCode:l,code:"LIB-B-00035",message:r.invalidDoc},docAlreadyExists:{statusCode:l,code:"LIB-B-00036",message:r.docAlreadyExists},invalidURL:{statusCode:l,code:"LIB-B-00037",message:r.invalidURL},noPermissions:{statusCode:l,code:"LIB-B-00038",message:r.noPermissions},fileLimit50:{statusCode:l,code:"LIB-B-00039",message:r.fileLimit50},fileLimit10:{statusCode:l,code:"LIB-B-00040",message:r.fileLimit10},invalidDates:{statusCode:l,code:"LIB-B-00041",message:r.invalidDates},maxLength:{statusCode:l,code:"LIB-B-00042",message:r.maxLength},uniqueCode:{statusCode:l,code:"LIB-B-00043",message:r.uniqueCode},invalidValue:{statusCode:l,code:"LIB-B-00044",message:r.invalidValue},invalidData:{statusCode:l,code:"LIB-B-00045",message:r.invalidData},invalidUUID:{statusCode:l,code:"LIB-B-00046",message:r.invalidUUID},noDate:{statusCode:l,code:"LIB-B-00047",message:r.noDate},invalidDate:{statusCode:l,code:"LIB-B-00048",message:r.invalidDate},invalidId:{statusCode:l,code:"LIB-B-00049",message:r.invalidId},noModel:{statusCode:l,code:"LIB-B-00050",message:r.noModel},sequelizeValidation:{statusCode:l,code:"LIB-B-00999"}};var X=e=>{try{JSON.parse(e)}catch{return!1}return!0};var ee=async(e,a)=>{for(let o of e)await a(o)};var A=e=>e==null?[]:Array.isArray(e)?e:[e];var ae=async(e,a)=>{await Promise.all(e.map((o,n)=>a(o,n,e)))};var B=e=>{if(typeof e!="string")return"";let a=e.trim();return a.charAt(0).toUpperCase()+a.slice(1)};var te=e=>{let a,o,n,s,d,u,p=!0;if(e.length<14)return!1;for(let c=1;c<e.length;c++)if(e.charAt(c-1)!==e.charAt(c)){p=!1;break}if(!p){u=e.length-2,a=e.substring(0,u),o=e.substring(u),n=0,d=u-7;for(let c=0;c<u;c++)n+=parseInt(a.charAt(c))*d--,d<2&&(d=9);if(s=n%11<2?0:11-n%11,s!==parseInt(o.charAt(0)))return!1;u+=1,a=e.substring(0,u),n=0,d=u-7;for(let c=0;c<u;c++)n+=parseInt(a.charAt(c))*d--,d<2&&(d=9);return s=n%11<2?0:11-n%11,s===parseInt(o.charAt(1))}return!1};var oe=(e,a=!1)=>{let o,n;return o=0,e.length<11||!a&&e.split("").every(s=>s===e[0])||(Array.from({length:9}).forEach((s,d)=>{o+=parseInt(e.substring(d,d+1),10)*(11-(d+1))}),n=o*10%11,(n===10||n===11)&&(n=0),n!==parseInt(e.substring(9,10),10))?!1:(o=0,Array.from({length:10}).forEach((s,d)=>{o+=parseInt(e.substring(d,d+1),10)*(12-(d+1))}),n=o*10%11,(n===10||n===11)&&(n=0),n===parseInt(e.substring(10,11),10))};var ne=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);var re=e=>decodeURI(e)!==decodeURIComponent(e);var se=e=>(...a)=>e.length>a.length?e.bind(null,...a):e(...a);var E=y(require("crypto-js")),ie=(e,a)=>E.AES.decrypt(e,a).toString(E.enc.Utf8);var le=(e,a)=>Object.keys(a).reduce((o,n)=>{if(e[n]===a[n]||n==="lastModifiedBy"||n==="createdAt")return o;let{oldData:s,newData:d}=o;return{oldData:{...s,[n]:e[n]},newData:{...d,[n]:a[n]}}},{});var de=(e,a)=>e&&typeof e=="string"?e.search(/[a-z]\.[a-z]/i)>=0?a.__(e):e:"";var ue=e=>{let a={};return e==null||e.forEach(o=>{Object.keys(o).forEach(s=>{typeof o[s]=="string"&&(o[s].toLowerCase()==="true"||o[s].toLowerCase()==="false")?a[s]=o[s].toLowerCase()==="true":a[s]=o[s]})}),a};var L=y(require("crypto-js")),ce=(e,a)=>(typeof e=="object"&&(e=JSON.stringify(e)),L.AES.encrypt(e,a).toString());var t={};t.fileType={receipt:"receipt",paymentVoucher:"paymentVoucher",quote:"quote",others:"others",project:"project",proposal:"proposal",bankBillet:"bankBillet",refund:"refund"};t.refurbishItemStatus={approved:{label:"Aprovado",value:"approved"},rejected:{label:"N\xE3o aprovado",value:"rejected"},pending:{label:"Para aprovar",value:"pending"},activeStatus:["approved","pending"]};t.workReportStatus={preparing:{label:"Em prepara\xE7\xE3o",value:"preparing",color:"warning70"},finished:{label:"Conclu\xEDdo",value:"finished",color:"success40"}};t.refurbishGroup={noGroup:"Sem grupo"};t.proposalStatus={waiting:{id:1,name:"Aguardando envio"},sent:{id:2,name:"Proposta enviada"},accept:{id:3,name:"Proposta aceita"},inactive:{id:4,name:"Arquivada"},allowCustomer:[2,3]};t.companyStatus={created:{id:1,name:"Cadastro iniciado"},onBoarding:{id:2,name:"Aguardando libera\xE7\xE3o"},active:{id:3,name:"Ativo"},blocked:{id:4,name:"Bloqueado"},cancelled:{id:5,name:"Cancelada"}};t.companyType={architect:{id:1,name:"Arquitetura e design de interiores",roles:["architect"]},service:{id:2,name:"Execu\xE7\xE3o de obra"},store:{id:3,name:"Loja de produtos e materiais"},factory:{id:4,name:"Fabricante"},other:{id:10,name:"Outros"}};t.refurbishStatus={new:{id:1,name:"Novo"},contact:{id:2,name:"Em contato"},proposalSent:{id:3,name:"Proposta enviada"},archived:{id:4,name:"Arquivada"},winner:{id:5,name:"Ganha",winner:!0},execution:{id:5,name:"Em andamento"},finished:{id:6,name:"Finalizado"},cancelled:{id:7,name:"Cancelado"},activeOpportunity:[1,2,3],opportunity:[1,2,3,4],project:[5,6,7],end:[4,5,6,7]};t.fixedRefurbishNewStatus={finished:{id:9999999,name:"Finalizado"},cancelled:{id:9999998,name:"Cancelado"},closed:[9999998,9999999]};t.refurbishStage={1:{id:1,name:"Oportunidade"},2:{id:2,name:"Projeto"}};t.roles={admin:{id:"admin",name:"Administrador"},sales:{id:"sales",name:"Venda"},arch:{id:"architect",name:"Arquitetura"},plan:{id:"plan",name:"Planejamento"},work:{id:"work",name:"Obra"},quality:{id:"quality",name:"Qualidade"},supply:{id:"supply",name:"Suprimentos"},contractor:{id:"contractor",name:"Empreiteiro"},beta:{id:"beta",name:"Beta user"}};t.supplierType={1:{value:1,label:"Loja"},2:{value:2,label:"Prestador de servi\xE7o"}};t.userType={guest:{name:"Visitante",value:"guest"},operator:{name:"Operador",value:"operator"},customer:{name:"Cliente",value:"customer"},provider:{name:"Profissional",value:"provider"},system:{name:"Sistema",value:"system"},anonymous:{name:"An\xF4nimo",value:"anonymous"},realTypes:["guest","operator","customer","provider"]};t.userTypesMap={guest:{userType:"guest",type:"visitante",name:"Visitante"},operador:{userType:"operator",type:"operador",name:"Operador"},cliente:{userType:"customer",type:"cliente",name:"Cliente"},profissional:{userType:"provider",type:"profissional",name:"Profissional"},sistema:{userType:"system",type:"sistema",name:"sistema"}};t.dashboardGuideMap={immersion:{label:"Agende sua imers\xE3o",buttonLabel:"Reserve seu hor\xE1rio",link:"webinar-agendamento",bubble:!0},config:{label:"Adicione sua logo e descri\xE7\xE3o",buttonLabel:"Ir para configura\xE7\xF5es",link:"profissional/configuracoes/meu-negocio"},project:{label:"Crie seu primeiro projeto",buttonLabel:"Adicionar projeto",permission:"project"},task:{label:"Adicione suas primeiras tarefas",buttonLabel:"Criar tarefa",permission:"tasks",link:"profissional/produtividade/gestao-tarefas"}};t.subItemsInitialValue={hasSchedule:{checked:!0,label:"Etapas do Cronograma",tooltip:`Aplique as etapas do cronograma, sem as tarefas.
2
- Para aplicar tamb\xE9m as tarefas desse template, selecione Tarefas logo abaixo`},hasTasks:{checked:!0,label:"Tarefas",parent:"hasSchedule"},hasBudget:{checked:!0,label:"Or\xE7amento"},hasFolders:{checked:!0,label:"Pastas"},hasNotes:{checked:!0,label:"Anota\xE7\xF5es"}};t.catalogFilterType={default:"default",range:"range"};t.specificationGroupBy={refurbishGroup:{model:"refurbishGroup",key:"id",name:"name"},category:"category",costCenter:{model:"costCenter",key:"id",name:"name"}};t.paymentStatus={waitingOrder:1,analyzing:2,waitingRelease:3,released:4,transferred:5,markAsPaid:6,allowTransfer:[3,4],allowChange:[1,6],sendEmail:[4,5]};t.purchaseStatus={waitingOrder:1,analyzing:2,pending:3,waitingPurchase:4,delivered:5,markAsPurchased:6,allowChange:[1,6]};t.actions={cancel:"cancel"};t.orderType={pay:"pay",shop:"shop"};t.personTypes={pf:"pf",pj:"pj"};t.asaasPersonTypes={pf:"FISICA",pj:"JURIDICA"};t.stepAccount={personal:0,address:1,documents:2};t.statusVobiPay={PENDING:{color:"#FF8E1B",label:"Em an\xE1lise"}};t.refurbishItemType={product:1,labor:2,parent:3,composition:4,notParent:[1,2,4],productLabor:[1,2]};t.notificationChannel={system:"system",email:"email",whatsApp:"whatsApp"};t.taskStatus={planned:{id:1,name:"planejado"},execution:{id:2,name:"em andamento"},finished:{id:4,name:"conclu\xEDdo"},cancelled:{id:5,name:"cancelado"},notFinished:[1,2],pending:[1,2],all:[1,2,4,5]};t.priority={low:{id:1,name:"baixa",color:"primary50"},average:{id:2,name:"m\xE9dia",color:"warningSecondary70"},high:{id:3,name:"alta",color:"error50"},all:[1,2,3]};t.companyProgress={0:{name:"B\xE1sico",value:25},1:{name:"Intermedi\xE1rio",value:50},2:{name:"Avan\xE7ado",value:75},3:{name:"Expert",value:100}};t.templateType={construction:{value:"construction",label:"Obra"},project:{value:"project",label:"Projeto"},opportunity:{value:"opportunity",label:"Oportunidade"}};t.templateModule={all:{value:"all",label:"Completo"},budget:{value:"budget",label:"Or\xE7amento"}};t.templateCategory={residential:{value:"residential",label:"Residencial"},commercial:{value:"commercial",label:"Comercial"},others:{value:"others",label:"Outros"}};t.propertyTypes={residential:{value:"residential",label:"Residencial"},commercial:{value:"commercial",label:"Comercial"},others:{value:"others",label:"Outros"}};t.planType={free:{value:"free",label:"freemium"},starter:{value:"starter",label:"Starter"},essential:{value:"essential",label:"Essential"}};t.projectTab={step:"step",list:"list"};t.installmentStatuses={pendingPayment:1,paid:2,confirm:3,paidManually:4,inAnalysis:5,refunded:6,refundRequested:7,onGoingRefund:8,chargebackRequested:9,onGoingChargeback:10,waitingChargeback:11,cancelled:12,all:[1,2,3,4,5,6,7,8,9,10],paidVobiPay:[2,3,7,8,9,10,11],bankStatement:[2,4,6,7,8,9,10,11],allPaid:[2,3,4,7,8,9,10,11],allPaidBalance:[2,4,7,8,9,10,11],allPending:[1,5]};t.paymentStatuses={draft:1,open:2,paid:3,cancelled:4,realValues:[2,3],allStatus:[1,2,3,4]};t.billType={income:"receita",expense:"despesa",transfer:"transferencia"};t.paymentTypeValues={expense:{value:"expense",label:"despesa"},income:{value:"income",label:"receita"},transfer:{value:"transfer",label:"transfer\xEAncia"},payment:{value:"payment",label:"pagamento"}};t.financialCategories={serviceSelling:1,productsSelling:2,fee:3,investimentIncome:4,others:5,advanceFutureCapital:6,capitalIncrease:7,bankLoan:8,institutionLoan:9,partnerLoan:10,paymentShareCapital:11};t.getEnumValue=(e,a,o=["id","name"])=>{let n=null;return!e||!a||Object.keys(e).some(s=>e[s][o[0]]===a?(n=e[s][o[1]],!0):!1),n};t.typePrefix={1:"P",2:"S",4:"C"};t.schemaBusinessCustomError={service:"onboarding.services",description:"onboarding.servicesDescription"};t.stepPayAccount={step1:"step1",step2:"step2",finished:"finished"};t.asaasPixType={CPF:"CPF",CNPJ:"CNPJ",EMAIL:"E-mail",PHONE:"Celular",EVP:"Aleat\xF3ria"};t.paymentTypes={pix:1,bankSlip:2,creditCard:3,debitCard:4,transfer:5,money:6,other:7};t.paymentTypesDesc={1:"Pix",2:"Boleto",3:"Cart\xE3o de cr\xE9dito",4:"Cart\xE3o de d\xE9bito",5:"Transfer\xEAncia",6:"Dinheiro",7:"Outro"};t.vobiPayPaymentType={pix:1,bankSlip:2,creditCard:3,all:[1,2,3],1:"pix",2:"bankSlip",3:"creditCard"};t.asaasPaymentStatus={PENDING:{label:"PENDING",value:t.installmentStatuses.pendingPayment},RECEIVED:{label:"RECEIVED",value:t.installmentStatuses.paid},CONFIRMED:{label:"CONFIRMED",value:t.installmentStatuses.confirm},OVERDUE:{label:"OVERDUE",value:null},REFUNDED:{label:"REFUNDED",value:t.installmentStatuses.refunded},RECEIVED_IN_CASH:{label:"RECEIVED_IN_CASH",value:t.installmentStatuses.paidManually},REFUND_REQUESTED:{label:"REFUND_REQUESTED",value:t.installmentStatuses.refundRequested},REFUND_IN_PROGRESS:{label:"REFUND_IN_PROGRESS",value:t.installmentStatuses.onGoingRefund},CHARGEBACK_REQUESTED:{label:"CHARGEBACK_REQUESTED",value:t.installmentStatuses.chargebackRequested},CHARGEBACK_DISPUTE:{label:"CHARGEBACK_DISPUTE",value:t.installmentStatuses.onGoingChargeback},AWAITING_CHARGEBACK_REVERSAL:{label:"AWAITING_CHARGEBACK_REVERSAL",value:t.installmentStatuses.waitingChargeback},DUNNING_REQUESTED:{label:"DUNNING_REQUESTED",value:null},DUNNING_RECEIVED:{label:"DUNNING_RECEIVED",value:null},AWAITING_RISK_ANALYSIS:{label:"AWAITING_RISK_ANALYSIS",value:t.installmentStatuses.inAnalysis}};t.maxLimitPayment={credit:{value:2e4,label:"20.000,00"},installment:{value:15e4,label:"150.000,00"},minimumInstallmentValue:{value:10,label:"10,00"},maximumInstallments:{value:12}};t.asaasWithdrawStatus={PENDING:"PENDING",PROCESSING:"PROCESSING",DONE:"DONE",FAILED:"FAILED",CANCELLED:"CANCELLED",BLOCKED:"BLOCKED"};t.withdrawStatuses={DONE:"Efetuada",PENDING:"Pendente",BANK_PROCESSING:"Processando",CANCELLED:"Cancelada",FAILED:"Falhou",BLOCKED:"Bloqueado",group:{done:["DONE"],open:["PENDING","BANK_PROCESSING"],error:["CANCELLED","FAILED","BLOCKED"]}};t.vobiPayBankAccountType={corrente:"CONTA_CORRENTE",poupanca:"CONTA_POUPANCA",salario:"CONTA_SALARIO",pagamento:"CONTA_DE_PAGAMENTO"};t.withdrawSteps={list:1,fillData:2,confirmData:3};t.billingManagerStatus={pending:1,send:2,error:3,discarded:4,notSent:5,sending:6};t.billingManagerStatusDesc={1:"Aguardando",2:"Enviado",3:"Erro",4:"Descartado",5:"N\xE3o enviado",6:"Enviando"};t.billingManagerChannels={allChannels:["email","sms","whatsapp"],email:{value:"email",label:"E-mail"},sms:{value:"sms",label:"SMS"},whatsapp:{value:"whatsapp",label:"WhatsApp"}};t.billingManagerType={allTypes:["DC","D-3","D0","D+1","D+3","D+6"],billingRulerType:["D-3","D0","D+1","D+3","D+6"],DC:{label:"Cria\xE7\xE3o da cobran\xE7a",value:"DC",tooltip:"Ao criar a cobran\xE7a",message:"de cobran\xE7a criada para {customerName} {value}"},"D-3":{label:"3 dias antes do vencimento",value:"D-3",tooltip:"3 dias antes do vencimento das parcelas",message:"de aviso de vencimento em 3 dias para {customerName} {value}"},D0:{label:"Dia do vencimento",value:"D0",tooltip:"No dia do vencimento da parcela",message:"de aviso de cobran\xE7a vencendo hoje para {customerName} {value}"},"D+1":{label:"1 dia ap\xF3s o vencimento",value:"D+1",tooltip:"1 dia ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 1 dia para {customerName} {value}"},"D+3":{label:"3 dias ap\xF3s o vencimento",value:"D+3",tooltip:"3 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 3 dias para {customerName} {value}"},"D+6":{label:"6 dias ap\xF3s o vencimento",value:"D+6",tooltip:"6 dias ap\xF3s o vencimento de cada parcela",message:"de aviso de cobran\xE7a vencida h\xE1 6 dias para {customerName} {value}"}};t.paymentCreditPermission={allowed:2e4,blocked:0};t.withdrawLimit={pj:{daytime:2e4,nightly:5e3},pf:{daytime:2e4,nightly:5e3}};t.sinapiCostOriginTranslate=[{sinapi:"CR",platform:"Coeficiente de Representatividade"},{sinapi:"C",platform:"Calculado"},{sinapi:"AS",platform:"Custo atribu\xEDdo S\xE3o Paulo"}];t.externalBase={sinapi:"SINAPI",all:["SINAPI"]};t.purchaseSolicitationStatus={draft:1,open:2,quote:3,buy:4,closed:5,canceled:6,editable:[1,2,3],ongoing:[2,3,4]};t.purchaseSolicitationStatusColor={[t.purchaseSolicitationStatus.draft]:"warningSecondary70",[t.purchaseSolicitationStatus.open]:"warningSecondary70",[t.purchaseSolicitationStatus.quote]:"primary50",[t.purchaseSolicitationStatus.buy]:"success30",[t.purchaseSolicitationStatus.canceled]:"danger50",[t.purchaseSolicitationStatus.closed]:"neutral40"};t.purchaseOrderStatus={draft:7,open:8,sent:9,accepted:10,refused:11,closed:12,requestableRefund:[10,12],chargeableAdministrationFee:[10,12],editable:[7,8,9],ongoing:[8,9],finished:[10,12]};t.purchaseOrderStatusColor={[t.purchaseOrderStatus.open]:"warningSecondary70",[t.purchaseOrderStatus.sent]:"primary40",[t.purchaseOrderStatus.accepted]:"success30",[t.purchaseOrderStatus.refused]:"error50",[t.purchaseOrderStatus.closed]:"neutral40"};t.paymentOrderType={fee:"fee",refund:"refund",order:"order"};t.purchaseItemsStatus={all:"all",notPurchased:"not-purchased",notBudgeted:"not-budgeted",requested:"requested",purchased:"purchased"};t.optionsRefurbishReport={financialPhysical:"financialPhysics",budgeted:"budgeted",financial:"financial",physic:"physic",financialPhysicBudgeted:{value:"financialPhysics.budgeted"},physicBudgeted:{value:"physic.budgeted"},physicAccomplished:{value:"physic.accomplished"},financialBudgeted:{value:"financial.budgeted"},financialAccomplished:{value:"financial.accomplished"},financialBudAcp:{value:"financial.budgetedAccomplished"},physicBudAcp:{value:"physic.budgetedAccomplished"}};t.refurbishReportType={budgeted:[t.optionsRefurbishReport.financialPhysicBudgeted.value,t.optionsRefurbishReport.physicBudgeted.value,t.optionsRefurbishReport.financialBudgeted.value],accomplished:[t.optionsRefurbishReport.physicAccomplished.value,t.optionsRefurbishReport.financialAccomplished.value],budgetedAccomplished:[t.optionsRefurbishReport.financialBudAcp.value,t.optionsRefurbishReport.physicBudAcp.value],common:[t.optionsRefurbishReport.financialPhysicBudgeted.value,t.optionsRefurbishReport.physicBudgeted.value,t.optionsRefurbishReport.physicBudAcp.value,t.optionsRefurbishReport.financialBudgeted.value,t.optionsRefurbishReport.financialBudAcp.value],measurement:[t.optionsRefurbishReport.physicAccomplished.value],financial:[t.optionsRefurbishReport.financialAccomplished.value],customColumns:[t.optionsRefurbishReport.physicBudAcp.value,t.optionsRefurbishReport.financialBudAcp.value],simpleExport:[t.optionsRefurbishReport.physicAccomplished.value,t.optionsRefurbishReport.financialAccomplished.value,t.optionsRefurbishReport.physicBudgeted.value,t.optionsRefurbishReport.financialBudgeted.value]};t.purchaseQuoteStatus={draft:13,open:14,pendingResponse:15,quoted:16,buy:17,finished:18,editable:[13,14,15],ongoing:[14,15,16,17]};t.purchaseQuoteStatusColor={[t.purchaseQuoteStatus.draft]:"warningSecondary70",[t.purchaseQuoteStatus.open]:"warningSecondary70",[t.purchaseQuoteStatus.pendingResponse]:"warningSecondary70",[t.purchaseQuoteStatus.quoted]:"primary40",[t.purchaseQuoteStatus.buy]:"success30",[t.purchaseQuoteStatus.finished]:"neutral40"};t.quoteSupplierStatus={pending:{id:1,name:"N\xE3o enviado",color:"neutral40"},waitingResponse:{id:2,name:"Aguardando resposta",color:"warningSecondary70"},refused:{id:3,name:"Recusado",color:"error40"},answered:{id:4,name:"Respondido",color:"primary50"},analyzed:{id:5,name:"Analisado",color:"primary50"},buy:{id:6,name:"Compra e contrata\xE7\xE3o",color:"success30"},finished:{id:7,name:"Finalizado",color:"success30"},withoutResponse:[1,2],answeredOptions:[4,5,6,7],canApprove:[4,5],canCreateOrder:[4,5,6]};t.quoteSupplierMoveStatus={[t.quoteSupplierStatus.pending.id]:{forward:[t.quoteSupplierStatus.waitingResponse],back:[]},[t.quoteSupplierStatus.waitingResponse.id]:{forward:[t.quoteSupplierStatus.answered,t.quoteSupplierStatus.refused],back:[t.quoteSupplierStatus.pending]},[t.quoteSupplierStatus.refused.id]:{forward:[],back:[t.quoteSupplierStatus.pending,t.quoteSupplierStatus.waitingResponse]},[t.quoteSupplierStatus.answered.id]:{forward:[t.quoteSupplierStatus.analyzed,t.quoteSupplierStatus.refused],back:[t.quoteSupplierStatus.waitingResponse]},[t.quoteSupplierStatus.analyzed.id]:{forward:[t.quoteSupplierStatus.refused],back:[t.quoteSupplierStatus.answered]},[t.quoteSupplierStatus.buy.id]:{forward:[],back:[]},[t.quoteSupplierStatus.finished.id]:{forward:[],back:[]}};t.extraValuesPayment={taxes:"taxes",discount:"discount",shipping:"shipping",dueDateDiscount:"dueDateDiscount",dueDateDiscountType:"dueDateDiscountType",dueDateLimitDays:"dueDateLimitDays",fine:"fine",fineType:"fineType",interest:"interest"};t.extraValuesPaymentType={simple:[t.extraValuesPayment.taxes,t.extraValuesPayment.discount,t.extraValuesPayment.shipping],asaas:[t.extraValuesPayment.dueDateDiscount,t.extraValuesPayment.dueDateDiscountType,t.extraValuesPayment.dueDateLimitDays,t.extraValuesPayment.fine,t.extraValuesPayment.fineType,t.extraValuesPayment.interest]};t.fineInterestDiscountType={percentage:{value:"PERCENTAGE",label:"Percentual"},fixed:{value:"FIXED",label:"Valor fixo"}};t.paymentPermissions={financialResume:"financialResume",financialSupplier:"financialSupplier",financialOwnBusiness:"financialOwnBusiness",financialIncome:"financialIncome",financialExpense:"financialExpense",financialTransfer:"financialTransfer",financialResults:"financialResults",financialBankStatement:"financialBankStatement",financialReport:"financialReport",projectResume:"projectResume",projectSupplier:"projectSupplier",projectOwnBusiness:"projectOwnBusiness",projectIncome:"projectIncome",projectExpense:"projectExpense",projectResults:"projectResults",projectBudgetedAccomplished:"projectBudgetedAccomplished"};t.mapOrderField={r:"idRefurbishItem",i:"idItem",e:"externalBaseCode"};var pe={on(e,a){document.addEventListener(e,a)},dispatch(e,a){document.dispatchEvent(new CustomEvent(e,{detail:a}))},remove(e,a){document.removeEventListener(e,a)}};var me=e=>{var n,s,d,u;let a=(u=(d=(s=(n=e==null?void 0:e.response)==null?void 0:n.data)==null?void 0:s.errors)==null?void 0:d[0])==null?void 0:u.description;return a==null?void 0:a.replace(/(asaas|Asaas)/g,"Vobi Pay")};var N=(e,a)=>{if(Array.isArray(e)===!1)return null;let o=null;return e.some(n=>(o=a(n),!!o)),o};var fe=(e,a)=>e?e[a]?e[a]:N(e.or,o=>o[a]):null;var ge=e=>{let a=e.lastIndexOf(".");return a===-1?e:e.substring(0,a)};var ye=(e,a)=>e&&e.length&&a&&a.length?e.map(o=>Object.entries(o).filter(([n])=>a.includes(n)).reduce((n,[s,d])=>Object.assign(n,{[s]:d}),{})):[];var he=e=>e.filter(a=>A(a).length>0&&a);var be=(e,a={})=>{let o={decimalCount:2,decimal:",",thousands:".",...a},{decimal:n,thousands:s,currencySymbol:d}=o,{decimalCount:u}=o;try{u=Math.abs(u),u=isNaN(u)?2:u;let p=e<0?"-":"",c=parseInt(e=Math.abs(Number(e)||0).toFixed(u),10).toString(),g=c.length>3?c.length%3:0;return(d?`${p}${d}`:p)+(g?c.substr(0,g)+s:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,`$1${s}`)+(u?n+Math.abs(e-parseInt(c,10)).toFixed(u).slice(2):"")}catch(p){return console.log(p),""}};var m=y(require("moment-timezone")),w=e=>{let a=e?new Date(e):new Date,o={timeZone:"America/Sao_Paulo"},n=a.toLocaleString("en-US",o);return new Date(n)},Ee=(e,a,o,n,s)=>{if(!e)return null;if(s)return(0,m.default)(e,a);let d=m.default.utc(e);return n||d.local(),o&&d.locale(o),d.format(a)},ve=(e,a="YYYY-MM-DD")=>{let o=(0,m.default)(e,a).add(1,"days");return typeof e=="string"?o.format(a):o.toDate()},O=(e=new Date,a=1)=>{let o=new Date(e.setDate(e.getDate()+a));return o.getDay()%6?o:O(o)},k=(e=new Date,a=1)=>{let o=new Date(e.setDate(e.getDate()-a));return o.getDay()%6?o:k(o)},v=e=>e?m.default.utc(e).local():null,U=e=>e&&m.default.tz(new Date(e),"America/Sao_Paulo"),Ce=(e,a)=>{let o=U(e);return o&&o.format(a||"YYYY-MM-DDTHH:mm:ssZ")},xe=(e,a)=>{if(!e||!a)return null;let o=v(e),n=v(a);return!o||!n?null:n.diff(o,"months")},Se=(e,a)=>{var o;return!e||!a?null:(o=v(e))==null?void 0:o.isAfter(a)},De=(e=!0)=>{let a=new Date;return e?new Date(a.getFullYear(),a.getMonth(),a.getDate()):a},Re=(e=!0)=>{let a=new Date;return e?new Date(a.getFullYear(),a.getMonth(),a.getDate()-1):a},Ae=(e=!0)=>{let a=new Date;return e?new Date(a.getFullYear(),a.getMonth(),a.getDate()+1):a},Be=e=>{let a=w(e);return`${a.getFullYear()}${a.getMonth().toString().padStart(2,"0")}`},Ne=(e,a)=>{let o=new Date(e),n=new Date;return new Date(n.getFullYear()-a,n.getMonth(),n.getDate()).getTime()>o.getTime()},Ie=e=>m.default.max(e),Pe=e=>m.default.min(e),Te=e=>(0,m.default)(e).isValid();var Le=y(require("dayjs"));var C=e=>e.length===2?[e[0].replace(/\./g,""),e[1].replace(/\./g,"")]:e;var _=e=>{let a=C(e.toString().replace("%","").replace("R$","").trim().split(","));if(a.length===2)return a.join(".");let o=C(a[0].split("."));return o.length===2?o.join("."):a[0].replace(/\./g,"")},we=e=>{if(e==null)return e;if(!_(e))return null;let a=Number(_(e));return a>=Number.MAX_SAFE_INTEGER||Number.isNaN(a)?null:a};var Oe=e=>{let a=e.indexOf("."),o=e.length;return a&&o?e.substr(a,o):""};var ke=new RegExp('<img[^>]+src="(https://vobi-storage[^">]+)"',"gm");var Ue=e=>!isNaN(parseFloat(e))&&!isNaN(e-0);var _e=e=>{try{return!!new URL(e)}catch{return!1}};var F=y(require("jwt-decode")),q=e=>{var a,o;return(a=e.headers)!=null&&a.authorization&&((o=e.headers)==null?void 0:o.authorization.split(" ")[0])==="Bearer"?e.headers.authorization.split(" ")[1]:e.query&&e.query.token?e.query.token:null},Fe=(e,a,o)=>{try{let n=q(e);if(n){let{user:s,isCustomerView:d,accessedBy:u,vaultToken:p}=(0,F.default)(n);e.user={...s,isCustomerView:d,accessedBy:u,vaultToken:p}}return o()}catch(n){console.log("err",n);let s=new Error("Invalid token");return o(s)}};var qe=(e,a,o,n)=>{let s=e.idStatus>=5?"projetos":"oportunidades",d=a==="customer"?"cliente":"profissional",u=`/${d}/${s}/perfil/${e.id}`,p=`/${d}`;return`${{operator:u,provider:u,customer:p}}/arquivos?arquivo=${o.id}${n?"&visualizar":""}`};var Ve=e=>(e==null?void 0:e.length)===0?null:e;var Ge=(e,a="0000")=>(a+e).slice(a.length*-1);var Me=(e,a=!1)=>{let o={};for(let n=0;n<e.length;n++){let s=e[n];o[s.value]=a?{...s}:s.label}return o};var je=e=>e.replace(/ /g,"").split("-").reduce((a,o)=>a+B(o),"");var ze=e=>e==null?void 0:e.replace(/[,-./]/g,"");var Ye=({id:e,name:a,email:o,idCompany:n,userType:s,type:d,isOwner:u,MGMCode:p,groupPermission:c,isActive:g,limitAccess:V,company:x})=>({id:e,name:a,email:o,idCompany:n,userType:s,type:d,isOwner:u,MGMCode:p,groupPermission:c,isActive:g,limitAccess:V,idPlan:x==null?void 0:x.idPlan});var Qe=e=>{let a=new Array(e.length),o=0;return new Promise((n,s)=>{e.forEach((d,u)=>{Promise.resolve(d).then(n).catch(p=>{a[u]=p,o+=1,o===e.length&&s(a)})})})};var $e=(e,a)=>Object.keys(a).filter(o=>o!==e).reduce((o,n)=>({...o,[n]:a[n]}),{});var We=(e,a,o=!0)=>{if(!e)return e;let n=e.toLowerCase();return o&&(n=n.replace(new RegExp("\\s","g"),"")),n=n.replace(new RegExp("[\xE0\xE1\xE2\xE3\xE4\xE5]","g"),"a"),n=n.replace(new RegExp("\xE6","g"),"ae"),n=n.replace(new RegExp("\xE7","g"),"c"),n=n.replace(new RegExp("[\xE8\xE9\xEA\xEB]","g"),"e"),n=n.replace(new RegExp("[\xEC\xED\xEE\xEF]","g"),"i"),n=n.replace(new RegExp("\xF1","g"),"n"),n=n.replace(new RegExp("[\xF2\xF3\xF4\xF5\xF6]","g"),"o"),n=n.replace(new RegExp("\u0153","g"),"oe"),n=n.replace(new RegExp("[\xF9\xFA\xFB\xFC]","g"),"u"),n=n.replace(new RegExp("[\xFD\xFF]","g"),"y"),n=n.replace("'",""),n=n.replace("\xB4",""),n=n.replace("`",""),a&&(n=n.replace(new RegExp("\\W","g"),"")),n};var He=e=>e==null?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9-/\s]/g,"").replace(/\//g,"").replace(/\s+/g,"-").toLowerCase();var Je=(e,a)=>e.reduce((o,n,s)=>{let d=Math.floor(s/a),u=[...o];return o[d]||(u[d]=[]),u[d].push(n),u},[]);var Ke=(e,a)=>(e==null?void 0:e.map(o=>a?o[a]:o).reduce((o,n)=>o+(Number(n||0)||0),0))||0;var Ze=(e,a)=>(e==null?void 0:e.map(o=>a(o)).reduce((o,n)=>o+(Number(n||0)||0),0))||0;var Xe=e=>{let a=e.replace(/\D/g,"");return/^(?:\+?55 ?)?(?:0?[1-9]{2})?9\d{8}$/.test(a)};0&&(module.exports={BAD_GATEWAY,BAD_REQUEST,FORBIDDEN,INTERNAL_SERVER_ERROR,IsJsonString,METHOD_NOT_ALLOWED,NOT_ALLOWED,NOT_FOUND,PromiseEach,SERVICE_UNAVAILABLE,UNAUTHORIZED,asArray,asBrazilianDate,asDate,asyncForEach,brazilianDateTime,brazilianDateToDate,capitalize,checkCnpj,checkCpf,checkEmail,containsEncodedComponents,curry,dateIsValid,decodeToken,decrypt,diffObject,dynamici18nString,elasticTransformOr,encrypt,enumHelper,error,eventBus,extractAsaasError,extractValueFromWhere,filterAttributes,filterEmpty,findValue,formatAmount,formatDate,formatNumber,getExtension,getMonthNumber,getNameWithoutExtension,getNextDay,getNextWeekday,getPreviewsWeekday,getToday,getToken,getTomorrow,getYesterday,imgSrcRegex,isAfter,isNumber,isOfAge,isValidUrl,makeRefurbishFileUrl,maxDateToList,minDateToList,monthsBetween,nullIfEmpty,padLeft,parseArrayAsObject,parseRouteToModel,prepareDoc,prepareSession,promiseAny,removeProperty,removeSpecialChar,slugify,splitList,sum,sumByFunction,validateMobilePhoneNumber,valueReplacer});
1
+ "use strict";var P=Object.create;var B=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var S=(a,s)=>()=>(a&&(s=a(a=0)),s);var O=(a,s)=>()=>(s||a((s={exports:{}}).exports,s),s.exports),T=(a,s)=>{for(var n in s)B(a,n,{get:s[n],enumerable:!0})},l=(a,s,n,C)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of R(s))!A.call(a,d)&&d!==n&&B(a,d,{get:()=>s[d],enumerable:!(C=U(s,d))||C.enumerable});return a},m=(a,s,n)=>(l(a,s,"default"),n&&l(n,s,"default")),g=(a,s,n)=>(n=a!=null?P(x(a)):{},l(s||!a||!a.__esModule?B(n,"default",{value:a,enumerable:!0}):n,a)),b=a=>l(B({},"__esModule",{value:!0}),a);var t=S(()=>{"use strict"});var y=O((oo,D)=>{"use strict";t();var f=g(require("fs")),i=g(require("path"));function h(a,s=[]){return f.readdirSync(a).forEach(C=>{let d=i.join(a,C);f.statSync(d).isDirectory()?s=h(d,s):d.endsWith(".ts")&&d!==__filename&&s.push(d)}),s}var J=i.join(__dirname,"functions"),M=h(J);M.forEach(a=>{let s=`./${i.relative(__dirname,a).replace(/\\/g,"/")}`,n=i.basename(a,i.extname(a));D.exports[n]=require(s)})});var r={};T(r,{BAD_GATEWAY:()=>q,BAD_REQUEST:()=>e,FORBIDDEN:()=>k,INTERNAL_SERVER_ERROR:()=>E,METHOD_NOT_ALLOWED:()=>F,NOT_ALLOWED:()=>L,NOT_FOUND:()=>I,SERVICE_UNAVAILABLE:()=>w,UNAUTHORIZED:()=>p,error:()=>c});module.exports=b(r);t();t();t();t();var N={userNotFound:"Usu\xE1rio n\xE3o foi encontrado.",pageNotFound:"Desculpe. P\xE1gina n\xE3o encontrada.",notAuthorized:"N\xE3o autorizado.",tokenExpired:"Sess\xE3o expirada.",invalidToken:"Token inv\xE1lido.",notUpdated:"Nenhum registro foi alterado.",cantDelete:"Esse registro est\xE1 sendo usado, por isso n\xE3o \xE9 poss\xEDvel apaga-lo.",general:"Ocorreu um erro.",sentError:"Erro ao enviar proposta",noUser:"Usu\xE1rio n\xE3o encontrado.",noEmail:"E-mail n\xE3o foi informado",noPassword:"Senha n\xE3o foi informada.",invalidEmail:"O e-mail informado \xE9 inv\xE1lido.",uniqueEmail:"O e-mail informado j\xE1 est\xE1 cadastrado.",invalidCPF:"O CPF informado \xE9 inv\xE1lido.",invalidCNPJ:"O CNPJ informado \xE9 inv\xE1lido.",uniqueName:"Nome informado j\xE1 cadastrado.",noName:"Nome n\xE3o foi informado.",noData:"Dados n\xE3o informados.",noDate:"Data n\xE3o informada.",noModel:"Ocorreu um erro com a entidade",invalidId:"Id inv\xE1lido",invalidCredentials:"Usu\xE1rio e/ou senha inv\xE1lidos.",noPhone:"Telefone n\xE3o foi informado.",noCPF:"CPF n\xE3o foi informado.",noRG:"RG n\xE3o foi informado.",noZipcode:"CEP n\xE3o foi informado.",noStreet:"Endere\xE7o n\xE3o foi informado.",noNumber:"N\xFAmero n\xE3o foi informado.",noState:"Estado n\xE3o foi informado.",noCity:"Cidade n\xE3o foi informada.",noNeighborhood:"Bairro n\xE3o foi informado.",noCNPJ:"CNPJ n\xE3o foi informado.",noCompanyName:"Raz\xE3o social n\xE3o foi informada.",noTrademarkName:"Nome fantasia n\xE3o foi informado.",noCompanyZipcode:"CEP da empresa n\xE3o foi informado.",noCompanyStreet:"Endere\xE7o da empresa n\xE3o foi informado.",noCompanyNumber:"N\xFAmero da empresa n\xE3o foi informado.",noCompanyState:"Estado da empresa n\xE3o foi informado.",noCompanyCity:"Cidade da empresa n\xE3o foi informado.",noCompanyNeighborhood:"Bairro da empresa n\xE3o foi informado.",noBirthdate:"Data de nascimento n\xE3o foi informada.",noCompany:"Empresa n\xE3o informada.",invalidURL:"URL inv\xE1lida.",noPermissions:"Permiss\xF5es n\xE3o encontradas.",fileLimit50:"Os arquivos n\xE3o pode ter mais de 50 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo.",fileLimit10:"Os arquivos n\xE3o pode ter mais de 10 MB. Para arquivos maiores voc\xEA pode informar a url de um servidor externo no corpo da mensagem.",maxLength:"O nome deve ter no m\xE1ximo 255 caracteres.",invalidData:"Dados inv\xE1lidos.",invalidDate:"Data inv\xE1lida.",invalidDates:"Data de in\xEDcio n\xE3o pode ser maior que data de fim.",invalidUUID:"A URL informada n\xE3o foi encontrada, verifique se est\xE1 correto o link desejado."};var c={},v={en:N,"pt-br":"PT_BR_LOCALE"},o=v.en||v.en,e=400,L=405,p=401,k=403,I=404,F=405,E=500,q=502,w=503;c.NOT_FOUND={userNotFound:{statusCode:I,code:"NF-00001",message:o.userNotFound},pageNotFound:{statusCode:I,code:"NF-00002",message:o.pageNotFound}};c.UNAUTHORIZED={notAuthorized:{statusCode:p,code:"UA-00001",message:o.notAuthorized},tokenExpired:{statusCode:p,code:"UA-00002",message:o.tokenExpired},invalidToken:{statusCode:p,code:"UA-00003",message:o.invalidToken}};c.NOT_ALLOWED={notUpdated:{statusCode:L,code:"NA-00001",message:o.notUpdated},cantDelete:{statusCode:L,code:"NA-00002",message:o.cantDelete}};c.INTERNAL_SERVER_ERROR={general:{statusCode:E,code:"ISE-00001",message:o.general},sentError:{statusCode:E,code:"ISE-00002",message:o.sentError}};c.BAD_REQUEST={noUser:{statusCode:e,code:"LIB-B-00001",message:o.noUser},noEmail:{statusCode:e,code:"LIB-B-00002",message:o.noEmail},noPassword:{statusCode:e,code:"LIB-B-00003",message:o.noPassword},invalidEmail:{statusCode:e,code:"LIB-B-00004",message:o.invalidEmail},uniqueEmail:{statusCode:e,code:"LIB-B-00005",message:o.uniqueEmail},invalidCPF:{statusCode:e,code:"LIB-B-00006",message:o.invalidCPF},invalidCNPJ:{statusCode:e,code:"LIB-B-00007",message:o.invalidCNPJ},uniqueName:{statusCode:e,code:"LIB-B-00008",message:o.uniqueName},noName:{statusCode:e,code:"LIB-B-00009",message:o.noName},noData:{statusCode:e,code:"LIB-B-00010",message:o.noData},invalidCredentials:{statusCode:e,code:"LIB-B-00011",message:o.invalidCredentials},tokenPasswordError:{statusCode:e,code:"LIB-B-00012",message:o.tokenPasswordError},errPassword:{statusCode:e,code:"LIB-B-00013",message:o.errPassword},noPhone:{statusCode:e,code:"LIB-B-00014",message:o.noPhone},noCPF:{statusCode:e,code:"LIB-B-00015",message:o.noCPF},noRG:{statusCode:e,code:"LIB-B-00016",message:o.noRG},noZipcode:{statusCode:e,code:"LIB-B-00017",message:o.noZipcode},noStreet:{statusCode:e,code:"LIB-B-00018",message:o.noStreet},noNumber:{statusCode:e,code:"LIB-B-00019",message:o.noNumber},noState:{statusCode:e,code:"LIB-B-00020",message:o.noState},noCity:{statusCode:e,code:"LIB-B-00021",message:o.noCity},noNeighborhood:{statusCode:e,code:"LIB-B-00022",message:o.noNeighborhood},noCNPJ:{statusCode:e,code:"LIB-B-00023",message:o.noCNPJ},noCompanyName:{statusCode:e,code:"LIB-B-00024",message:o.noCompanyName},noTrademarkName:{statusCode:e,code:"LIB-B-00025",message:o.noTrademarkName},noCompanyZipcode:{statusCode:e,code:"LIB-B-00026",message:o.noCompanyZipcode},noCompanyStreet:{statusCode:e,code:"LIB-B-00027",message:o.noCompanyStreet},noCompanyNumber:{statusCode:e,code:"LIB-B-00028",message:o.noCompanyNumber},noCompanyState:{statusCode:e,code:"LIB-B-00029",message:o.noCompanyState},noCompanyCity:{statusCode:e,code:"LIB-B-00030",message:o.noCompanyCity},noCompanyNeighborhood:{statusCode:e,code:"PRO-00031",message:o.noCompanyNeighborhood},noBirthdate:{statusCode:e,code:"LIB-B-00032",message:o.noBirthdate},noCompany:{statusCode:e,code:"LIB-B-00033",message:o.noCompany},noParameters:{statusCode:e,code:"LIB-B-00034",message:o.noParameters},invalidDoc:{statusCode:e,code:"LIB-B-00035",message:o.invalidDoc},docAlreadyExists:{statusCode:e,code:"LIB-B-00036",message:o.docAlreadyExists},invalidURL:{statusCode:e,code:"LIB-B-00037",message:o.invalidURL},noPermissions:{statusCode:e,code:"LIB-B-00038",message:o.noPermissions},fileLimit50:{statusCode:e,code:"LIB-B-00039",message:o.fileLimit50},fileLimit10:{statusCode:e,code:"LIB-B-00040",message:o.fileLimit10},invalidDates:{statusCode:e,code:"LIB-B-00041",message:o.invalidDates},maxLength:{statusCode:e,code:"LIB-B-00042",message:o.maxLength},uniqueCode:{statusCode:e,code:"LIB-B-00043",message:o.uniqueCode},invalidValue:{statusCode:e,code:"LIB-B-00044",message:o.invalidValue},invalidData:{statusCode:e,code:"LIB-B-00045",message:o.invalidData},invalidUUID:{statusCode:e,code:"LIB-B-00046",message:o.invalidUUID},noDate:{statusCode:e,code:"LIB-B-00047",message:o.noDate},invalidDate:{statusCode:e,code:"LIB-B-00048",message:o.invalidDate},invalidId:{statusCode:e,code:"LIB-B-00049",message:o.invalidId},noModel:{statusCode:e,code:"LIB-B-00050",message:o.noModel},sequelizeValidation:{statusCode:e,code:"LIB-B-00999"}};m(r,g(y()),module.exports);t();0&&(module.exports={BAD_GATEWAY,BAD_REQUEST,FORBIDDEN,INTERNAL_SERVER_ERROR,METHOD_NOT_ALLOWED,NOT_ALLOWED,NOT_FOUND,SERVICE_UNAVAILABLE,UNAUTHORIZED,error});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vobi_lib",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Vobi Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",