types-nora-api 0.0.189 → 0.0.196
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 +104 -101
- package/dist/classes.js +62 -35
- 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;
|
|
@@ -866,33 +870,35 @@ type WsErrorResponse = {
|
|
|
866
870
|
_wsErro: true;
|
|
867
871
|
mensagem: string;
|
|
868
872
|
code?: string;
|
|
869
|
-
detalhes?:
|
|
873
|
+
detalhes?: unknown;
|
|
870
874
|
};
|
|
871
875
|
type WsResult<T> = T | WsErrorResponse;
|
|
872
876
|
declare function isWsErrorResponse(payload: unknown): payload is WsErrorResponse;
|
|
873
877
|
declare function wsErro(mensagem: string, extra?: {
|
|
874
878
|
code?: string;
|
|
875
|
-
detalhes?:
|
|
879
|
+
detalhes?: unknown;
|
|
876
880
|
}): WsErrorResponse;
|
|
877
881
|
declare function wsMap<T, R>(value: WsResult<T>, mapper: (value: T) => R): WsResult<R>;
|
|
878
882
|
declare function wsChain<T, R>(value: WsResult<T>, next: (value: T) => WsResult<R>): WsResult<R>;
|
|
879
883
|
type EventoTipo = 'envia' | 'emite' | 'envia-e-recebe';
|
|
880
|
-
type
|
|
884
|
+
type EmitDelivery = 'broadcast' | 'perRecipient';
|
|
885
|
+
type EventoEnvia<P = unknown> = {
|
|
881
886
|
tipo: 'envia';
|
|
882
887
|
payload: P;
|
|
883
888
|
response?: never;
|
|
884
889
|
};
|
|
885
|
-
type EventoEmite<P =
|
|
890
|
+
type EventoEmite<P = unknown, R = unknown> = {
|
|
886
891
|
tipo: 'emite';
|
|
887
892
|
payload: P;
|
|
888
893
|
response: R;
|
|
894
|
+
delivery?: EmitDelivery;
|
|
889
895
|
};
|
|
890
|
-
type EventoEnviaERecebe<P =
|
|
896
|
+
type EventoEnviaERecebe<P = unknown, R = unknown> = {
|
|
891
897
|
tipo: 'envia-e-recebe';
|
|
892
898
|
payload: P;
|
|
893
899
|
response: R;
|
|
894
900
|
};
|
|
895
|
-
type EventoSchema = EventoEnvia<
|
|
901
|
+
type EventoSchema = EventoEnvia<unknown> | EventoEmite<unknown, unknown> | EventoEnviaERecebe<unknown, unknown>;
|
|
896
902
|
type GatewayDef = Record<string, EventoSchema>;
|
|
897
903
|
declare function createGateway<T extends {
|
|
898
904
|
[K in keyof T]: EventoSchema;
|
|
@@ -917,13 +923,12 @@ declare namespace EventosWebSocket {
|
|
|
917
923
|
emitirMensagem: {
|
|
918
924
|
tipo: "emite";
|
|
919
925
|
payload: {
|
|
920
|
-
|
|
921
|
-
salaId: string;
|
|
922
|
-
conteudoMensagem: string;
|
|
926
|
+
mensagemId: number;
|
|
923
927
|
};
|
|
924
|
-
response: {
|
|
928
|
+
response: WsResult<{
|
|
925
929
|
conteudoMensagem: MensagemChatRecebida;
|
|
926
|
-
}
|
|
930
|
+
}>;
|
|
931
|
+
delivery: "broadcast";
|
|
927
932
|
};
|
|
928
933
|
};
|
|
929
934
|
readonly Jogo: {
|
|
@@ -933,7 +938,7 @@ declare namespace EventosWebSocket {
|
|
|
933
938
|
idSessao: number;
|
|
934
939
|
};
|
|
935
940
|
response: {
|
|
936
|
-
|
|
941
|
+
codigoSala: SalaDeJogo_Codigo;
|
|
937
942
|
};
|
|
938
943
|
};
|
|
939
944
|
emitirEstouEmJogo: {
|
|
@@ -942,6 +947,7 @@ declare namespace EventosWebSocket {
|
|
|
942
947
|
response: {
|
|
943
948
|
estouEmJogo: boolean;
|
|
944
949
|
};
|
|
950
|
+
delivery: "perRecipient";
|
|
945
951
|
};
|
|
946
952
|
emitirSessaoEmAndamento: {
|
|
947
953
|
tipo: "emite";
|
|
@@ -949,23 +955,15 @@ declare namespace EventosWebSocket {
|
|
|
949
955
|
response: {
|
|
950
956
|
sessaoEmAndamento: SessaoDto | null;
|
|
951
957
|
};
|
|
958
|
+
delivery: "perRecipient";
|
|
952
959
|
};
|
|
953
960
|
emitirTodasSalas: {
|
|
954
961
|
tipo: "emite";
|
|
955
962
|
payload: {};
|
|
956
963
|
response: {
|
|
957
|
-
salas:
|
|
958
|
-
};
|
|
959
|
-
};
|
|
960
|
-
emitirDadosParaParticipanteDeSala: {
|
|
961
|
-
tipo: "emite";
|
|
962
|
-
payload: {
|
|
963
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
964
|
-
idJogador: number;
|
|
965
|
-
};
|
|
966
|
-
response: {
|
|
967
|
-
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
964
|
+
salas: SalaDeJogoDto[];
|
|
968
965
|
};
|
|
966
|
+
delivery: "broadcast";
|
|
969
967
|
};
|
|
970
968
|
};
|
|
971
969
|
readonly UsuariosConectados: {
|
|
@@ -975,6 +973,7 @@ declare namespace EventosWebSocket {
|
|
|
975
973
|
response: {
|
|
976
974
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
977
975
|
};
|
|
976
|
+
delivery: "broadcast";
|
|
978
977
|
};
|
|
979
978
|
};
|
|
980
979
|
readonly UsuariosExistentes: {
|
|
@@ -988,6 +987,21 @@ declare namespace EventosWebSocket {
|
|
|
988
987
|
};
|
|
989
988
|
};
|
|
990
989
|
}
|
|
990
|
+
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
991
|
+
declare function getEmitDelivery(gatewayName: string, eventName: string): EmitDelivery | undefined;
|
|
992
|
+
type WsEmitTarget = {
|
|
993
|
+
room: string;
|
|
994
|
+
} | {
|
|
995
|
+
userIds: number[];
|
|
996
|
+
} | {
|
|
997
|
+
scope: 'authenticated';
|
|
998
|
+
} | {
|
|
999
|
+
scope: 'all';
|
|
1000
|
+
};
|
|
1001
|
+
type WsEmitParams<E extends EventoEmiteAny> = {
|
|
1002
|
+
payload?: E['payload'];
|
|
1003
|
+
target?: WsEmitTarget;
|
|
1004
|
+
};
|
|
991
1005
|
type EventosEmiteMap = typeof Eventos_Emite;
|
|
992
1006
|
type EventoEmiteAny = {
|
|
993
1007
|
[G in keyof EventosEmiteMap]: EventosEmiteMap[G]['eventos'][keyof EventosEmiteMap[G]['eventos']];
|
|
@@ -1190,13 +1204,12 @@ declare const Eventos_Emite: {
|
|
|
1190
1204
|
emitirMensagem: {
|
|
1191
1205
|
tipo: "emite";
|
|
1192
1206
|
payload: {
|
|
1193
|
-
|
|
1194
|
-
salaId: string;
|
|
1195
|
-
conteudoMensagem: string;
|
|
1207
|
+
mensagemId: number;
|
|
1196
1208
|
};
|
|
1197
|
-
response: {
|
|
1209
|
+
response: WsResult<{
|
|
1198
1210
|
conteudoMensagem: MensagemChatRecebida;
|
|
1199
|
-
}
|
|
1211
|
+
}>;
|
|
1212
|
+
delivery: "broadcast";
|
|
1200
1213
|
} & {
|
|
1201
1214
|
readonly nome: "emitirMensagem";
|
|
1202
1215
|
readonly gateway: "Chat";
|
|
@@ -1212,6 +1225,7 @@ declare const Eventos_Emite: {
|
|
|
1212
1225
|
response: {
|
|
1213
1226
|
estouEmJogo: boolean;
|
|
1214
1227
|
};
|
|
1228
|
+
delivery: "perRecipient";
|
|
1215
1229
|
} & {
|
|
1216
1230
|
readonly nome: "emitirEstouEmJogo";
|
|
1217
1231
|
readonly gateway: "Jogo";
|
|
@@ -1223,6 +1237,7 @@ declare const Eventos_Emite: {
|
|
|
1223
1237
|
response: {
|
|
1224
1238
|
sessaoEmAndamento: SessaoDto | null;
|
|
1225
1239
|
};
|
|
1240
|
+
delivery: "perRecipient";
|
|
1226
1241
|
} & {
|
|
1227
1242
|
readonly nome: "emitirSessaoEmAndamento";
|
|
1228
1243
|
readonly gateway: "Jogo";
|
|
@@ -1232,27 +1247,14 @@ declare const Eventos_Emite: {
|
|
|
1232
1247
|
tipo: "emite";
|
|
1233
1248
|
payload: {};
|
|
1234
1249
|
response: {
|
|
1235
|
-
salas:
|
|
1250
|
+
salas: SalaDeJogoDto[];
|
|
1236
1251
|
};
|
|
1252
|
+
delivery: "broadcast";
|
|
1237
1253
|
} & {
|
|
1238
1254
|
readonly nome: "emitirTodasSalas";
|
|
1239
1255
|
readonly gateway: "Jogo";
|
|
1240
1256
|
readonly fullName: "Jogo:emitirTodasSalas";
|
|
1241
1257
|
};
|
|
1242
|
-
emitirDadosParaParticipanteDeSala: {
|
|
1243
|
-
tipo: "emite";
|
|
1244
|
-
payload: {
|
|
1245
|
-
codigoSala: SOCKET_CodigoSalaDeJogo;
|
|
1246
|
-
idJogador: number;
|
|
1247
|
-
};
|
|
1248
|
-
response: {
|
|
1249
|
-
dados: SOCKET_DadosParaParticipanteDeSala;
|
|
1250
|
-
};
|
|
1251
|
-
} & {
|
|
1252
|
-
readonly nome: "emitirDadosParaParticipanteDeSala";
|
|
1253
|
-
readonly gateway: "Jogo";
|
|
1254
|
-
readonly fullName: "Jogo:emitirDadosParaParticipanteDeSala";
|
|
1255
|
-
};
|
|
1256
1258
|
};
|
|
1257
1259
|
};
|
|
1258
1260
|
readonly UsuariosConectados: {
|
|
@@ -1263,6 +1265,7 @@ declare const Eventos_Emite: {
|
|
|
1263
1265
|
response: {
|
|
1264
1266
|
usuariosConectados: SOCKET_AcessoUsuario[];
|
|
1265
1267
|
};
|
|
1268
|
+
delivery: "broadcast";
|
|
1266
1269
|
} & {
|
|
1267
1270
|
readonly nome: "emitirUsuariosConectadosAgora";
|
|
1268
1271
|
readonly gateway: "UsuariosConectados";
|
|
@@ -1298,7 +1301,7 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1298
1301
|
idSessao: number;
|
|
1299
1302
|
};
|
|
1300
1303
|
response: {
|
|
1301
|
-
|
|
1304
|
+
codigoSala: SalaDeJogo_Codigo;
|
|
1302
1305
|
};
|
|
1303
1306
|
} & {
|
|
1304
1307
|
readonly nome: "requisicaoDeAberturaDeSala";
|
|
@@ -1326,4 +1329,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1326
1329
|
};
|
|
1327
1330
|
};
|
|
1328
1331
|
};
|
|
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,
|
|
1332
|
+
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, 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
|
@@ -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,27 +107,6 @@ 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; }
|
|
103
111
|
function wsErro(mensagem, extra) { return { _wsErro: true, mensagem, ...(extra ?? {}) }; }
|
|
104
112
|
// helper que elimina o if manual no gateway
|
|
@@ -121,47 +129,48 @@ var EventosWebSocket;
|
|
|
121
129
|
},
|
|
122
130
|
emitirMensagem: {
|
|
123
131
|
tipo: 'emite',
|
|
124
|
-
payload: {
|
|
125
|
-
response: {
|
|
132
|
+
payload: { mensagemId: 0 },
|
|
133
|
+
response: {},
|
|
134
|
+
delivery: 'broadcast',
|
|
126
135
|
},
|
|
127
136
|
});
|
|
128
137
|
const Jogo = createGateway({
|
|
129
138
|
requisicaoDeAberturaDeSala: {
|
|
130
139
|
tipo: 'envia-e-recebe',
|
|
131
140
|
payload: { idSessao: 0 },
|
|
132
|
-
response: {
|
|
141
|
+
response: { codigoSala: {} },
|
|
133
142
|
},
|
|
134
143
|
emitirEstouEmJogo: {
|
|
135
144
|
tipo: 'emite',
|
|
136
145
|
payload: {},
|
|
137
146
|
response: { estouEmJogo: true },
|
|
147
|
+
delivery: 'perRecipient',
|
|
138
148
|
},
|
|
139
149
|
emitirSessaoEmAndamento: {
|
|
140
150
|
tipo: 'emite',
|
|
141
151
|
payload: {},
|
|
142
152
|
response: { sessaoEmAndamento: {} },
|
|
153
|
+
delivery: 'perRecipient',
|
|
143
154
|
},
|
|
144
|
-
// emitirDadosSessao: {
|
|
145
|
-
// tipo: 'emite',
|
|
146
|
-
// payload: {},
|
|
147
|
-
// response: { dadosSessao: [] as SOCKET_JogadorSalaDeJogo[] }
|
|
148
|
-
// },
|
|
149
155
|
emitirTodasSalas: {
|
|
150
156
|
tipo: 'emite',
|
|
151
157
|
payload: {},
|
|
152
158
|
response: { salas: [] },
|
|
159
|
+
delivery: 'broadcast',
|
|
153
160
|
},
|
|
154
|
-
emitirDadosParaParticipanteDeSala: {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
// emitirDadosParaParticipanteDeSala: {
|
|
162
|
+
// tipo: 'emite',
|
|
163
|
+
// payload: { codigoSala: {} as SalaDeJogo_Codigo, idJogador: 0 },
|
|
164
|
+
// response: { dados: {} as SOCKET_DadosParaParticipanteDeSala },
|
|
165
|
+
// delivery: 'perRecipient' as const,
|
|
166
|
+
// },
|
|
159
167
|
});
|
|
160
168
|
const UsuariosConectados = createGateway({
|
|
161
169
|
emitirUsuariosConectadosAgora: {
|
|
162
170
|
tipo: 'emite',
|
|
163
171
|
payload: {},
|
|
164
172
|
response: { usuariosConectados: [] },
|
|
173
|
+
delivery: 'broadcast',
|
|
165
174
|
},
|
|
166
175
|
});
|
|
167
176
|
const UsuariosExistentes = createGateway({
|
|
@@ -173,6 +182,24 @@ var EventosWebSocket;
|
|
|
173
182
|
});
|
|
174
183
|
EventosWebSocket.gateways = { Chat, Jogo, UsuariosConectados, UsuariosExistentes };
|
|
175
184
|
})(EventosWebSocket || (EventosWebSocket = {}));
|
|
185
|
+
function isRecord(value) { return typeof value === 'object' && value !== null; }
|
|
186
|
+
function getEmitDelivery(gatewayName, eventName) {
|
|
187
|
+
const gatewaysUnknown = EventosWebSocket.gateways;
|
|
188
|
+
if (!isRecord(gatewaysUnknown))
|
|
189
|
+
return undefined;
|
|
190
|
+
const gw = gatewaysUnknown[gatewayName];
|
|
191
|
+
if (!isRecord(gw))
|
|
192
|
+
return undefined;
|
|
193
|
+
const schema = gw[eventName];
|
|
194
|
+
if (!isRecord(schema))
|
|
195
|
+
return undefined;
|
|
196
|
+
if (schema.tipo !== 'emite')
|
|
197
|
+
return undefined;
|
|
198
|
+
const delivery = schema.delivery;
|
|
199
|
+
if (delivery === 'broadcast' || delivery === 'perRecipient')
|
|
200
|
+
return delivery;
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
176
203
|
// @tipoCompartilhadoFront
|
|
177
204
|
var AventuraEstado;
|
|
178
205
|
(function (AventuraEstado) {
|
|
@@ -282,4 +309,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
282
309
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
283
310
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
284
311
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
285
|
-
export { AuthSession,
|
|
312
|
+
export { AuthSession, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante, PAGINAS, 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 };
|