types-nora-api 0.0.180 → 0.0.182
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/classes.d.ts +51 -26
- package/dist/classes.js +33 -6
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -764,16 +764,20 @@ interface MensagemChatPayload {
|
|
|
764
764
|
salaId: string;
|
|
765
765
|
conteudo: string;
|
|
766
766
|
}
|
|
767
|
-
type
|
|
767
|
+
type SOCKET_CodigoSalaDeJogo = `${number}_${string}`;
|
|
768
|
+
type SalaDeJogo = {
|
|
768
769
|
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
769
770
|
idSessao: number | null;
|
|
770
|
-
|
|
771
|
+
tipo: SalaDeJogo_Tipo;
|
|
772
|
+
estado: SalaDeJogo_Estado;
|
|
773
|
+
mestreSala: SalaDeJogo_Mestre;
|
|
774
|
+
participantesSala: SalaDeJogo_Participante[];
|
|
771
775
|
};
|
|
772
|
-
type
|
|
776
|
+
type SalaDeJogo_Mestre = SalaDeJogo_Mestre_Mestrada | SalaDeJogo_Mestre_Inteligente;
|
|
777
|
+
type SalaDeJogo_Participante = {
|
|
778
|
+
tipo: SalaDeJogo_TipoParticipante;
|
|
773
779
|
idUsuario: number;
|
|
774
|
-
personagens: PersonagemDto[];
|
|
775
780
|
};
|
|
776
|
-
type SOCKET_CodigoSalaDeJogo = `${number}_${string}`;
|
|
777
781
|
type PARAM_BuscaSala = {
|
|
778
782
|
tipo: 'codigoSala';
|
|
779
783
|
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
@@ -787,6 +791,31 @@ type PARAM_BuscaSala = {
|
|
|
787
791
|
type SOCKET_DadosParaParticipanteDeSala = {
|
|
788
792
|
fichaDeJogo: FichaDeJogo;
|
|
789
793
|
};
|
|
794
|
+
declare enum SalaDeJogo_Tipo {
|
|
795
|
+
SALA__SOLO = "Sess\u00E3o Solo",
|
|
796
|
+
SALA__SESSAO_UNICA = "Sess\u00E3o \u00DAnica",
|
|
797
|
+
SALA__SESSAO_AVENTURA = "Sess\u00E3o Aventura"
|
|
798
|
+
}
|
|
799
|
+
declare enum SalaDeJogo_Estado {
|
|
800
|
+
SALA__EM_ESPERA = "Em Espera",
|
|
801
|
+
SALA__EM_ANDAMENTO = "Em Andamento"
|
|
802
|
+
}
|
|
803
|
+
declare enum SalaDeJogo_TipoMestre {
|
|
804
|
+
SALA__MESTRADA = "SALA__MESTRADA",
|
|
805
|
+
SALA__INTELIGENTE = "SALA__INTELIGENTE"
|
|
806
|
+
}
|
|
807
|
+
type SalaDeJogo_Mestre_Mestrada = {
|
|
808
|
+
tipoMestre: SalaDeJogo_TipoMestre.SALA__MESTRADA;
|
|
809
|
+
idUsuario: number;
|
|
810
|
+
};
|
|
811
|
+
type SalaDeJogo_Mestre_Inteligente = {
|
|
812
|
+
tipoMestre: SalaDeJogo_TipoMestre.SALA__INTELIGENTE;
|
|
813
|
+
};
|
|
814
|
+
declare enum SalaDeJogo_TipoParticipante {
|
|
815
|
+
SALA__NARRADOR = "Narrador",
|
|
816
|
+
SALA__JOGADOR = "Jogador"
|
|
817
|
+
}
|
|
818
|
+
type SOCKET_SalaDeJogoDto = Omit<SalaDeJogo, 'fichasSala'>;
|
|
790
819
|
type SOCKET_AcessoUsuario = {
|
|
791
820
|
usuario: UsuarioDto;
|
|
792
821
|
paginaAtual?: PaginaObjeto | null;
|
|
@@ -828,6 +857,20 @@ type TelemetrySnapshot = {
|
|
|
828
857
|
lastEvents: TelemetryEventLog[];
|
|
829
858
|
serverTime: number;
|
|
830
859
|
};
|
|
860
|
+
type WsErrorResponse = {
|
|
861
|
+
_wsErro: true;
|
|
862
|
+
mensagem: string;
|
|
863
|
+
code?: string;
|
|
864
|
+
detalhes?: any;
|
|
865
|
+
};
|
|
866
|
+
type WsResult<T> = T | WsErrorResponse;
|
|
867
|
+
declare function isWsErrorResponse(payload: unknown): payload is WsErrorResponse;
|
|
868
|
+
declare function wsErro(mensagem: string, extra?: {
|
|
869
|
+
code?: string;
|
|
870
|
+
detalhes?: any;
|
|
871
|
+
}): WsErrorResponse;
|
|
872
|
+
declare function wsMap<T, R>(value: WsResult<T>, mapper: (value: T) => R): WsResult<R>;
|
|
873
|
+
declare function wsChain<T, R>(value: WsResult<T>, next: (value: T) => WsResult<R>): WsResult<R>;
|
|
831
874
|
type EventoTipo = 'envia' | 'emite' | 'envia-e-recebe';
|
|
832
875
|
type EventoEnvia<P = any> = {
|
|
833
876
|
tipo: 'envia';
|
|
@@ -886,18 +929,11 @@ declare namespace EventosWebSocket {
|
|
|
886
929
|
sessaoEmAndamento: SessaoDto | null;
|
|
887
930
|
};
|
|
888
931
|
};
|
|
889
|
-
emitirDadosSessao: {
|
|
890
|
-
tipo: "emite";
|
|
891
|
-
payload: {};
|
|
892
|
-
response: {
|
|
893
|
-
dadosSessao: SOCKET_JogadorSalaDeJogo[];
|
|
894
|
-
};
|
|
895
|
-
};
|
|
896
932
|
emitirTodasSalas: {
|
|
897
933
|
tipo: "emite";
|
|
898
934
|
payload: {};
|
|
899
935
|
response: {
|
|
900
|
-
salas:
|
|
936
|
+
salas: SOCKET_SalaDeJogoDto[];
|
|
901
937
|
};
|
|
902
938
|
};
|
|
903
939
|
emitirDadosParaParticipanteDeSala: {
|
|
@@ -1159,22 +1195,11 @@ declare const Eventos_Emite: {
|
|
|
1159
1195
|
readonly gateway: "Jogo";
|
|
1160
1196
|
readonly fullName: "Jogo:emitirSessaoEmAndamento";
|
|
1161
1197
|
};
|
|
1162
|
-
emitirDadosSessao: {
|
|
1163
|
-
tipo: "emite";
|
|
1164
|
-
payload: {};
|
|
1165
|
-
response: {
|
|
1166
|
-
dadosSessao: SOCKET_JogadorSalaDeJogo[];
|
|
1167
|
-
};
|
|
1168
|
-
} & {
|
|
1169
|
-
readonly nome: "emitirDadosSessao";
|
|
1170
|
-
readonly gateway: "Jogo";
|
|
1171
|
-
readonly fullName: "Jogo:emitirDadosSessao";
|
|
1172
|
-
};
|
|
1173
1198
|
emitirTodasSalas: {
|
|
1174
1199
|
tipo: "emite";
|
|
1175
1200
|
payload: {};
|
|
1176
1201
|
response: {
|
|
1177
|
-
salas:
|
|
1202
|
+
salas: SOCKET_SalaDeJogoDto[];
|
|
1178
1203
|
};
|
|
1179
1204
|
} & {
|
|
1180
1205
|
readonly nome: "emitirTodasSalas";
|
|
@@ -1254,4 +1279,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1254
1279
|
};
|
|
1255
1280
|
};
|
|
1256
1281
|
};
|
|
1257
|
-
export { IArcoAventura, ArcoAventuraDto, IAventura, AventuraDto, IConviteGrupoAventuraPersonagem, ConviteGrupoAventuraPersonagemDto, IGrupoAventura, GrupoAventuraDto, IGrupoAventuraPersonagem, GrupoAventuraPersonagemDto, IRespostaConvite, RespostaConviteDto, IVariavelAmbiente, VariavelAmbienteDto, IConquista, ConquistaDto, ITipoConquista, TipoConquistaDto, IDetalheSessaoAventura, DetalheSessaoAventuraDto, IDetalheSessaoCanonica, DetalheSessaoCanonicaDto, CapituloSessaoCanonica, IDetalheSessaoUnica, DetalheSessaoUnicaDto, IParticipanteSessaoUnica, ParticipanteSessaoUnicaDto, ICoeficienteGanhoEstatisticaClasse, CoeficienteGanhoEstatisticaClasseDto, IGanhoNivelClasse, GanhoNivelClasseDto, DadosDoTipoGanho, DadosGanho_Atributos, DadosGanho_Pericias, DadosGanho_Estatisticas, DadosGanho_Classes, DadosGanho_ValorMaximoAtributo, DadosGanho_PontosHabilidadesEspeciais, DadosGanho_PontosHabilidadesParanormais, DadosGanho_PontosHabilidadeElemental, IGanhoRelativoCoeficienteAtributo, GanhoRelativoCoeficienteAtributoDto, ITipoGanhoNivel, TipoGanhoNivelDto, IGeracao, GeracaoDto, IImagem, ImagemDto, ITipoImagem, TipoImagemDto, IAlcance, AlcanceDto, IAtributo, AtributoDto, ICategoriaRitual, CategoriaRitualDto, ICirculoRitual, CirculoRitualDto, IClasse, ClasseDto, IDuracao, DuracaoDto, IElemento, ElementoDto, IEstatisticaDanificavel, EstatisticaDanificavelDto, IExecucao, ExecucaoDto, IFormatoAlcance, FormatoAlcanceDto, ILinhaEfeito, LinhaEfeitoDto, INivel, NivelDto, INivelComponente, NivelComponenteDto, INivelProficiencia, NivelProficienciaDto, INivelRitual, NivelRitualDto, IPatentePericia, PatentePericiaDto, IPericia, PericiaDto, IProficiencia, ProficienciaDto, ITipoAlvo, TipoAlvoDto, ITipoCategoria, TipoCategoriaDto, ITipoDano, TipoDanoDto, ITipoEfeito, TipoEfeitoDto, ITipoItem, TipoItemDto, ITipoProficiencia, TipoProficienciaDto, ILink, LinkDto, ITipoLink, TipoLinkDto, IDificuldadeSessao, DificuldadeSessaoDto, IEstiloSessaoMestrada, EstiloSessaoMestradaDto, ITipoSessao, TipoSessaoDto, IPerfilAdmin, PerfilAdminDto, IPerfilJogador, PerfilJogadorDto, IPerfilMestre, PerfilMestreDto, IFichaPersonagem, FichaPersonagemDto, ObjetoFicha, DetalheEvolucao, DetalhesExtras, FichaDeJogo, AtributoFicha, PericiaFicha, EstatisticaDanificavelFicha, DetalheFicha, RegistroPericiaLivre, IInformacaoPersonagem, InformacaoPersonagemDto, IPersonagem, PersonagemDto, IResumoPersonagemAventura, ResumoPersonagemAventuraDto, ITipoPersonagem, TipoPersonagemDto, IDetalheRascunhoAventura, DetalheRascunhoAventuraDto, IDetalheRascunhoSessaoUnicaCanonica, DetalheRascunhoSessaoUnicaCanonicaDto, IDetalheRascunhoSessaoUnicaNaoCanonica, DetalheRascunhoSessaoUnicaNaoCanonicaDto, IRascunho, RascunhoDto, IEstudo, EstudoDto, IRegistroSessao, RegistroSessaoDto, ISessao, SessaoDto, SessaoDadosGerais, ParticipanteSessao, AuthSession, ICustomizacaoUsuario, CustomizacaoUsuarioDto, IDisponibilidadeUsuario, DisponibilidadeUsuarioDto, ListaDisponibilidadesUsuario, DisponibilidadesDDS, JanelaDisponibilidade, IUsuario, UsuarioDto, PAGINAS, PaginaChave, PaginaObjeto, MensagemChatRecebida, SalaChat, SalaChatFront, MensagemChatPayload,
|
|
1282
|
+
export { IArcoAventura, ArcoAventuraDto, IAventura, AventuraDto, IConviteGrupoAventuraPersonagem, ConviteGrupoAventuraPersonagemDto, IGrupoAventura, GrupoAventuraDto, IGrupoAventuraPersonagem, GrupoAventuraPersonagemDto, IRespostaConvite, RespostaConviteDto, IVariavelAmbiente, VariavelAmbienteDto, IConquista, ConquistaDto, ITipoConquista, TipoConquistaDto, IDetalheSessaoAventura, DetalheSessaoAventuraDto, IDetalheSessaoCanonica, DetalheSessaoCanonicaDto, CapituloSessaoCanonica, IDetalheSessaoUnica, DetalheSessaoUnicaDto, IParticipanteSessaoUnica, ParticipanteSessaoUnicaDto, ICoeficienteGanhoEstatisticaClasse, CoeficienteGanhoEstatisticaClasseDto, IGanhoNivelClasse, GanhoNivelClasseDto, DadosDoTipoGanho, DadosGanho_Atributos, DadosGanho_Pericias, DadosGanho_Estatisticas, DadosGanho_Classes, DadosGanho_ValorMaximoAtributo, DadosGanho_PontosHabilidadesEspeciais, DadosGanho_PontosHabilidadesParanormais, DadosGanho_PontosHabilidadeElemental, IGanhoRelativoCoeficienteAtributo, GanhoRelativoCoeficienteAtributoDto, ITipoGanhoNivel, TipoGanhoNivelDto, IGeracao, GeracaoDto, IImagem, ImagemDto, ITipoImagem, TipoImagemDto, IAlcance, AlcanceDto, IAtributo, AtributoDto, ICategoriaRitual, CategoriaRitualDto, ICirculoRitual, CirculoRitualDto, IClasse, ClasseDto, IDuracao, DuracaoDto, IElemento, ElementoDto, IEstatisticaDanificavel, EstatisticaDanificavelDto, IExecucao, ExecucaoDto, IFormatoAlcance, FormatoAlcanceDto, ILinhaEfeito, LinhaEfeitoDto, INivel, NivelDto, INivelComponente, NivelComponenteDto, INivelProficiencia, NivelProficienciaDto, INivelRitual, NivelRitualDto, IPatentePericia, PatentePericiaDto, IPericia, PericiaDto, IProficiencia, ProficienciaDto, ITipoAlvo, TipoAlvoDto, ITipoCategoria, TipoCategoriaDto, ITipoDano, TipoDanoDto, ITipoEfeito, TipoEfeitoDto, ITipoItem, TipoItemDto, ITipoProficiencia, TipoProficienciaDto, ILink, LinkDto, ITipoLink, TipoLinkDto, IDificuldadeSessao, DificuldadeSessaoDto, IEstiloSessaoMestrada, EstiloSessaoMestradaDto, ITipoSessao, TipoSessaoDto, IPerfilAdmin, PerfilAdminDto, IPerfilJogador, PerfilJogadorDto, IPerfilMestre, PerfilMestreDto, IFichaPersonagem, FichaPersonagemDto, ObjetoFicha, DetalheEvolucao, DetalhesExtras, FichaDeJogo, AtributoFicha, PericiaFicha, EstatisticaDanificavelFicha, DetalheFicha, RegistroPericiaLivre, IInformacaoPersonagem, InformacaoPersonagemDto, IPersonagem, PersonagemDto, IResumoPersonagemAventura, ResumoPersonagemAventuraDto, ITipoPersonagem, TipoPersonagemDto, IDetalheRascunhoAventura, DetalheRascunhoAventuraDto, IDetalheRascunhoSessaoUnicaCanonica, DetalheRascunhoSessaoUnicaCanonicaDto, IDetalheRascunhoSessaoUnicaNaoCanonica, DetalheRascunhoSessaoUnicaNaoCanonicaDto, IRascunho, RascunhoDto, IEstudo, EstudoDto, IRegistroSessao, RegistroSessaoDto, ISessao, SessaoDto, SessaoDadosGerais, ParticipanteSessao, AuthSession, ICustomizacaoUsuario, CustomizacaoUsuarioDto, IDisponibilidadeUsuario, DisponibilidadeUsuarioDto, ListaDisponibilidadesUsuario, DisponibilidadesDDS, JanelaDisponibilidade, IUsuario, UsuarioDto, PAGINAS, PaginaChave, PaginaObjeto, MensagemChatRecebida, SalaChat, SalaChatFront, MensagemChatPayload, SOCKET_CodigoSalaDeJogo, SalaDeJogo, SalaDeJogo_Mestre, SalaDeJogo_Participante, PARAM_BuscaSala, SOCKET_DadosParaParticipanteDeSala, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_Mestre_Mestrada, SalaDeJogo_Mestre_Inteligente, SalaDeJogo_TipoParticipante, SOCKET_SalaDeJogoDto, SOCKET_AcessoUsuario, SOCKET_UsuarioExistente, TelemetryConnectionInfo, WsEventAudienceUnico, WsEventAudienceMultiplo, WsEventAudience, TelemetryEventLog, TelemetrySnapshot, WsErrorResponse, WsResult, isWsErrorResponse, wsErro, wsMap, wsChain, EventoTipo, EventoEnvia, EventoEmite, EventoEnviaERecebe, EventoSchema, GatewayDef, createGateway, EventosWebSocket, EventosEmiteMap, EventoEmiteAny, PaletaCores, EstruturaPaginaDefinicao, ConteudoItem, DefinicaoElemento, ListaItem, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, NumeroHora24, NumeroMomento, MomentoFormatado24, MomentoFormatado, CargoExibicaoUsuario, CargosUsuario, ObjetoAutenticacao, ObjetoCache, ObjetoPendeciaPersonagem, TipoVariavelAmbiente, ObjetoEvolucaoCompleto, ObjetoEvolucao, ObjetoGanhosEvolucao, GanhoEstatistica, FormatoMomento, DetalheUtilizacaoRascunho, EstiloSessao, PathTokenPadrao, TituloSessaoInteligente, Gateways, EventoTipoLiteral, FiltraEventosPorTipo, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|
package/dist/classes.js
CHANGED
|
@@ -78,6 +78,33 @@ const PAGINAS = {
|
|
|
78
78
|
nome: 'Página de Jogo',
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
|
+
var SalaDeJogo_Tipo;
|
|
82
|
+
(function (SalaDeJogo_Tipo) {
|
|
83
|
+
SalaDeJogo_Tipo["SALA__SOLO"] = "Sess\u00E3o Solo";
|
|
84
|
+
SalaDeJogo_Tipo["SALA__SESSAO_UNICA"] = "Sess\u00E3o \u00DAnica";
|
|
85
|
+
SalaDeJogo_Tipo["SALA__SESSAO_AVENTURA"] = "Sess\u00E3o Aventura";
|
|
86
|
+
})(SalaDeJogo_Tipo || (SalaDeJogo_Tipo = {}));
|
|
87
|
+
var SalaDeJogo_Estado;
|
|
88
|
+
(function (SalaDeJogo_Estado) {
|
|
89
|
+
SalaDeJogo_Estado["SALA__EM_ESPERA"] = "Em Espera";
|
|
90
|
+
SalaDeJogo_Estado["SALA__EM_ANDAMENTO"] = "Em Andamento";
|
|
91
|
+
})(SalaDeJogo_Estado || (SalaDeJogo_Estado = {}));
|
|
92
|
+
var SalaDeJogo_TipoMestre;
|
|
93
|
+
(function (SalaDeJogo_TipoMestre) {
|
|
94
|
+
SalaDeJogo_TipoMestre["SALA__MESTRADA"] = "SALA__MESTRADA";
|
|
95
|
+
SalaDeJogo_TipoMestre["SALA__INTELIGENTE"] = "SALA__INTELIGENTE";
|
|
96
|
+
})(SalaDeJogo_TipoMestre || (SalaDeJogo_TipoMestre = {}));
|
|
97
|
+
var SalaDeJogo_TipoParticipante;
|
|
98
|
+
(function (SalaDeJogo_TipoParticipante) {
|
|
99
|
+
SalaDeJogo_TipoParticipante["SALA__NARRADOR"] = "Narrador";
|
|
100
|
+
SalaDeJogo_TipoParticipante["SALA__JOGADOR"] = "Jogador";
|
|
101
|
+
})(SalaDeJogo_TipoParticipante || (SalaDeJogo_TipoParticipante = {}));
|
|
102
|
+
function isWsErrorResponse(payload) { return !!payload && typeof payload === "object" && payload._wsErro === true; }
|
|
103
|
+
function wsErro(mensagem, extra) { return { _wsErro: true, mensagem, ...(extra ?? {}) }; }
|
|
104
|
+
// helper que elimina o if manual no gateway
|
|
105
|
+
function wsMap(value, mapper) { return isWsErrorResponse(value) ? value : mapper(value); }
|
|
106
|
+
// opcional para encadear fluxos no service/repository se quiser evoluir
|
|
107
|
+
function wsChain(value, next) { return isWsErrorResponse(value) ? value : next(value); }
|
|
81
108
|
function createGateway(def) { return def; }
|
|
82
109
|
//
|
|
83
110
|
var EventosWebSocket;
|
|
@@ -104,11 +131,11 @@ var EventosWebSocket;
|
|
|
104
131
|
payload: {},
|
|
105
132
|
response: { sessaoEmAndamento: {} }
|
|
106
133
|
},
|
|
107
|
-
emitirDadosSessao: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
134
|
+
// emitirDadosSessao: {
|
|
135
|
+
// tipo: 'emite',
|
|
136
|
+
// payload: {},
|
|
137
|
+
// response: { dadosSessao: [] as SOCKET_JogadorSalaDeJogo[] }
|
|
138
|
+
// },
|
|
112
139
|
emitirTodasSalas: {
|
|
113
140
|
tipo: 'emite',
|
|
114
141
|
payload: {},
|
|
@@ -245,4 +272,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
245
272
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
246
273
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
247
274
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
248
|
-
export { AuthSession, PAGINAS, createGateway, EventosWebSocket, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, PathTokenPadrao, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|
|
275
|
+
export { AuthSession, PAGINAS, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante, isWsErrorResponse, wsErro, wsMap, wsChain, createGateway, EventosWebSocket, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, PathTokenPadrao, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|