types-nora-api 0.0.147 → 0.0.148

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,64 @@ 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 GameEngine: {
771
+ testeGameEngine1: {
772
+ tipo: "recebe-envia";
773
+ payload: {
774
+ teste1: string;
775
+ };
776
+ response: {
777
+ ok: boolean;
778
+ msg: string;
779
+ };
780
+ };
781
+ testeGameEngine2: {
782
+ tipo: "recebe";
783
+ payload: {
784
+ teste2: number;
785
+ };
786
+ };
787
+ testeDuplicado: {
788
+ tipo: "recebe-envia";
789
+ payload: {};
790
+ response: {
791
+ msg: string;
792
+ };
793
+ };
794
+ };
795
+ readonly Chat: {
796
+ testeChat1: {
797
+ tipo: "recebe-envia";
798
+ payload: {
799
+ mensagem: string;
800
+ };
801
+ response: {
802
+ entregue: boolean;
803
+ };
804
+ };
805
+ testeDuplicado: {
806
+ tipo: "recebe-envia";
807
+ payload: {};
808
+ response: {
809
+ msg: string;
810
+ };
811
+ };
812
+ };
813
+ };
814
+ }
757
815
  type SOCKET_AcessoUsuario = {
758
816
  usuario: UsuarioDto;
759
817
  paginaAtual?: PaginaObjeto | null;
@@ -905,4 +963,104 @@ declare enum EstiloSessao {
905
963
  SESSAO_UNICA_NAO_CANONICA = 2,
906
964
  ERRO = 3
907
965
  }
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 };
966
+ type Gateways = typeof EventosWebSocket.gateways;
967
+ type EventoTipoLiteral = EventoTipo;
968
+ type FiltraEventosPorTipo<G extends GatewayDef, Tipo extends EventoTipoLiteral> = {
969
+ [K in keyof G as G[K] extends {
970
+ tipo: Tipo;
971
+ } ? K : never]: G[K];
972
+ };
973
+ declare function criarEventosFiltrados<Tipo extends EventoTipoLiteral>(tipo: Tipo): { [G in keyof Gateways]: {
974
+ eventos: { [E in keyof FiltraEventosPorTipo<Gateways[G], Tipo>]: FiltraEventosPorTipo<Gateways[G], Tipo>[E] & {
975
+ readonly nome: E;
976
+ readonly gateway: G;
977
+ readonly fullName: `${Extract<G, string>}:${Extract<E, string>}`;
978
+ }; };
979
+ }; };
980
+ declare const Eventos_Recebe: {
981
+ readonly GameEngine: {
982
+ eventos: {
983
+ testeGameEngine2: {
984
+ tipo: "recebe";
985
+ payload: {
986
+ teste2: number;
987
+ };
988
+ } & {
989
+ readonly nome: "testeGameEngine2";
990
+ readonly gateway: "GameEngine";
991
+ readonly fullName: "GameEngine:testeGameEngine2";
992
+ };
993
+ };
994
+ };
995
+ readonly Chat: {
996
+ eventos: {};
997
+ };
998
+ };
999
+ declare const Eventos_Envia: {
1000
+ readonly GameEngine: {
1001
+ eventos: {};
1002
+ };
1003
+ readonly Chat: {
1004
+ eventos: {};
1005
+ };
1006
+ };
1007
+ declare const Eventos_RecebeEnvia: {
1008
+ readonly GameEngine: {
1009
+ eventos: {
1010
+ testeGameEngine1: {
1011
+ tipo: "recebe-envia";
1012
+ payload: {
1013
+ teste1: string;
1014
+ };
1015
+ response: {
1016
+ ok: boolean;
1017
+ msg: string;
1018
+ };
1019
+ } & {
1020
+ readonly nome: "testeGameEngine1";
1021
+ readonly gateway: "GameEngine";
1022
+ readonly fullName: "GameEngine:testeGameEngine1";
1023
+ };
1024
+ testeDuplicado: {
1025
+ tipo: "recebe-envia";
1026
+ payload: {};
1027
+ response: {
1028
+ msg: string;
1029
+ };
1030
+ } & {
1031
+ readonly nome: "testeDuplicado";
1032
+ readonly gateway: "GameEngine";
1033
+ readonly fullName: "GameEngine:testeDuplicado";
1034
+ };
1035
+ };
1036
+ };
1037
+ readonly Chat: {
1038
+ eventos: {
1039
+ testeChat1: {
1040
+ tipo: "recebe-envia";
1041
+ payload: {
1042
+ mensagem: string;
1043
+ };
1044
+ response: {
1045
+ entregue: boolean;
1046
+ };
1047
+ } & {
1048
+ readonly nome: "testeChat1";
1049
+ readonly gateway: "Chat";
1050
+ readonly fullName: "Chat:testeChat1";
1051
+ };
1052
+ testeDuplicado: {
1053
+ tipo: "recebe-envia";
1054
+ payload: {};
1055
+ response: {
1056
+ msg: string;
1057
+ };
1058
+ } & {
1059
+ readonly nome: "testeDuplicado";
1060
+ readonly gateway: "Chat";
1061
+ readonly fullName: "Chat:testeDuplicado";
1062
+ };
1063
+ };
1064
+ };
1065
+ };
1066
+ 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 };
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,40 @@ 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 GameEngine = createGateway({
82
+ testeGameEngine1: {
83
+ tipo: 'recebe-envia',
84
+ payload: { teste1: '' },
85
+ response: { ok: true, msg: '' },
86
+ },
87
+ testeGameEngine2: {
88
+ tipo: 'recebe',
89
+ payload: { teste2: 0 },
90
+ },
91
+ testeDuplicado: {
92
+ tipo: 'recebe-envia',
93
+ payload: {},
94
+ response: { msg: '' },
95
+ }
96
+ });
97
+ const Chat = createGateway({
98
+ testeChat1: {
99
+ tipo: 'recebe-envia',
100
+ payload: { mensagem: '' },
101
+ response: { entregue: true },
102
+ },
103
+ testeDuplicado: {
104
+ tipo: 'recebe-envia',
105
+ payload: {},
106
+ response: { msg: '' },
107
+ }
108
+ });
109
+ EventosWebSocket.gateways = { GameEngine, Chat };
110
+ })(EventosWebSocket || (EventosWebSocket = {}));
76
111
  // @tipoCompartilhadoFront
