types-nora-api 0.0.189 → 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 +42 -17
- package/dist/classes.js +27 -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: {
|
|
@@ -942,6 +943,7 @@ declare namespace EventosWebSocket {
|
|
|
942
943
|
response: {
|
|
943
944
|
estouEmJogo: boolean;
|
|
944
945
|
};
|
|
946
|
+
delivery: "perRecipient";
|
|
945
947
|
};
|
|
946
948
|
emitirSessaoEmAndamento: {
|
|
947
949
|
tipo: "emite";
|
|
@@ -949,6 +951,7 @@ declare namespace EventosWebSocket {
|
|
|
949
951
|
response: {
|
|
950
952
|
sessaoEmAndamento: SessaoDto | null;
|
|
951
953
|
};
|
|
954
|
+
delivery: "perRecipient";
|
|
952
955
|
};
|
|
953
956
|
emitirTodasSalas: {
|
|
954
957
|
tipo: "emite";
|
|
@@ -956,6 +959,7 @@ declare namespace EventosWebSocket {
|
|
|
956
959
|
response: {
|
|
957
960
|
salas: SOCKET_SalaDeJogoDto[];
|
|
958
961
|
};
|
|
962
|
+
delivery: "broadcast";
|
|
959
963
|
};
|
|
960
964
|
emitirDadosParaParticipanteDeSala: {
|
|
961
965
|
tipo: "emite";
|
|
@@ -966,6 +970,7 @@ declare namespace EventosWebSocket {
|
|
|
966
970
|
response: {
|
|
967
971
|
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
968
972
|
};
|
|
973
|
+
delivery: "perRecipient";
|
|
969
974
|
};
|
|
970
975
|
};
|
|
971
976
|
readonly UsuariosConectados: {
|
|
@@ -975,6 +980,7 @@ declare namespace EventosWebSocket {
|
|
|
975
980
|
response: {
|
|
976
981
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
977
982
|
};
|
|
983
|
+
delivery: "broadcast";
|
|
978
984
|
};
|
|
979
985
|
};
|
|
980
986
|
readonly UsuariosExistentes: {
|
|
@@ -988,6 +994,21 @@ declare namespace EventosWebSocket {
|
|
|
988
994
|
};
|
|
989
995
|
};
|
|
990
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
|
+
};
|
|
991
1012
|
type EventosEmiteMap = typeof Eventos_Emite;
|
|
992
1013
|
type EventoEmiteAny = {
|
|
993
1014
|
[G in keyof EventosEmiteMap]: EventosEmiteMap[G]['eventos'][keyof EventosEmiteMap[G]['eventos']];
|
|
@@ -1190,13 +1211,12 @@ declare const Eventos_Emite: {
|
|
|
1190
1211
|
emitirMensagem: {
|
|
1191
1212
|
tipo: "emite";
|
|
1192
1213
|
payload: {
|
|
1193
|
-
|
|
1194
|
-
salaId: string;
|
|
1195
|
-
conteudoMensagem: string;
|
|
1214
|
+
mensagemId: number;
|
|
1196
1215
|
};
|
|
1197
|
-
response: {
|
|
1216
|
+
response: WsResult<{
|
|
1198
1217
|
conteudoMensagem: MensagemChatRecebida;
|
|
1199
|
-
}
|
|
1218
|
+
}>;
|
|
1219
|
+
delivery: "broadcast";
|
|
1200
1220
|
} & {
|
|
1201
1221
|
readonly nome: "emitirMensagem";
|
|
1202
1222
|
readonly gateway: "Chat";
|
|
@@ -1212,6 +1232,7 @@ declare const Eventos_Emite: {
|
|
|
1212
1232
|
response: {
|
|
1213
1233
|
estouEmJogo: boolean;
|
|
1214
1234
|
};
|
|
1235
|
+
delivery: "perRecipient";
|
|
1215
1236
|
} & {
|
|
1216
1237
|
readonly nome: "emitirEstouEmJogo";
|
|
1217
1238
|
readonly gateway: "Jogo";
|
|
@@ -1223,6 +1244,7 @@ declare const Eventos_Emite: {
|
|
|
1223
1244
|
response: {
|
|
1224
1245
|
sessaoEmAndamento: SessaoDto | null;
|
|
1225
1246
|
};
|
|
1247
|
+
delivery: "perRecipient";
|
|
1226
1248
|
} & {
|
|
1227
1249
|
readonly nome: "emitirSessaoEmAndamento";
|
|
1228
1250
|
readonly gateway: "Jogo";
|
|
@@ -1234,6 +1256,7 @@ declare const Eventos_Emite: {
|
|
|
1234
1256
|
response: {
|
|
1235
1257
|
salas: SOCKET_SalaDeJogoDto[];
|
|
1236
1258
|
};
|
|
1259
|
+
delivery: "broadcast";
|
|
1237
1260
|
} & {
|
|
1238
1261
|
readonly nome: "emitirTodasSalas";
|
|
1239
1262
|
readonly gateway: "Jogo";
|
|
@@ -1248,6 +1271,7 @@ declare const Eventos_Emite: {
|
|
|
1248
1271
|
response: {
|
|
1249
1272
|
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
1250
1273
|
};
|
|
1274
|
+
delivery: "perRecipient";
|
|
1251
1275
|
} & {
|
|
1252
1276
|
readonly nome: "emitirDadosParaParticipanteDeSala";
|
|
1253
1277
|
readonly gateway: "Jogo";
|
|
@@ -1263,6 +1287,7 @@ declare const Eventos_Emite: {
|
|
|
1263
1287
|
response: {
|
|
1264
1288
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
1265
1289
|
};
|
|
1290
|
+
delivery: "broadcast";
|
|
1266
1291
|
} & {
|
|
1267
1292
|
readonly nome: "emitirUsuariosConectadosAgora";
|
|
1268
1293
|
readonly gateway: "UsuariosConectados";
|
|
@@ -1326,4 +1351,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1326
1351
|
};
|
|
1327
1352
|
};
|
|
1328
1353
|
};
|
|
1329
|
-
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({
|
|
@@ -135,26 +136,25 @@ var EventosWebSocket;
|
|
|
135
136
|
tipo: 'emite',
|
|
136
137
|
payload: {},
|
|
137
138
|
response: { estouEmJogo: true },
|
|
139
|
+
delivery: 'perRecipient',
|
|
138
140
|
},
|
|
139
141
|
emitirSessaoEmAndamento: {
|
|
140
142
|
tipo: 'emite',
|
|
141
143
|
payload: {},
|
|
142
144
|
response: { sessaoEmAndamento: {} },
|
|
145
|
+
delivery: 'perRecipient',
|
|
143
146
|
},
|
|
144
|
-
// emitirDadosSessao: {
|
|
145
|
-
// tipo: 'emite',
|
|
146
|
-
// payload: {},
|
|
147
|
-
// response: { dadosSessao: [] as SOCKET_JogadorSalaDeJogo[] }
|
|
148
|
-
// },
|
|
149
147
|
emitirTodasSalas: {
|
|
150
148
|
tipo: 'emite',
|
|
151
149
|
payload: {},
|
|
152
150
|
response: { salas: [] },
|
|
151
|
+
delivery: 'broadcast',
|
|
153
152
|
},
|
|
154
153
|
emitirDadosParaParticipanteDeSala: {
|
|
155
154
|
tipo: 'emite',
|
|
156
155
|
payload: { codigoSala: {}, idJogador: 0 },
|
|
157
156
|
response: { dados: {} },
|
|
157
|
+
delivery: 'perRecipient',
|
|
158
158
|
},
|
|
159
159
|
});
|
|
160
160
|
const UsuariosConectados = createGateway({
|
|
@@ -162,6 +162,7 @@ var EventosWebSocket;
|
|
|
162
162
|
tipo: 'emite',
|
|
163
163
|
payload: {},
|
|
164
164
|
response: { usuariosConectados: [] },
|
|
165
|
+
delivery: 'broadcast',
|
|
165
166
|
},
|
|
166
167
|
});
|
|
167
168
|
const UsuariosExistentes = createGateway({
|
|
@@ -173,6 +174,24 @@ var EventosWebSocket;
|
|
|
173
174
|
});
|
|
174
175
|
EventosWebSocket.gateways = { Chat, Jogo, UsuariosConectados, UsuariosExistentes };
|
|
175
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
|
+
}
|
|
176
195
|
// @tipoCompartilhadoFront
|
|
177
196
|
var AventuraEstado;
|
|
178
197
|
(function (AventuraEstado) {
|
|
@@ -282,4 +301,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
282
301
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
283
302
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
284
303
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
285
|
-
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 };
|