quirons-broker
Advanced tools
Comparing version 0.0.1-alpha.20 to 0.0.1-alpha.21
@@ -20,2 +20,6 @@ import * as t from 'io-ts'; | ||
}>; | ||
export declare function dataMessage<N extends string, T extends t.Mixed>(kind: N, data: T): t.TypeC<{ | ||
kind: t.LiteralC<N>; | ||
data: T; | ||
}>; | ||
export declare function userMessage<N extends string, T extends t.Mixed>(kind: N, content: T): t.TypeC<{ | ||
@@ -22,0 +26,0 @@ kind: t.LiteralC<N>; |
@@ -22,3 +22,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.senderMessage = exports.userMessage = exports.metaMessage = exports.Method = exports.Identification = void 0; | ||
exports.senderMessage = exports.userMessage = exports.dataMessage = exports.metaMessage = exports.Method = exports.Identification = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -46,2 +46,9 @@ exports.Identification = t.type({ | ||
exports.metaMessage = metaMessage; | ||
function dataMessage(kind, data) { | ||
return t.type({ | ||
kind: t.literal(kind), | ||
data | ||
}); | ||
} | ||
exports.dataMessage = dataMessage; | ||
// Type for a user message (with identification) | ||
@@ -48,0 +55,0 @@ function userMessage(kind, content) { |
245
index.d.ts
import * as t from 'io-ts'; | ||
export { Message as TtalkMessage } from './ttalk/messages'; | ||
export { Message as ESocialMessage } from './esocial/messages'; | ||
export { Message as InternalMessage } from './internal/index'; | ||
@@ -483,3 +484,245 @@ export declare const Message: t.UnionC<[t.UnionC<[t.TypeC<{ | ||
errorMessage: t.StringC; | ||
}>]>]>, t.UnionC<[t.UnionC<[t.TypeC<{ | ||
}>]>]>, t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"eSocialResponse">; | ||
content: t.UnionC<[t.TypeC<{ | ||
error: t.ArrayC<t.StringC>; | ||
}>, t.TypeC<{ | ||
response: t.StringC; | ||
}>]>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"eSocial">; | ||
identification: t.TypeC<{ | ||
userId: t.StringC; | ||
branchId: t.StringC; | ||
}>; | ||
content: t.TypeC<{ | ||
action: t.UnionC<[t.LiteralC<"build">, t.LiteralC<"validate">]>; | ||
message: t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"evtCAT">; | ||
data: t.TypeC<{ | ||
evtCAT: t.TypeC<{ | ||
$: t.TypeC<{ | ||
Id: t.StringC; | ||
}>; | ||
ideEvento: t.IntersectionC<[t.TypeC<{ | ||
indRetif: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
tpAmb: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<7>, t.LiteralC<8>, t.LiteralC<9>]>; | ||
procEmi: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<22>, t.LiteralC<81>, t.LiteralC<91>]>; | ||
verProc: t.StringC; | ||
}>, t.PartialC<{ | ||
nrRecibo: t.StringC; | ||
}>]>; | ||
ideEmpregador: t.TypeC<{ | ||
tpInsc: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
nrInsc: t.StringC; | ||
}>; | ||
ideVinculo: t.IntersectionC<[t.TypeC<{ | ||
cpfTrab: t.StringC; | ||
}>, t.PartialC<{ | ||
matricula: t.StringC; | ||
codCateg: t.NumberC; | ||
}>]>; | ||
cat: t.IntersectionC<[t.TypeC<{ | ||
dtAcid: t.StringC; | ||
tpAcid: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>]>; | ||
tpCat: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>]>; | ||
indCatObito: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
indComunPolicia: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
codSitGeradora: t.NumberC; | ||
iniciatCAT: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>]>; | ||
localAcidente: t.IntersectionC<[t.TypeC<{ | ||
tpLocal: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<5>, t.LiteralC<6>, t.LiteralC<9>]>; | ||
dscLograd: t.StringC; | ||
nrLograd: t.StringC; | ||
}>, t.PartialC<{ | ||
dscLocal: t.StringC; | ||
tpLograd: t.StringC; | ||
complemento: t.StringC; | ||
bairro: t.StringC; | ||
cep: t.StringC; | ||
codMunic: t.NumberC; | ||
uf: t.UnionC<[t.LiteralC<"AC">, t.LiteralC<"AL">, t.LiteralC<"AP">, t.LiteralC<"AM">, t.LiteralC<"BA">, t.LiteralC<"CE">, t.LiteralC<"DF">, t.LiteralC<"ES">, t.LiteralC<"GO">, t.LiteralC<"MA">, t.LiteralC<"MT">, t.LiteralC<"MS">, t.LiteralC<"MG">, t.LiteralC<"PA">, t.LiteralC<"PB">, t.LiteralC<"PR">, t.LiteralC<"PE">, t.LiteralC<"PI">, t.LiteralC<"RJ">, t.LiteralC<"RN">, t.LiteralC<"RS">, t.LiteralC<"RO">, t.LiteralC<"RR">, t.LiteralC<"SC">, t.LiteralC<"SP">, t.LiteralC<"SE">, t.LiteralC<"TO">]>; | ||
pais: t.StringC; | ||
codPostal: t.StringC; | ||
ideLocalAcid: t.TypeC<{ | ||
tpInsc: t.UnionC<[t.LiteralC<1>, t.LiteralC<3>, t.LiteralC<4>]>; | ||
nrInsc: t.StringC; | ||
}>; | ||
}>]>; | ||
parteAtingida: t.TypeC<{ | ||
codParteAting: t.NumberC; | ||
lateralidade: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>]>; | ||
}>; | ||
agenteCausador: t.TypeC<{ | ||
codAgntCausador: t.NumberC; | ||
}>; | ||
}>, t.PartialC<{ | ||
hrAcid: t.NumberC; | ||
hrsTrabAntesAcid: t.NumberC; | ||
dtObito: t.StringC; | ||
obsCAT: t.StringC; | ||
atestado: t.IntersectionC<[t.TypeC<{ | ||
dtAtendimento: t.StringC; | ||
hrAtendimento: t.NumberC; | ||
indInternacao: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
durTrat: t.NumberC; | ||
indAfast: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
dscLesao: t.NumberC; | ||
codCID: t.StringC; | ||
emitente: t.TypeC<{ | ||
nmEmit: t.StringC; | ||
ideOC: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>]>; | ||
nrOC: t.StringC; | ||
ufOC: t.UnionC<[t.LiteralC<"AC">, t.LiteralC<"AL">, t.LiteralC<"AP">, t.LiteralC<"AM">, t.LiteralC<"BA">, t.LiteralC<"CE">, t.LiteralC<"DF">, t.LiteralC<"ES">, t.LiteralC<"GO">, t.LiteralC<"MA">, t.LiteralC<"MT">, t.LiteralC<"MS">, t.LiteralC<"MG">, t.LiteralC<"PA">, t.LiteralC<"PB">, t.LiteralC<"PR">, t.LiteralC<"PE">, t.LiteralC<"PI">, t.LiteralC<"RJ">, t.LiteralC<"RN">, t.LiteralC<"RS">, t.LiteralC<"RO">, t.LiteralC<"RR">, t.LiteralC<"SC">, t.LiteralC<"SP">, t.LiteralC<"SE">, t.LiteralC<"TO">]>; | ||
}>; | ||
}>, t.PartialC<{ | ||
dscCompLesao: t.StringC; | ||
diagProvavel: t.StringC; | ||
observacao: t.StringC; | ||
}>]>; | ||
catOrigem: t.TypeC<{ | ||
nrRecCatOrig: t.StringC; | ||
}>; | ||
}>]>; | ||
}>; | ||
}>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"evtMonit">; | ||
data: t.TypeC<{ | ||
evtMonit: t.TypeC<{ | ||
$: t.TypeC<{ | ||
Id: t.StringC; | ||
}>; | ||
ideEvento: t.IntersectionC<[t.TypeC<{ | ||
indRetif: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
tpAmb: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<7>, t.LiteralC<8>, t.LiteralC<9>]>; | ||
procEmi: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<22>, t.LiteralC<81>, t.LiteralC<91>]>; | ||
verProc: t.StringC; | ||
}>, t.PartialC<{ | ||
nrRecibo: t.StringC; | ||
}>]>; | ||
ideEmpregador: t.TypeC<{ | ||
tpInsc: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
nrInsc: t.StringC; | ||
}>; | ||
ideVinculo: t.IntersectionC<[t.TypeC<{ | ||
cpfTrab: t.StringC; | ||
}>, t.PartialC<{ | ||
matricula: t.StringC; | ||
codCateg: t.NumberC; | ||
}>]>; | ||
exMedOcup: t.IntersectionC<[t.TypeC<{ | ||
tpExameOcup: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<9>]>; | ||
aso: t.TypeC<{ | ||
dtAso: t.StringC; | ||
resAso: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
exame: t.IntersectionC<[t.TypeC<{ | ||
dtExm: t.StringC; | ||
procRealizado: t.NumberC; | ||
ordExame: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
}>, t.PartialC<{ | ||
obsProc: t.StringC; | ||
indResult: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>]>; | ||
}>]>; | ||
medico: t.TypeC<{ | ||
nmMed: t.StringC; | ||
nrCRM: t.StringC; | ||
ufCRM: t.UnionC<[t.LiteralC<"AC">, t.LiteralC<"AL">, t.LiteralC<"AP">, t.LiteralC<"AM">, t.LiteralC<"BA">, t.LiteralC<"CE">, t.LiteralC<"DF">, t.LiteralC<"ES">, t.LiteralC<"GO">, t.LiteralC<"MA">, t.LiteralC<"MT">, t.LiteralC<"MS">, t.LiteralC<"MG">, t.LiteralC<"PA">, t.LiteralC<"PB">, t.LiteralC<"PR">, t.LiteralC<"PE">, t.LiteralC<"PI">, t.LiteralC<"RJ">, t.LiteralC<"RN">, t.LiteralC<"RS">, t.LiteralC<"RO">, t.LiteralC<"RR">, t.LiteralC<"SC">, t.LiteralC<"SP">, t.LiteralC<"SE">, t.LiteralC<"TO">]>; | ||
}>; | ||
}>; | ||
}>, t.PartialC<{ | ||
respMonit: t.IntersectionC<[t.TypeC<{ | ||
nmResp: t.StringC; | ||
nrCRM: t.StringC; | ||
ufCRM: t.UnionC<[t.LiteralC<"AC">, t.LiteralC<"AL">, t.LiteralC<"AP">, t.LiteralC<"AM">, t.LiteralC<"BA">, t.LiteralC<"CE">, t.LiteralC<"DF">, t.LiteralC<"ES">, t.LiteralC<"GO">, t.LiteralC<"MA">, t.LiteralC<"MT">, t.LiteralC<"MS">, t.LiteralC<"MG">, t.LiteralC<"PA">, t.LiteralC<"PB">, t.LiteralC<"PR">, t.LiteralC<"PE">, t.LiteralC<"PI">, t.LiteralC<"RJ">, t.LiteralC<"RN">, t.LiteralC<"RS">, t.LiteralC<"RO">, t.LiteralC<"RR">, t.LiteralC<"SC">, t.LiteralC<"SP">, t.LiteralC<"SE">, t.LiteralC<"TO">]>; | ||
}>, t.PartialC<{ | ||
cpfResp: t.StringC; | ||
}>]>; | ||
}>]>; | ||
}>; | ||
}>; | ||
}>, t.TypeC<{ | ||
kind: t.LiteralC<"evtExpRisco">; | ||
data: t.TypeC<{ | ||
evtExpRisco: t.TypeC<{ | ||
$: t.TypeC<{ | ||
Id: t.StringC; | ||
}>; | ||
ideEvento: t.IntersectionC<[t.TypeC<{ | ||
indRetif: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
tpAmb: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<7>, t.LiteralC<8>, t.LiteralC<9>]>; | ||
procEmi: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<22>, t.LiteralC<81>, t.LiteralC<91>]>; | ||
verProc: t.StringC; | ||
}>, t.PartialC<{ | ||
nrRecibo: t.StringC; | ||
}>]>; | ||
ideEmpregador: t.TypeC<{ | ||
tpInsc: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
nrInsc: t.StringC; | ||
}>; | ||
ideVinculo: t.IntersectionC<[t.TypeC<{ | ||
cpfTrab: t.StringC; | ||
}>, t.PartialC<{ | ||
matricula: t.StringC; | ||
codCateg: t.NumberC; | ||
}>]>; | ||
infoExpRisco: t.IntersectionC<[t.TypeC<{ | ||
dtIniCondicao: t.StringC; | ||
infoAmb: t.TypeC<{ | ||
localAmb: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
dscSetor: t.StringC; | ||
tpInsc: t.UnionC<[t.LiteralC<1>, t.LiteralC<3>, t.LiteralC<4>]>; | ||
nrInsc: t.StringC; | ||
}>; | ||
infoAtiv: t.TypeC<{ | ||
dscAtivDes: t.StringC; | ||
}>; | ||
agNoc: t.IntersectionC<[t.TypeC<{ | ||
codAgNoc: t.StringC; | ||
tpAval: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>]>; | ||
epcEpi: t.IntersectionC<[t.TypeC<{ | ||
utilizEPC: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>; | ||
utilizEPI: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>, t.LiteralC<2>]>; | ||
}>, t.PartialC<{ | ||
eficEpc: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
epi: t.IntersectionC<[t.TypeC<{ | ||
eficEpi: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
}>, t.PartialC<{ | ||
docAval: t.StringC; | ||
dscEPI: t.StringC; | ||
}>]>; | ||
epiCompl: t.TypeC<{ | ||
medProtecao: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
condFuncto: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
usoInint: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
przValid: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
periodicTroca: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
higienizacao: t.UnionC<[t.LiteralC<"S">, t.LiteralC<"N">]>; | ||
}>; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
dscAgNoc: t.StringC; | ||
intConc: t.NumberC; | ||
limTol: t.NumberC; | ||
unMed: t.UnionC<[t.LiteralC<1>, t.LiteralC<2>, t.LiteralC<3>, t.LiteralC<4>, t.LiteralC<5>, t.LiteralC<6>, t.LiteralC<7>, t.LiteralC<8>, t.LiteralC<9>, t.LiteralC<10>, t.LiteralC<11>, t.LiteralC<12>, t.LiteralC<13>, t.LiteralC<14>, t.LiteralC<15>, t.LiteralC<16>, t.LiteralC<17>, t.LiteralC<18>, t.LiteralC<19>, t.LiteralC<20>, t.LiteralC<21>, t.LiteralC<22>, t.LiteralC<23>, t.LiteralC<24>, t.LiteralC<25>, t.LiteralC<26>, t.LiteralC<27>, t.LiteralC<28>, t.LiteralC<29>, t.LiteralC<30>]>; | ||
tecMedicao: t.StringC; | ||
}>]>; | ||
respReg: t.IntersectionC<[t.TypeC<{ | ||
cpfResp: t.StringC; | ||
ideOC: t.UnionC<[t.LiteralC<1>, t.LiteralC<4>, t.LiteralC<9>]>; | ||
nrOC: t.StringC; | ||
ufOC: t.UnionC<[t.LiteralC<"AC">, t.LiteralC<"AL">, t.LiteralC<"AP">, t.LiteralC<"AM">, t.LiteralC<"BA">, t.LiteralC<"CE">, t.LiteralC<"DF">, t.LiteralC<"ES">, t.LiteralC<"GO">, t.LiteralC<"MA">, t.LiteralC<"MT">, t.LiteralC<"MS">, t.LiteralC<"MG">, t.LiteralC<"PA">, t.LiteralC<"PB">, t.LiteralC<"PR">, t.LiteralC<"PE">, t.LiteralC<"PI">, t.LiteralC<"RJ">, t.LiteralC<"RN">, t.LiteralC<"RS">, t.LiteralC<"RO">, t.LiteralC<"RR">, t.LiteralC<"SC">, t.LiteralC<"SP">, t.LiteralC<"SE">, t.LiteralC<"TO">]>; | ||
}>, t.PartialC<{ | ||
dscOC: t.StringC; | ||
}>]>; | ||
}>, t.PartialC<{ | ||
obs: t.TypeC<{ | ||
obsCompl: t.StringC; | ||
}>; | ||
}>]>; | ||
}>; | ||
}>; | ||
}>]>; | ||
}>; | ||
}>]>, t.UnionC<[t.UnionC<[t.TypeC<{ | ||
kind: t.LiteralC<"organization">; | ||
@@ -486,0 +729,0 @@ content: t.PartialC<{ |
@@ -25,5 +25,8 @@ "use strict"; | ||
const messages_1 = require("./ttalk/messages"); | ||
const messages_2 = require("./esocial/messages"); | ||
const index_1 = require("./internal/index"); | ||
var messages_2 = require("./ttalk/messages"); | ||
Object.defineProperty(exports, "TtalkMessage", { enumerable: true, get: function () { return messages_2.Message; } }); | ||
var messages_3 = require("./ttalk/messages"); | ||
Object.defineProperty(exports, "TtalkMessage", { enumerable: true, get: function () { return messages_3.Message; } }); | ||
var messages_4 = require("./esocial/messages"); | ||
Object.defineProperty(exports, "ESocialMessage", { enumerable: true, get: function () { return messages_4.Message; } }); | ||
var index_2 = require("./internal/index"); | ||
@@ -33,3 +36,4 @@ Object.defineProperty(exports, "InternalMessage", { enumerable: true, get: function () { return index_2.Message; } }); | ||
messages_1.Message, | ||
messages_2.Message, | ||
index_1.Message | ||
]); |
{ | ||
"name": "quirons-broker", | ||
"version": "0.0.1-alpha.20", | ||
"version": "0.0.1-alpha.21", | ||
"description": "A small library to expose the broker ttalk types", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
401831
84
9198