types-nora-api 0.0.147 → 0.0.150

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 CHANGED
@@ -754,6 +754,73 @@ type TelemetrySnapshot = {
754
754
  lastEvents: TelemetryEventLog[];
755
755
  serverTime: number;
756
756
  };
757
+ type EventoTipo = 'recebe' | 'envia' | 'recebe-envia';
758
+ type EventoConfig<T extends EventoTipo, P, R = void> = {
759
+ tipo: T;
760
+ payload: P;
761
+ } & (T extends 'recebe-envia' ? {
762
+ response: R;
763
+ } : {});
764
+ type EventoDef = EventoConfig<'recebe', any> | EventoConfig<'envia', any> | EventoConfig<'recebe-envia', any, any>;
765
+ type GatewayDef = Record<string, EventoDef>;
766
+ type GatewaysCollection = Record<string, GatewayDef>;
767
+ declare function createGateway<T extends Record<string, EventoConfig<EventoTipo, any, any>>>(config: T): T;
768
+ declare namespace EventosWebSocket {
769
+ const gateways: {
770
+ readonly Chat: {
771
+ testeChat1: {
772
+ tipo: "recebe-envia";
773
+ payload: {
774
+ mensagem: string;
775
+ };
776
+ response: {
777
+ entregue: boolean;
778
+ };
779
+ };
780
+ testeDuplicado: {
781
+ tipo: "recebe-envia";
782
+ payload: {};
783
+ response: {
784
+ msg: string;
785
+ };
786
+ };
787
+ };
788
+ readonly GameEngine: {
789
+ testeGameEngine1: {
790
+ tipo: "recebe-envia";
791
+ payload: {
792
+ teste1: string;
793
+ };
794
+ response: {
795
+ ok: boolean;
796
+ msg: string;
797
+ };
798
+ };
799
+ testeGameEngine2: {
800
+ tipo: "recebe";
801
+ payload: {
802
+ teste2: number;
803
+ };
804
+ };
805
+ testeDuplicado: {
806
+ tipo: "recebe-envia";
807
+ payload: {};
808
+ response: {
809
+ msg: string;
810
+ };
811
+ };
812
+ };
813
+ readonly UsuariosConectados: {
814
+ obtemUsuariosConectados: {
815
+ tipo: "recebe";
816
+ payload: {};
817
+ response: {
818
+ msg: string;
819
+ };
820
+ };
821
+ };
822
+ };
823
+ }
757
824
  type SOCKET_AcessoUsuario = {
758
825
  usuario: UsuarioDto;
759
826
  paginaAtual?: PaginaObjeto | null;
@@ -905,4 +972,130 @@ declare enum EstiloSessao {
905
972
  SESSAO_UNICA_NAO_CANONICA = 2,
906
973
  ERRO = 3
907
974
  }
908
- export { IArcoAventura, ArcoAventuraDto, IAventura, AventuraDto, IConviteGrupoAventuraPersonagem, ConviteGrupoAventuraPersonagemDto, IGrupoAventura, GrupoAventuraDto, IGrupoAventuraPersonagem, GrupoAventuraPersonagemDto, IRespostaConvite, RespostaConviteDto, IVariavelAmbiente, VariavelAmbienteDto, IConquista, ConquistaDto, ITipoConquista, TipoConquistaDto, IDetalheSessaoAventura, DetalheSessaoAventuraDto, IDetalheSessaoCanonica, DetalheSessaoCanonicaDto, CapituloSessaoCanonica, IDetalheSessaoNaoCanonica, DetalheSessaoNaoCanonicaDto, 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, IDetalheRascunhoSessaoUnica, DetalheRascunhoSessaoUnicaDto, IDetalheRascunhoSessaoUnicaCanonica, DetalheRascunhoSessaoUnicaCanonicaDto, IRascunho, RascunhoDto, IEstudo, EstudoDto, IRegistroSessao, RegistroSessaoDto, ISessao, SessaoDto, AuthSession, ICustomizacaoUsuario, CustomizacaoUsuarioDto, IDisponibilidadeUsuario, DisponibilidadeUsuarioDto, ListaDisponibilidadesUsuario, DisponibilidadesDDS, JanelaDisponibilidade, IUsuario, UsuarioDto, PAGINAS, PaginaChave, PaginaObjeto, TelemetryConnectionInfo, TelemetryEventLog, TelemetrySnapshot, SOCKET_AcessoUsuario, 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 };
975
+ type Gateways = typeof EventosWebSocket.gateways;
976
+ type EventoTipoLiteral = EventoTipo;
977
+ type FiltraEventosPorTipo<G extends GatewayDef, Tipo extends EventoTipoLiteral> = {
978
+ [K in keyof G as G[K] extends {
979
+ tipo: Tipo;
980
+ } ? K : never]: G[K];
981
+ };
982
+ declare function criarEventosFiltrados<Tipo extends EventoTipoLiteral>(tipo: Tipo): { [G in keyof Gateways]: {
983
+ eventos: { [E in keyof FiltraEventosPorTipo<Gateways[G], Tipo>]: FiltraEventosPorTipo<Gateways[G], Tipo>[E] & {
984
+ readonly nome: E;
985
+ readonly gateway: G;
986
+ readonly fullName: `${Extract<G, string>}:${Extract<E, string>}`;
987
+ }; };
988
+ }; };
989
+ declare const Eventos_Recebe: {
990
+ readonly Chat: {
991
+ eventos: {};
992
+ };
993
+ readonly GameEngine: {
994
+ eventos: {
995
+ testeGameEngine2: {
996
+ tipo: "recebe";
997
+ payload: {
998
+ teste2: number;
999
+ };
1000
+ } & {
1001
+ readonly nome: "testeGameEngine2";
1002
+ readonly gateway: "GameEngine";
1003
+ readonly fullName: "GameEngine:testeGameEngine2";
1004
+ };
1005
+ };
1006
+ };
1007
+ readonly UsuariosConectados: {
1008
+ eventos: {
1009
+ obtemUsuariosConectados: {
1010
+ tipo: "recebe";
1011
+ payload: {};
1012
+ response: {
1013
+ msg: string;
1014
+ };
1015
+ } & {
1016
+ readonly nome: "obtemUsuariosConectados";
1017
+ readonly gateway: "UsuariosConectados";
1018
+ readonly fullName: "UsuariosConectados:obtemUsuariosConectados";
1019
+ };
1020
+ };
1021
+ };
1022
+ };
1023
+ declare const Eventos_Envia: {
1024
+ readonly Chat: {
1025
+ eventos: {};
1026
+ };
1027
+ readonly GameEngine: {
1028
+ eventos: {};
1029
+ };
1030
+ readonly UsuariosConectados: {
1031
+ eventos: {};
1032
+ };
1033
+ };
1034
+ declare const Eventos_RecebeEnvia: {
1035
+ readonly Chat: {
1036
+ eventos: {
1037
+ testeChat1: {
1038
+ tipo: "recebe-envia";
1039
+ payload: {
1040
+ mensagem: string;
1041
+ };
1042
+ response: {
1043
+ entregue: boolean;
1044
+ };
1045
+ } & {
1046
+ readonly nome: "testeChat1";
1047
+ readonly gateway: "Chat";
1048
+ readonly fullName: "Chat:testeChat1";
1049
+ };
1050
+ testeDuplicado: {
1051
+ tipo: "recebe-envia";
1052
+ payload: {};
1053
+ response: {
1054
+ msg: string;
1055
+ };
1056
+ } & {
1057
+ readonly nome: "testeDuplicado";
1058
+ readonly gateway: "Chat";
1059
+ readonly fullName: "Chat:testeDuplicado";
1060
+ };
1061
+ };
1062
+ };
1063
+ readonly GameEngine: {
1064
+ eventos: {
1065
+ testeGameEngine1: {
1066
+ tipo: "recebe-envia";
1067
+ payload: {
1068
+ teste1: string;
1069
+ };
1070
+ response: {
1071
+ ok: boolean;
1072
+ msg: string;
1073
+ };
1074
+ } & {
1075
+ readonly nome: "testeGameEngine1";
1076
+ readonly gateway: "GameEngine";
1077
+ readonly fullName: "GameEngine:testeGameEngine1";
1078
+ };
1079
+ testeDuplicado: {
1080
+ tipo: "recebe-envia";
1081
+ payload: {};
1082
+ response: {
1083
+ msg: string;
1084
+ };
1085
+ } & {
1086
+ readonly nome: "testeDuplicado";
1087
+ readonly gateway: "GameEngine";
1088
+ readonly fullName: "GameEngine:testeDuplicado";
1089
+ };
1090
+ };
1091
+ };
1092
+ readonly UsuariosConectados: {
1093
+ eventos: {};
1094
+ };
1095
+ };
1096
+ type SOCKET_UsuarioExistente = {
1097
+ id: number;
1098
+ username: string;
1099
+ avatar: string;
1100
+ };
1101
+ export { IArcoAventura, ArcoAventuraDto, IAventura, AventuraDto, IConviteGrupoAventuraPersonagem, ConviteGrupoAventuraPersonagemDto, IGrupoAventura, GrupoAventuraDto, IGrupoAventuraPersonagem, GrupoAventuraPersonagemDto, IRespostaConvite, RespostaConviteDto, IVariavelAmbiente, VariavelAmbienteDto, IConquista, ConquistaDto, ITipoConquista, TipoConquistaDto, IDetalheSessaoAventura, DetalheSessaoAventuraDto, IDetalheSessaoCanonica, DetalheSessaoCanonicaDto, CapituloSessaoCanonica, IDetalheSessaoNaoCanonica, DetalheSessaoNaoCanonicaDto, 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, IDetalheRascunhoSessaoUnica, DetalheRascunhoSessaoUnicaDto, IDetalheRascunhoSessaoUnicaCanonica, DetalheRascunhoSessaoUnicaCanonicaDto, IRascunho, RascunhoDto, IEstudo, EstudoDto, IRegistroSessao, RegistroSessaoDto, ISessao, SessaoDto, AuthSession, ICustomizacaoUsuario, CustomizacaoUsuarioDto, IDisponibilidadeUsuario, DisponibilidadeUsuarioDto, ListaDisponibilidadesUsuario, DisponibilidadesDDS, JanelaDisponibilidade, IUsuario, UsuarioDto, PAGINAS, PaginaChave, PaginaObjeto, TelemetryConnectionInfo, TelemetryEventLog, TelemetrySnapshot, EventoTipo, EventoConfig, EventoDef, GatewayDef, GatewaysCollection, createGateway, EventosWebSocket, SOCKET_AcessoUsuario, 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, Gateways, EventoTipoLiteral, FiltraEventosPorTipo, criarEventosFiltrados, Eventos_Recebe, Eventos_Envia, Eventos_RecebeEnvia, SOCKET_UsuarioExistente };
package/dist/classes.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // AUTO-GENERATED FILE - DO NOT EDIT
2
+ // Gerado automaticamente por extrairClasses.ts
2
3
  class AuthSession {
3
4
  expiredAt;
4
5
  id;
@@ -73,6 +74,47 @@ const PAGINAS = {
73
74
  nome: 'Página de Mestre',
74
75
  },
75
76
  };
77
+ function createGateway(config) { return config; }
78
+ //
79
+ var EventosWebSocket;
80
+ (function (EventosWebSocket) {
81
+ const Chat = createGateway({
82
+ testeChat1: {
83
+ tipo: 'recebe-envia',
84
+ payload: { mensagem: '' },
85
+ response: { entregue: true },
86
+ },
87
+ testeDuplicado: {
88
+ tipo: 'recebe-envia',
89
+ payload: {},
90
+ response: { msg: '' },
91
+ },
92
+ });
93
+ const GameEngine = createGateway({
94
+ testeGameEngine1: {
95
+ tipo: 'recebe-envia',
96
+ payload: { teste1: '' },
97
+ response: { ok: true, msg: '' },
98
+ },
99
+ testeGameEngine2: {
100
+ tipo: 'recebe',
101
+ payload: { teste2: 0 },
102
+ },
103
+ testeDuplicado: {
104
+ tipo: 'recebe-envia',
105
+ payload: {},
106
+ response: { msg: '' },
107
+ },
108
+ });
109
+ const UsuariosConectados = createGateway({
110
+ obtemUsuariosConectados: {
111
+ tipo: 'recebe',
112
+ payload: {},
113
+ response: { msg: '' },
114
+ },
115
+ });
116
+ EventosWebSocket.gateways = { Chat, GameEngine, UsuariosConectados };
117
+ })(EventosWebSocket || (EventosWebSocket = {}));
76
118
  // @tipoCompartilhadoFront
77
119
  var AventuraEstado;
78
120
  (function (AventuraEstado) {
@@ -164,4 +206,20 @@ var EstiloSessao;
164
206
  EstiloSessao[EstiloSessao["SESSAO_UNICA_NAO_CANONICA"] = 2] = "SESSAO_UNICA_NAO_CANONICA";
165
207
  EstiloSessao[EstiloSessao["ERRO"] = 3] = "ERRO";
166
208
  })(EstiloSessao || (EstiloSessao = {}));
167
- export { AuthSession, PAGINAS, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao };
209
+ function criarEventosFiltrados(tipo) {
210
+ const result = {};
211
+ for (const [gatewayName, gatewayDef] of Object.entries(EventosWebSocket.gateways)) {
212
+ const eventosFiltrados = Object.entries(gatewayDef).filter(([, evento]) => evento.tipo === tipo).map(([eventName, evento]) => [eventName, {
213
+ ...evento,
214
+ nome: eventName,
215
+ gateway: gatewayName,
216
+ fullName: `${gatewayName}:${eventName}`,
217
+ }]);
218
+ result[gatewayName] = { eventos: Object.fromEntries(eventosFiltrados) };
219
+ }
220
+ return result;
221
+ }
222
+ const Eventos_Recebe = criarEventosFiltrados('recebe');
223
+ const Eventos_Envia = criarEventosFiltrados('envia');
224
+ const Eventos_RecebeEnvia = criarEventosFiltrados('recebe-envia');
225
+ export { AuthSession, PAGINAS, createGateway, EventosWebSocket, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, criarEventosFiltrados, Eventos_Recebe, Eventos_Envia, Eventos_RecebeEnvia };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "types-nora-api",
3
- "version": "0.0.147",
3
+ "version": "0.0.150",
4
4
  "description": "Tipagem da Nora-Api compartilhada com o universodomedo.com",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "scripts": {
9
- "build:types": "tsx scripts/extrairClasses.ts",
10
- "build": "tsc",
9
+ "build:types": "tsx --tsconfig tsconfig.json scripts/extrairClasses.ts",
10
+ "build": "npm run build:types && tsc",
11
11
  "prepare": "npm run build"
12
12
  },
13
13
  "files": [