77
112
  var AventuraEstado;
78
113
  (function (AventuraEstado) {
@@ -164,4 +199,20 @@ var EstiloSessao;
164
199
  EstiloSessao[EstiloSessao["SESSAO_UNICA_NAO_CANONICA"] = 2] = "SESSAO_UNICA_NAO_CANONICA";
165
200
  EstiloSessao[EstiloSessao["ERRO"] = 3] = "ERRO";
166
201
  })(EstiloSessao || (EstiloSessao = {}));
167
- export { AuthSession, PAGINAS, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao };
202
+ function criarEventosFiltrados(tipo) {
203
+ const result = {};
204
+ for (const [gatewayName, gatewayDef] of Object.entries(EventosWebSocket.gateways)) {
205
+ const eventosFiltrados = Object.entries(gatewayDef).filter(([, evento]) => evento.tipo === tipo).map(([eventName, evento]) => [eventName, {
206
+ ...evento,
207
+ nome: eventName,
208
+ gateway: gatewayName,
209
+ fullName: `${gatewayName}:${eventName}`,
210
+ }]);
211
+ result[gatewayName] = { eventos: Object.fromEntries(eventosFiltrados) };
212
+ }
213
+ return result;
214
+ }
215
+ const Eventos_Recebe = criarEventosFiltrados('recebe');
216
+ const Eventos_Envia = criarEventosFiltrados('envia');
217
+ const Eventos_RecebeEnvia = criarEventosFiltrados('recebe-envia');
218
+ 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,12 +1,12 @@
1
1
  {
2
2
  "name": "types-nora-api",
3
- "version": "0.0.147",
3
+ "version": "0.0.148",
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",
9
+ "build:types": "tsx --tsconfig tsconfig.scripts.json scripts/extrairClasses.ts",
10
10
  "build": "tsc",
11
11
  "prepare": "npm run build"
12
12
  },