types-nora-api 0.0.188 → 0.0.192
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 +60 -17
- package/dist/classes.js +32 -8
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -866,33 +866,35 @@ type WsErrorResponse = {
|
|
|
866
866
|
_wsErro: true;
|
|
867
867
|
mensagem: string;
|
|
868
868
|
code?: string;
|
|
869
|
-
detalhes?:
|
|
869
|
+
detalhes?: unknown;
|
|
870
870
|
};
|
|
871
871
|
type WsResult<T> = T | WsErrorResponse;
|
|
872
872
|
declare function isWsErrorResponse(payload: unknown): payload is WsErrorResponse;
|
|
873
873
|
declare function wsErro(mensagem: string, extra?: {
|
|
874
874
|
code?: string;
|
|
875
|
-
detalhes?:
|
|
875
|
+
detalhes?: unknown;
|
|
876
876
|
}): WsErrorResponse;
|
|
877
877
|
declare function wsMap<T, R>(value: WsResult<T>, mapper: (value: T) => R): WsResult<R>;
|
|
878
878
|
declare function wsChain<T, R>(value: WsResult<T>, next: (value: T) => WsResult<R>): WsResult<R>;
|
|
879
879
|
type EventoTipo = 'envia' | 'emite' | 'envia-e-recebe';
|
|
880
|
-
type
|
|
880
|
+
type EmitDelivery = 'broadcast' | 'perRecipient';
|
|
881
|
+
type EventoEnvia<P = unknown> = {
|
|
881
882
|
tipo: 'envia';
|
|
882
883
|
payload: P;
|
|
883
884
|
response?: never;
|
|
884
885
|
};
|
|
885
|
-
type EventoEmite<P =
|
|
886
|
+
type EventoEmite<P = unknown, R = unknown> = {
|
|
886
887
|
tipo: 'emite';
|
|
887
888
|
payload: P;
|
|
888
889
|
response: R;
|
|
890
|
+
delivery?: EmitDelivery;
|
|
889
891
|
};
|
|
890
|
-
type EventoEnviaERecebe<P =
|
|
892
|
+
type EventoEnviaERecebe<P = unknown, R = unknown> = {
|
|
891
893
|
tipo: 'envia-e-recebe';
|
|
892
894
|
payload: P;
|
|
893
895
|
response: R;
|
|
894
896
|
};
|
|
895
|
-
type EventoSchema = EventoEnvia<
|
|
897
|
+
type EventoSchema = EventoEnvia<unknown> | EventoEmite<unknown, unknown> | EventoEnviaERecebe<unknown, unknown>;
|
|
896
898
|
type GatewayDef = Record<string, EventoSchema>;
|
|
897
899
|
declare function createGateway<T extends {
|
|
898
900
|
[K in keyof T]: EventoSchema;
|
|
@@ -917,13 +919,12 @@ declare namespace EventosWebSocket {
|
|
|
917
919
|
emitirMensagem: {
|
|
918
920
|
tipo: "emite";
|
|
919
921
|
payload: {
|
|
920
|
-
|
|
921
|
-
salaId: string;
|
|
922
|
-
conteudoMensagem: string;
|
|
922
|
+
mensagemId: number;
|
|
923
923
|
};
|
|
924
|
-
response: {
|
|
924
|
+
response: WsResult<{
|
|
925
925
|
conteudoMensagem: MensagemChatRecebida;
|
|
926
|
-
}
|
|
926
|
+
}>;
|
|
927
|
+
delivery: "broadcast";
|
|
927
928
|
};
|
|
928
929
|
};
|
|
929
930
|
readonly Jogo: {
|
|
@@ -936,12 +937,21 @@ declare namespace EventosWebSocket {
|
|
|
936
937
|
sucesso: boolean;
|
|
937
938
|
};
|
|
938
939
|
};
|
|
940
|
+
emitirEstouEmJogo: {
|
|
941
|
+
tipo: "emite";
|
|
942
|
+
payload: {};
|
|
943
|
+
response: {
|
|
944
|
+
estouEmJogo: boolean;
|
|
945
|
+
};
|
|
946
|
+
delivery: "perRecipient";
|
|
947
|
+
};
|
|
939
948
|
emitirSessaoEmAndamento: {
|
|
940
949
|
tipo: "emite";
|
|
941
950
|
payload: {};
|
|
942
951
|
response: {
|
|
943
952
|
sessaoEmAndamento: SessaoDto | null;
|
|
944
953
|
};
|
|
954
|
+
delivery: "perRecipient";
|
|
945
955
|
};
|
|
946
956
|
emitirTodasSalas: {
|
|
947
957
|
tipo: "emite";
|
|
@@ -949,6 +959,7 @@ declare namespace EventosWebSocket {
|
|
|
949
959
|
response: {
|
|
950
960
|
salas: SOCKET_SalaDeJogoDto[];
|
|
951
961
|
};
|
|
962
|
+
delivery: "broadcast";
|
|
952
963
|
};
|
|
953
964
|
emitirDadosParaParticipanteDeSala: {
|
|
954
965
|
tipo: "emite";
|
|
@@ -959,6 +970,7 @@ declare namespace EventosWebSocket {
|
|
|
959
970
|
response: {
|
|
960
971
|
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
961
972
|
};
|
|
973
|
+
delivery: "perRecipient";
|
|
962
974
|
};
|
|
963
975
|
};
|
|
964
976
|
readonly UsuariosConectados: {
|
|
@@ -968,6 +980,7 @@ declare namespace EventosWebSocket {
|
|
|
968
980
|
response: {
|
|
969
981
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
970
982
|
};
|
|
983
|
+
delivery: "broadcast";
|
|
971
984
|
};
|
|
972
985
|
};
|
|
973
986
|
readonly UsuariosExistentes: {
|
|
@@ -981,6 +994,21 @@ declare namespace EventosWebSocket {
|
|
|
981
994
|
};
|
|
982
995
|
};
|
|
983
996
|
}
|
|
997
|
+
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
998
|
+
declare function getEmitDelivery(gatewayName: string, eventName: string): EmitDelivery | undefined;
|
|
999
|
+
type WsEmitTarget = {
|
|
1000
|
+
room: string;
|
|
1001
|
+
} | {
|
|
1002
|
+
userIds: number[];
|
|
1003
|
+
} | {
|
|
1004
|
+
scope: 'authenticated';
|
|
1005
|
+
} | {
|
|
1006
|
+
scope: 'all';
|
|
1007
|
+
};
|
|
1008
|
+
type WsEmitParams<E extends EventoEmiteAny> = {
|
|
1009
|
+
payload?: E['payload'];
|
|
1010
|
+
target?: WsEmitTarget;
|
|
1011
|
+
};
|
|
984
1012
|
type EventosEmiteMap = typeof Eventos_Emite;
|
|
985
1013
|
type EventoEmiteAny = {
|
|
986
1014
|
[G in keyof EventosEmiteMap]: EventosEmiteMap[G]['eventos'][keyof EventosEmiteMap[G]['eventos']];
|
|
@@ -1183,13 +1211,12 @@ declare const Eventos_Emite: {
|
|
|
1183
1211
|
emitirMensagem: {
|
|
1184
1212
|
tipo: "emite";
|
|
1185
1213
|
payload: {
|
|
1186
|
-
|
|
1187
|
-
salaId: string;
|
|
1188
|
-
conteudoMensagem: string;
|
|
1214
|
+
mensagemId: number;
|
|
1189
1215
|
};
|
|
1190
|
-
response: {
|
|
1216
|
+
response: WsResult<{
|
|
1191
1217
|
conteudoMensagem: MensagemChatRecebida;
|
|
1192
|
-
}
|
|
1218
|
+
}>;
|
|
1219
|
+
delivery: "broadcast";
|
|
1193
1220
|
} & {
|
|
1194
1221
|
readonly nome: "emitirMensagem";
|
|
1195
1222
|
readonly gateway: "Chat";
|
|
@@ -1199,12 +1226,25 @@ declare const Eventos_Emite: {
|
|
|
1199
1226
|
};
|
|
1200
1227
|
readonly Jogo: {
|
|
1201
1228
|
eventos: {
|
|
1229
|
+
emitirEstouEmJogo: {
|
|
1230
|
+
tipo: "emite";
|
|
1231
|
+
payload: {};
|
|
1232
|
+
response: {
|
|
1233
|
+
estouEmJogo: boolean;
|
|
1234
|
+
};
|
|
1235
|
+
delivery: "perRecipient";
|
|
1236
|
+
} & {
|
|
1237
|
+
readonly nome: "emitirEstouEmJogo";
|
|
1238
|
+
readonly gateway: "Jogo";
|
|
1239
|
+
readonly fullName: "Jogo:emitirEstouEmJogo";
|
|
1240
|
+
};
|
|
1202
1241
|
emitirSessaoEmAndamento: {
|
|
1203
1242
|
tipo: "emite";
|
|
1204
1243
|
payload: {};
|
|
1205
1244
|
response: {
|
|
1206
1245
|
sessaoEmAndamento: SessaoDto | null;
|
|
1207
1246
|
};
|
|
1247
|
+
delivery: "perRecipient";
|
|
1208
1248
|
} & {
|
|
1209
1249
|
readonly nome: "emitirSessaoEmAndamento";
|
|
1210
1250
|
readonly gateway: "Jogo";
|
|
@@ -1216,6 +1256,7 @@ declare const Eventos_Emite: {
|
|
|
1216
1256
|
response: {
|
|
1217
1257
|
salas: SOCKET_SalaDeJogoDto[];
|
|
1218
1258
|
};
|
|
1259
|
+
delivery: "broadcast";
|
|
1219
1260
|
} & {
|
|
1220
1261
|
readonly nome: "emitirTodasSalas";
|
|
1221
1262
|
readonly gateway: "Jogo";
|
|
@@ -1230,6 +1271,7 @@ declare const Eventos_Emite: {
|
|
|
1230
1271
|
response: {
|
|
1231
1272
|
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
1232
1273
|
};
|
|
1274
|
+
delivery: "perRecipient";
|
|
1233
1275
|
} & {
|
|
1234
1276
|
readonly nome: "emitirDadosParaParticipanteDeSala";
|
|
1235
1277
|
readonly gateway: "Jogo";
|
|
@@ -1245,6 +1287,7 @@ declare const Eventos_Emite: {
|
|
|
1245
1287
|
response: {
|
|
1246
1288
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
1247
1289
|
};
|
|
1290
|
+
delivery: "broadcast";
|
|
1248
1291
|
} & {
|
|
1249
1292
|
readonly nome: "emitirUsuariosConectadosAgora";
|
|
1250
1293
|
readonly gateway: "UsuariosConectados";
|
|
@@ -1308,4 +1351,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1308
1351
|
};
|
|
1309
1352
|
};
|
|
1310
1353
|
};
|
|
1311
|
-
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, PAGINAS, PaginaChave, PaginaObjeto, MensagemChatRecebida, SalaChat, SalaChatFront, MensagemChatPayload, SOCKET_CodigoSalaDeJogo, PARAM_BuscaSala, SalaDeJogo, FichasPorUsuarioIndex, FichasPorSalaIndex, SOCKET_DadosParaParticipanteDeSala, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_Mestre, SalaDeJogo_TipoMestre, SalaDeJogo_Mestre_Mestrada, SalaDeJogo_Mestre_Inteligente, SalaDeJogo_Participante, 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 };
|
|
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, PAGINAS, PaginaChave, PaginaObjeto, MensagemChatRecebida, SalaChat, SalaChatFront, MensagemChatPayload, SOCKET_CodigoSalaDeJogo, PARAM_BuscaSala, SalaDeJogo, FichasPorUsuarioIndex, FichasPorSalaIndex, SOCKET_DadosParaParticipanteDeSala, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_Mestre, SalaDeJogo_TipoMestre, SalaDeJogo_Mestre_Mestrada, SalaDeJogo_Mestre_Inteligente, SalaDeJogo_Participante, SalaDeJogo_TipoParticipante, SOCKET_SalaDeJogoDto, SOCKET_AcessoUsuario, SOCKET_UsuarioExistente, TelemetryConnectionInfo, WsEventAudienceUnico, WsEventAudienceMultiplo, WsEventAudience, TelemetryEventLog, TelemetrySnapshot, WsErrorResponse, WsResult, isWsErrorResponse, wsErro, wsMap, wsChain, EventoTipo, EmitDelivery, 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
|
@@ -121,8 +121,9 @@ var EventosWebSocket;
|
|
|
121
121
|
},
|
|
122
122
|
emitirMensagem: {
|
|
123
123
|
tipo: 'emite',
|
|
124
|
-
payload: {
|
|
125
|
-
response: {
|
|
124
|
+
payload: { mensagemId: 0 },
|
|
125
|
+
response: {},
|
|
126
|
+
delivery: 'broadcast',
|
|
126
127
|
},
|
|
127
128
|
});
|
|
128
129
|
const Jogo = createGateway({
|
|
@@ -131,25 +132,29 @@ var EventosWebSocket;
|
|
|
131
132
|
payload: { idSessao: 0 },
|
|
132
133
|
response: { sucesso: true },
|
|
133
134
|
},
|
|
135
|
+
emitirEstouEmJogo: {
|
|
136
|
+
tipo: 'emite',
|
|
137
|
+
payload: {},
|
|
138
|
+
response: { estouEmJogo: true },
|
|
139
|
+
delivery: 'perRecipient',
|
|
140
|
+
},
|
|
134
141
|
emitirSessaoEmAndamento: {
|
|
135
142
|
tipo: 'emite',
|
|
136
143
|
payload: {},
|
|
137
144
|
response: { sessaoEmAndamento: {} },
|
|
145
|
+
delivery: 'perRecipient',
|
|
138
146
|
},
|
|
139
|
-
// emitirDadosSessao: {
|
|
140
|
-
// tipo: 'emite',
|
|
141
|
-
// payload: {},
|
|
142
|
-
// response: { dadosSessao: [] as SOCKET_JogadorSalaDeJogo[] }
|
|
143
|
-
// },
|
|
144
147
|
emitirTodasSalas: {
|
|
145
148
|
tipo: 'emite',
|
|
146
149
|
payload: {},
|
|
147
150
|
response: { salas: [] },
|
|
151
|
+
delivery: 'broadcast',
|
|
148
152
|
},
|
|
149
153
|
emitirDadosParaParticipanteDeSala: {
|
|
150
154
|
tipo: 'emite',
|
|
151
155
|
payload: { codigoSala: {}, idJogador: 0 },
|
|
152
156
|
response: { dados: {} },
|
|
157
|
+
delivery: 'perRecipient',
|
|
153
158
|
},
|
|
154
159
|
});
|
|
155
160
|
const UsuariosConectados = createGateway({
|
|
@@ -157,6 +162,7 @@ var EventosWebSocket;
|
|
|
157
162
|
tipo: 'emite',
|
|
158
163
|
payload: {},
|
|
159
164
|
response: { usuariosConectados: [] },
|
|
165
|
+
delivery: 'broadcast',
|
|
160
166
|
},
|
|
161
167
|
});
|
|
162
168
|
const UsuariosExistentes = createGateway({
|
|
@@ -168,6 +174,24 @@ var EventosWebSocket;
|
|
|
168
174
|
});
|
|
169
175
|
EventosWebSocket.gateways = { Chat, Jogo, UsuariosConectados, UsuariosExistentes };
|
|
170
176
|
})(EventosWebSocket || (EventosWebSocket = {}));
|
|
177
|
+
function isRecord(value) { return typeof value === 'object' && value !== null; }
|
|
178
|
+
function getEmitDelivery(gatewayName, eventName) {
|
|
179
|
+
const gatewaysUnknown = EventosWebSocket.gateways;
|
|
180
|
+
if (!isRecord(gatewaysUnknown))
|
|
181
|
+
return undefined;
|
|
182
|
+
const gw = gatewaysUnknown[gatewayName];
|
|
183
|
+
if (!isRecord(gw))
|
|
184
|
+
return undefined;
|
|
185
|
+
const schema = gw[eventName];
|
|
186
|
+
if (!isRecord(schema))
|
|
187
|
+
return undefined;
|
|
188
|
+
if (schema.tipo !== 'emite')
|
|
189
|
+
return undefined;
|
|
190
|
+
const delivery = schema.delivery;
|
|
191
|
+
if (delivery === 'broadcast' || delivery === 'perRecipient')
|
|
192
|
+
return delivery;
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
171
195
|
// @tipoCompartilhadoFront
|
|
172
196
|
var AventuraEstado;
|
|
173
197
|
(function (AventuraEstado) {
|
|
@@ -277,4 +301,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
277
301
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
278
302
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
279
303
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
280
|
-
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 };
|
|
304
|
+
export { AuthSession, PAGINAS, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante, isWsErrorResponse, wsErro, wsMap, wsChain, createGateway, EventosWebSocket, isRecord, getEmitDelivery, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, PathTokenPadrao, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|