types-nora-api 0.0.192 → 0.0.198
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 +76 -90
- package/dist/classes.js +41 -29
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -530,7 +530,7 @@ interface IPersonagem {
|
|
|
530
530
|
tempoProximaSessaoPersonagem: string;
|
|
531
531
|
}
|
|
532
532
|
type PersonagemDto = IPersonagem;
|
|
533
|
-
type PersonagemSalaJogoDto = Pick<PersonagemDto, 'usuario' | 'imagemAvatar' | 'informacao' | 'caminhoAvatar'>;
|
|
533
|
+
type PersonagemSalaJogoDto = Pick<PersonagemDto, 'id' | 'usuario' | 'imagemAvatar' | 'informacao' | 'caminhoAvatar'>;
|
|
534
534
|
interface IResumoPersonagemAventura {
|
|
535
535
|
fkPersonagensId: number;
|
|
536
536
|
fkAventurasId: number;
|
|
@@ -676,6 +676,65 @@ interface IUsuario {
|
|
|
676
676
|
listaCargos: CargosUsuario;
|
|
677
677
|
}
|
|
678
678
|
type UsuarioDto = IUsuario;
|
|
679
|
+
type SalaDeJogo_Codigo = `${number}_${string}`;
|
|
680
|
+
type SalaDeJogoParams = {
|
|
681
|
+
tipo: "sessao";
|
|
682
|
+
sessao: SessaoDto;
|
|
683
|
+
} | {
|
|
684
|
+
tipo: "solo";
|
|
685
|
+
jogadorSolo: UsuarioDto;
|
|
686
|
+
};
|
|
687
|
+
declare enum SalaDeJogo_Tipo {
|
|
688
|
+
SALA__SOLO = "Sess\u00E3o Solo",
|
|
689
|
+
SALA__SESSAO_UNICA = "Sess\u00E3o \u00DAnica",
|
|
690
|
+
SALA__SESSAO_AVENTURA = "Sess\u00E3o Aventura"
|
|
691
|
+
}
|
|
692
|
+
declare enum SalaDeJogo_Estado {
|
|
693
|
+
SALA__EM_ESPERA = "Em Espera",
|
|
694
|
+
SALA__EM_ANDAMENTO = "Em Andamento"
|
|
695
|
+
}
|
|
696
|
+
declare enum SalaDeJogo_TipoMestre {
|
|
697
|
+
SALA__MESTRADA = "SALA__MESTRADA",
|
|
698
|
+
SALA__INTELIGENTE = "SALA__INTELIGENTE"
|
|
699
|
+
}
|
|
700
|
+
type SalaDeJogo_Mestre = SalaDeJogo_Mestre_Mestrada | SalaDeJogo_Mestre_Inteligente;
|
|
701
|
+
type SalaDeJogo_Mestre_Mestrada = {
|
|
702
|
+
tipoMestre: SalaDeJogo_TipoMestre.SALA__MESTRADA;
|
|
703
|
+
idUsuario: number;
|
|
704
|
+
};
|
|
705
|
+
type SalaDeJogo_Mestre_Inteligente = {
|
|
706
|
+
tipoMestre: SalaDeJogo_TipoMestre.SALA__INTELIGENTE;
|
|
707
|
+
};
|
|
708
|
+
declare enum SalaDeJogo_TipoParticipante {
|
|
709
|
+
SALA__NARRADOR = "Narrador",
|
|
710
|
+
SALA__JOGADOR = "Jogador"
|
|
711
|
+
}
|
|
712
|
+
type SalaDeJogo_Participante = SalaDeJogo_Participante_Narrador | SalaDeJogo_Participante_Jogador;
|
|
713
|
+
type SalaDeJogo_Participante_Narrador = {
|
|
714
|
+
tipo: SalaDeJogo_TipoParticipante.SALA__NARRADOR;
|
|
715
|
+
idUsuario: number;
|
|
716
|
+
};
|
|
717
|
+
type SalaDeJogo_Participante_Jogador = {
|
|
718
|
+
tipo: SalaDeJogo_TipoParticipante.SALA__JOGADOR;
|
|
719
|
+
idUsuario: number;
|
|
720
|
+
personagem: PersonagemSalaJogoDto;
|
|
721
|
+
};
|
|
722
|
+
type SalaDeJogo_FUNC_AtualizaParticipanteParams = {
|
|
723
|
+
acao: "adicionar";
|
|
724
|
+
tipo: SalaDeJogo_TipoParticipante;
|
|
725
|
+
idUsuario: number;
|
|
726
|
+
} | {
|
|
727
|
+
acao: "remover";
|
|
728
|
+
tipo: SalaDeJogo_TipoParticipante;
|
|
729
|
+
idUsuario: number;
|
|
730
|
+
};
|
|
731
|
+
type SalaDeJogoDto = {
|
|
732
|
+
codigo: SalaDeJogo_Codigo;
|
|
733
|
+
idSessao: number | null;
|
|
734
|
+
tipo: SalaDeJogo_Tipo;
|
|
735
|
+
mestre: SalaDeJogo_Mestre;
|
|
736
|
+
participantes: readonly SalaDeJogo_Participante[];
|
|
737
|
+
};
|
|
679
738
|
declare const PAGINAS: {
|
|
680
739
|
readonly VAZIA: {
|
|
681
740
|
readonly id: "";
|
|
@@ -766,61 +825,6 @@ interface MensagemChatPayload {
|
|
|
766
825
|
salaId: string;
|
|
767
826
|
conteudo: string;
|
|
768
827
|
}
|
|
769
|
-
type SOCKET_CodigoSalaDeJogo = `${number}_${string}`;
|
|
770
|
-
type PARAM_BuscaSala = {
|
|
771
|
-
tipo: 'codigoSala';
|
|
772
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
773
|
-
} | {
|
|
774
|
-
tipo: 'idSessao';
|
|
775
|
-
idSessao: number;
|
|
776
|
-
} | {
|
|
777
|
-
tipo: 'criadaPorUsuario';
|
|
778
|
-
usuario: UsuarioDto;
|
|
779
|
-
};
|
|
780
|
-
type SalaDeJogo = {
|
|
781
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
782
|
-
idSessao: number | null;
|
|
783
|
-
tipo: SalaDeJogo_Tipo;
|
|
784
|
-
estado: SalaDeJogo_Estado;
|
|
785
|
-
mestreSala: SalaDeJogo_Mestre;
|
|
786
|
-
participantesSala: SalaDeJogo_Participante[];
|
|
787
|
-
};
|
|
788
|
-
type FichasPorUsuarioIndex = Map<number, Map<number, FichaDeJogo>>;
|
|
789
|
-
type FichasPorSalaIndex = Map<SOCKET_CodigoSalaDeJogo, FichasPorUsuarioIndex>;
|
|
790
|
-
type SOCKET_DadosParaParticipanteDeSala = {
|
|
791
|
-
fichaDeJogo: FichaDeJogo;
|
|
792
|
-
};
|
|
793
|
-
declare enum SalaDeJogo_Tipo {
|
|
794
|
-
SALA__SOLO = "Sess\u00E3o Solo",
|
|
795
|
-
SALA__SESSAO_UNICA = "Sess\u00E3o \u00DAnica",
|
|
796
|
-
SALA__SESSAO_AVENTURA = "Sess\u00E3o Aventura"
|
|
797
|
-
}
|
|
798
|
-
declare enum SalaDeJogo_Estado {
|
|
799
|
-
SALA__EM_ESPERA = "Em Espera",
|
|
800
|
-
SALA__EM_ANDAMENTO = "Em Andamento"
|
|
801
|
-
}
|
|
802
|
-
type SalaDeJogo_Mestre = SalaDeJogo_Mestre_Mestrada | SalaDeJogo_Mestre_Inteligente;
|
|
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
|
-
type SalaDeJogo_Participante = {
|
|
815
|
-
tipo: SalaDeJogo_TipoParticipante;
|
|
816
|
-
idUsuario: number;
|
|
817
|
-
personagens: PersonagemSalaJogoDto[];
|
|
818
|
-
};
|
|
819
|
-
declare enum SalaDeJogo_TipoParticipante {
|
|
820
|
-
SALA__NARRADOR = "Narrador",
|
|
821
|
-
SALA__JOGADOR = "Jogador"
|
|
822
|
-
}
|
|
823
|
-
type SOCKET_SalaDeJogoDto = Omit<SalaDeJogo, 'fichasSala'>;
|
|
824
828
|
type SOCKET_AcessoUsuario = {
|
|
825
829
|
usuario: UsuarioDto;
|
|
826
830
|
paginaAtual?: PaginaObjeto | null;
|
|
@@ -868,28 +872,36 @@ type WsErrorResponse = {
|
|
|
868
872
|
code?: string;
|
|
869
873
|
detalhes?: unknown;
|
|
870
874
|
};
|
|
875
|
+
type WsUnauthorizedErrorResponse = WsErrorResponse & {
|
|
876
|
+
code: 'UNAUTHORIZED';
|
|
877
|
+
};
|
|
871
878
|
type WsResult<T> = T | WsErrorResponse;
|
|
872
879
|
declare function isWsErrorResponse(payload: unknown): payload is WsErrorResponse;
|
|
880
|
+
declare function isWsUnauthorizedErrorResponse(payload: unknown): payload is WsUnauthorizedErrorResponse;
|
|
873
881
|
declare function wsErro(mensagem: string, extra?: {
|
|
874
882
|
code?: string;
|
|
875
883
|
detalhes?: unknown;
|
|
876
884
|
}): WsErrorResponse;
|
|
885
|
+
declare function wsUnauthorized(mensagem?: string, detalhes?: unknown): WsUnauthorizedErrorResponse;
|
|
877
886
|
declare function wsMap<T, R>(value: WsResult<T>, mapper: (value: T) => R): WsResult<R>;
|
|
878
887
|
declare function wsChain<T, R>(value: WsResult<T>, next: (value: T) => WsResult<R>): WsResult<R>;
|
|
879
888
|
type EventoTipo = 'envia' | 'emite' | 'envia-e-recebe';
|
|
880
889
|
type EmitDelivery = 'broadcast' | 'perRecipient';
|
|
881
|
-
type
|
|
890
|
+
type EventoAuthDefault = {
|
|
891
|
+
autenticacao_necessaria?: false;
|
|
892
|
+
};
|
|
893
|
+
type EventoEnvia<P = unknown> = EventoAuthDefault & {
|
|
882
894
|
tipo: 'envia';
|
|
883
895
|
payload: P;
|
|
884
896
|
response?: never;
|
|
885
897
|
};
|
|
886
|
-
type EventoEmite<P = unknown, R = unknown> = {
|
|
898
|
+
type EventoEmite<P = unknown, R = unknown> = EventoAuthDefault & {
|
|
887
899
|
tipo: 'emite';
|
|
888
900
|
payload: P;
|
|
889
901
|
response: R;
|
|
890
902
|
delivery?: EmitDelivery;
|
|
891
903
|
};
|
|
892
|
-
type EventoEnviaERecebe<P = unknown, R = unknown> = {
|
|
904
|
+
type EventoEnviaERecebe<P = unknown, R = unknown> = EventoAuthDefault & {
|
|
893
905
|
tipo: 'envia-e-recebe';
|
|
894
906
|
payload: P;
|
|
895
907
|
response: R;
|
|
@@ -934,7 +946,7 @@ declare namespace EventosWebSocket {
|
|
|
934
946
|
idSessao: number;
|
|
935
947
|
};
|
|
936
948
|
response: {
|
|
937
|
-
|
|
949
|
+
codigoSala: SalaDeJogo_Codigo;
|
|
938
950
|
};
|
|
939
951
|
};
|
|
940
952
|
emitirEstouEmJogo: {
|
|
@@ -957,21 +969,10 @@ declare namespace EventosWebSocket {
|
|
|
957
969
|
tipo: "emite";
|
|
958
970
|
payload: {};
|
|
959
971
|
response: {
|
|
960
|
-
salas:
|
|
972
|
+
salas: SalaDeJogoDto[];
|
|
961
973
|
};
|
|
962
974
|
delivery: "broadcast";
|
|
963
975
|
};
|
|
964
|
-
emitirDadosParaParticipanteDeSala: {
|
|
965
|
-
tipo: "emite";
|
|
966
|
-
payload: {
|
|
967
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
968
|
-
idJogador: number;
|
|
969
|
-
};
|
|
970
|
-
response: {
|
|
971
|
-
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
972
|
-
};
|
|
973
|
-
delivery: "perRecipient";
|
|
974
|
-
};
|
|
975
976
|
};
|
|
976
977
|
readonly UsuariosConectados: {
|
|
977
978
|
emitirUsuariosConectadosAgora: {
|
|
@@ -1254,7 +1255,7 @@ declare const Eventos_Emite: {
|
|
|
1254
1255
|
tipo: "emite";
|
|
1255
1256
|
payload: {};
|
|
1256
1257
|
response: {
|
|
1257
|
-
salas:
|
|
1258
|
+
salas: SalaDeJogoDto[];
|
|
1258
1259
|
};
|
|
1259
1260
|
delivery: "broadcast";
|
|
1260
1261
|
} & {
|
|
@@ -1262,21 +1263,6 @@ declare const Eventos_Emite: {
|
|
|
1262
1263
|
readonly gateway: "Jogo";
|
|
1263
1264
|
readonly fullName: "Jogo:emitirTodasSalas";
|
|
1264
1265
|
};
|
|
1265
|
-
emitirDadosParaParticipanteDeSala: {
|
|
1266
|
-
tipo: "emite";
|
|
1267
|
-
payload: {
|
|
1268
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
1269
|
-
idJogador: number;
|
|
1270
|
-
};
|
|
1271
|
-
response: {
|
|
1272
|
-
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
1273
|
-
};
|
|
1274
|
-
delivery: "perRecipient";
|
|
1275
|
-
} & {
|
|
1276
|
-
readonly nome: "emitirDadosParaParticipanteDeSala";
|
|
1277
|
-
readonly gateway: "Jogo";
|
|
1278
|
-
readonly fullName: "Jogo:emitirDadosParaParticipanteDeSala";
|
|
1279
|
-
};
|
|
1280
1266
|
};
|
|
1281
1267
|
};
|
|
1282
1268
|
readonly UsuariosConectados: {
|
|
@@ -1323,7 +1309,7 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1323
1309
|
idSessao: number;
|
|
1324
1310
|
};
|
|
1325
1311
|
response: {
|
|
1326
|
-
|
|
1312
|
+
codigoSala: SalaDeJogo_Codigo;
|
|
1327
1313
|
};
|
|
1328
1314
|
} & {
|
|
1329
1315
|
readonly nome: "requisicaoDeAberturaDeSala";
|
|
@@ -1351,4 +1337,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1351
1337
|
};
|
|
1352
1338
|
};
|
|
1353
1339
|
};
|
|
1354
|
-
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, PersonagemSalaJogoDto, 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,
|
|
1340
|
+
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, PersonagemSalaJogoDto, 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, SalaDeJogo_Codigo, SalaDeJogoParams, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_Mestre, SalaDeJogo_Mestre_Mestrada, SalaDeJogo_Mestre_Inteligente, SalaDeJogo_TipoParticipante, SalaDeJogo_Participante, SalaDeJogo_Participante_Narrador, SalaDeJogo_Participante_Jogador, SalaDeJogo_FUNC_AtualizaParticipanteParams, SalaDeJogoDto, PAGINAS, PaginaChave, PaginaObjeto, MensagemChatRecebida, SalaChat, SalaChatFront, MensagemChatPayload, SOCKET_AcessoUsuario, SOCKET_UsuarioExistente, TelemetryConnectionInfo, WsEventAudienceUnico, WsEventAudienceMultiplo, WsEventAudience, TelemetryEventLog, TelemetrySnapshot, WsErrorResponse, WsUnauthorizedErrorResponse, WsResult, isWsErrorResponse, isWsUnauthorizedErrorResponse, wsErro, wsUnauthorized, wsMap, wsChain, EventoTipo, EmitDelivery, EventoAuthDefault, EventoEnvia, EventoEmite, EventoEnviaERecebe, EventoSchema, GatewayDef, createGateway, EventosWebSocket, isRecord, getEmitDelivery, WsEmitTarget, WsEmitParams, 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
|
@@ -12,6 +12,35 @@ class AuthSession {
|
|
|
12
12
|
this.json = json;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
var SalaDeJogo_Tipo;
|
|
16
|
+
(function (SalaDeJogo_Tipo) {
|
|
17
|
+
SalaDeJogo_Tipo["SALA__SOLO"] = "Sess\u00E3o Solo";
|
|
18
|
+
SalaDeJogo_Tipo["SALA__SESSAO_UNICA"] = "Sess\u00E3o \u00DAnica";
|
|
19
|
+
SalaDeJogo_Tipo["SALA__SESSAO_AVENTURA"] = "Sess\u00E3o Aventura";
|
|
20
|
+
})(SalaDeJogo_Tipo || (SalaDeJogo_Tipo = {}));
|
|
21
|
+
var SalaDeJogo_Estado;
|
|
22
|
+
(function (SalaDeJogo_Estado) {
|
|
23
|
+
SalaDeJogo_Estado["SALA__EM_ESPERA"] = "Em Espera";
|
|
24
|
+
SalaDeJogo_Estado["SALA__EM_ANDAMENTO"] = "Em Andamento";
|
|
25
|
+
})(SalaDeJogo_Estado || (SalaDeJogo_Estado = {}));
|
|
26
|
+
//
|
|
27
|
+
// #endregion
|
|
28
|
+
// #region Mestre da Sala
|
|
29
|
+
//
|
|
30
|
+
var SalaDeJogo_TipoMestre;
|
|
31
|
+
(function (SalaDeJogo_TipoMestre) {
|
|
32
|
+
SalaDeJogo_TipoMestre["SALA__MESTRADA"] = "SALA__MESTRADA";
|
|
33
|
+
SalaDeJogo_TipoMestre["SALA__INTELIGENTE"] = "SALA__INTELIGENTE";
|
|
34
|
+
})(SalaDeJogo_TipoMestre || (SalaDeJogo_TipoMestre = {}));
|
|
35
|
+
//
|
|
36
|
+
// #endregion
|
|
37
|
+
// #region Participante da Sala
|
|
38
|
+
//
|
|
39
|
+
var SalaDeJogo_TipoParticipante;
|
|
40
|
+
(function (SalaDeJogo_TipoParticipante) {
|
|
41
|
+
SalaDeJogo_TipoParticipante["SALA__NARRADOR"] = "Narrador";
|
|
42
|
+
SalaDeJogo_TipoParticipante["SALA__JOGADOR"] = "Jogador";
|
|
43
|
+
})(SalaDeJogo_TipoParticipante || (SalaDeJogo_TipoParticipante = {}));
|
|
15
44
|
const PAGINAS = {
|
|
16
45
|
VAZIA: {
|
|
17
46
|
id: '',
|
|
@@ -78,29 +107,10 @@ const PAGINAS = {
|
|
|
78
107
|
nome: 'Página de Jogo',
|
|
79
108
|
},
|
|
80
109
|
};
|
|
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
110
|
function isWsErrorResponse(payload) { return !!payload && typeof payload === "object" && payload._wsErro === true; }
|
|
111
|
+
function isWsUnauthorizedErrorResponse(payload) { return isWsErrorResponse(payload) && payload.code === "UNAUTHORIZED"; }
|
|
103
112
|
function wsErro(mensagem, extra) { return { _wsErro: true, mensagem, ...(extra ?? {}) }; }
|
|
113
|
+
function wsUnauthorized(mensagem = "Não autorizado", detalhes) { return { _wsErro: true, mensagem, code: "UNAUTHORIZED", detalhes }; }
|
|
104
114
|
// helper que elimina o if manual no gateway
|
|
105
115
|
function wsMap(value, mapper) { return isWsErrorResponse(value) ? value : mapper(value); }
|
|
106
116
|
// opcional para encadear fluxos no service/repository se quiser evoluir
|
|
@@ -118,6 +128,7 @@ var EventosWebSocket;
|
|
|
118
128
|
tipo: 'envia-e-recebe',
|
|
119
129
|
payload: {},
|
|
120
130
|
response: { salas: [] },
|
|
131
|
+
// autenticacao_necessaria: false,
|
|
121
132
|
},
|
|
122
133
|
emitirMensagem: {
|
|
123
134
|
tipo: 'emite',
|
|
@@ -130,7 +141,7 @@ var EventosWebSocket;
|
|
|
130
141
|
requisicaoDeAberturaDeSala: {
|
|
131
142
|
tipo: 'envia-e-recebe',
|
|
132
143
|
payload: { idSessao: 0 },
|
|
133
|
-
response: {
|
|
144
|
+
response: { codigoSala: {} },
|
|
134
145
|
},
|
|
135
146
|
emitirEstouEmJogo: {
|
|
136
147
|
tipo: 'emite',
|
|
@@ -150,12 +161,12 @@ var EventosWebSocket;
|
|
|
150
161
|
response: { salas: [] },
|
|
151
162
|
delivery: 'broadcast',
|
|
152
163
|
},
|
|
153
|
-
emitirDadosParaParticipanteDeSala: {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
164
|
+
// emitirDadosParaParticipanteDeSala: {
|
|
165
|
+
// tipo: 'emite',
|
|
166
|
+
// payload: { codigoSala: {} as SalaDeJogo_Codigo, idJogador: 0 },
|
|
167
|
+
// response: { dados: {} as SOCKET_DadosParaParticipanteDeSala },
|
|
168
|
+
// delivery: 'perRecipient' as const,
|
|
169
|
+
// },
|
|
159
170
|
});
|
|
160
171
|
const UsuariosConectados = createGateway({
|
|
161
172
|
emitirUsuariosConectadosAgora: {
|
|
@@ -170,6 +181,7 @@ var EventosWebSocket;
|
|
|
170
181
|
tipo: 'envia-e-recebe',
|
|
171
182
|
payload: {},
|
|
172
183
|
response: { usuariosExistentes: [] },
|
|
184
|
+
// autenticacao_necessaria: false,
|
|
173
185
|
},
|
|
174
186
|
});
|
|
175
187
|
EventosWebSocket.gateways = { Chat, Jogo, UsuariosConectados, UsuariosExistentes };
|
|
@@ -301,4 +313,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
301
313
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
302
314
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
303
315
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
304
|
-
export { AuthSession,
|
|
316
|
+
export { AuthSession, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante, PAGINAS, isWsErrorResponse, isWsUnauthorizedErrorResponse, wsErro, wsUnauthorized, wsMap, wsChain, createGateway, EventosWebSocket, isRecord, getEmitDelivery, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, PathTokenPadrao, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|