types-nora-api 0.0.209 → 0.0.211
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 +71 -218
- package/dist/classes.js +71 -41
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -776,247 +776,100 @@ type SalaDeJogoDto = {
|
|
|
776
776
|
mestre: SalaDeJogo_Mestre;
|
|
777
777
|
participantes: readonly SalaDeJogo_Participante[];
|
|
778
778
|
};
|
|
779
|
-
type
|
|
780
|
-
readonly href: string;
|
|
781
|
-
readonly acesso?: AcessoPagina;
|
|
782
|
-
};
|
|
783
|
-
type ExtractParamsFromHref<S extends string, Acc extends Record<string, any> = {}> = S extends `${infer _A}[[...${infer P}]]${infer Rest}` ? ExtractParamsFromHref<Rest, Acc & {
|
|
779
|
+
type ExtrairParamsDoTemplate<S extends string, Acc extends Record<string, unknown> = {}> = S extends `${infer _A}[[...${infer P}]]${infer Rest}` ? ExtrairParamsDoTemplate<Rest, Acc & {
|
|
784
780
|
[K in P]?: string[];
|
|
785
|
-
}> : S extends `${infer _A}[...${infer P}]${infer Rest}` ?
|
|
781
|
+
}> : S extends `${infer _A}[...${infer P}]${infer Rest}` ? ExtrairParamsDoTemplate<Rest, Acc & {
|
|
786
782
|
[K in P]: string[];
|
|
787
|
-
}> : S extends `${infer _A}[${infer P}]${infer Rest}` ?
|
|
783
|
+
}> : S extends `${infer _A}[${infer P}]${infer Rest}` ? ExtrairParamsDoTemplate<Rest, Acc & {
|
|
788
784
|
[K in P]: string;
|
|
789
785
|
}> : Acc;
|
|
790
|
-
type
|
|
791
|
-
type
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
786
|
+
type PaginaParamsDoTemplate<T extends string> = ExtrairParamsDoTemplate<T>;
|
|
787
|
+
type TemplateComParams = `${string}[[...${string}]]${string}` | `${string}[...${string}]${string}` | `${string}[${string}]${string}`;
|
|
788
|
+
type PaginaEstatica<T extends string> = {
|
|
789
|
+
readonly template: T;
|
|
790
|
+
readonly href: T;
|
|
791
|
+
readonly acesso?: AcessoPagina;
|
|
792
|
+
};
|
|
793
|
+
type PaginaDinamica<T extends TemplateComParams> = {
|
|
794
|
+
readonly template: T;
|
|
795
|
+
readonly href: (params: PaginaParamsDoTemplate<T>) => string;
|
|
796
|
+
readonly acesso?: AcessoPagina;
|
|
796
797
|
};
|
|
798
|
+
type Pagina<T extends string = string> = T extends TemplateComParams ? PaginaDinamica<Extract<T, TemplateComParams>> : PaginaEstatica<T>;
|
|
799
|
+
type PaginaParams<P extends {
|
|
800
|
+
template: string;
|
|
801
|
+
}> = PaginaParamsDoTemplate<P['template']>;
|
|
802
|
+
type Folhas<T> = T extends {
|
|
803
|
+
template: string;
|
|
804
|
+
} ? T : T extends Record<string, unknown> ? {
|
|
805
|
+
[K in keyof T]: Folhas<T[K]>;
|
|
806
|
+
}[keyof T] : never;
|
|
807
|
+
type PaginaFolha = Folhas<typeof PAGINAS>;
|
|
808
|
+
type PaginaTemplate = PaginaFolha['template'];
|
|
809
|
+
declare function montarHref(template: string, params: Record<string, unknown>): string;
|
|
810
|
+
declare function pagina<const T extends string>(template: T extends TemplateComParams ? never : T, acesso?: AcessoPagina): PaginaEstatica<T>;
|
|
811
|
+
declare function paginaDinamica<const T extends TemplateComParams>(template: T, acesso?: AcessoPagina): PaginaDinamica<T>;
|
|
797
812
|
declare const PAGINAS: {
|
|
798
|
-
readonly home:
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
readonly
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
readonly
|
|
805
|
-
readonly href: "/aventura/[id]";
|
|
806
|
-
};
|
|
807
|
-
readonly aventuras: {
|
|
808
|
-
readonly href: "/aventuras";
|
|
809
|
-
};
|
|
810
|
-
readonly cadastrar: {
|
|
811
|
-
readonly href: "/cadastrar";
|
|
812
|
-
};
|
|
813
|
-
readonly definicoes: {
|
|
814
|
-
readonly href: "/definicoes/[[...slug]]";
|
|
815
|
-
};
|
|
816
|
-
readonly dicas: {
|
|
817
|
-
readonly href: "/dicas/[[...slug]]";
|
|
818
|
-
};
|
|
813
|
+
readonly home: PaginaEstatica<"/">;
|
|
814
|
+
readonly acessar: PaginaEstatica<"/acessar">;
|
|
815
|
+
readonly cadastrar: PaginaEstatica<"/cadastrar">;
|
|
816
|
+
readonly aventura: PaginaDinamica<"/aventura/[id]">;
|
|
817
|
+
readonly aventuras: PaginaEstatica<"/aventuras">;
|
|
818
|
+
readonly definicoes: PaginaDinamica<"/definicoes/[[...slug]]">;
|
|
819
|
+
readonly dicas: PaginaDinamica<"/dicas/[[...slug]]">;
|
|
819
820
|
readonly jogo: {
|
|
820
|
-
readonly
|
|
821
|
-
readonly acesso: {
|
|
822
|
-
readonly autenticado: true;
|
|
823
|
-
};
|
|
824
|
-
readonly jogador: {
|
|
825
|
-
readonly href: "/jogo/jogador";
|
|
826
|
-
readonly acesso: {
|
|
827
|
-
readonly autenticado: true;
|
|
828
|
-
};
|
|
829
|
-
};
|
|
821
|
+
readonly jogador: PaginaEstatica<"/jogo/jogador">;
|
|
830
822
|
readonly mestre: {
|
|
831
|
-
readonly sessoesMestre:
|
|
832
|
-
readonly href: "/jogo/mestre/sessoes-mestre";
|
|
833
|
-
readonly acesso: {
|
|
834
|
-
readonly autenticado: true;
|
|
835
|
-
};
|
|
836
|
-
};
|
|
823
|
+
readonly sessoesMestre: PaginaEstatica<"/jogo/mestre/sessoes-mestre">;
|
|
837
824
|
};
|
|
838
825
|
readonly admin: {
|
|
839
|
-
readonly gerenciarSalas:
|
|
840
|
-
readonly href: "/jogo/admin/gerenciar-salas";
|
|
841
|
-
readonly acesso: {
|
|
842
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
843
|
-
};
|
|
844
|
-
};
|
|
826
|
+
readonly gerenciarSalas: PaginaEstatica<"/jogo/admin/gerenciar-salas">;
|
|
845
827
|
};
|
|
846
|
-
readonly emJogo:
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
};
|
|
851
|
-
};
|
|
852
|
-
};
|
|
853
|
-
readonly linhaDoTempo: {
|
|
854
|
-
readonly href: "/linha-do-tempo";
|
|
855
|
-
};
|
|
856
|
-
readonly minhaPagina: {
|
|
857
|
-
readonly href: "/minha-pagina";
|
|
828
|
+
readonly emJogo: PaginaEstatica<"/jogo/em-jogo">;
|
|
829
|
+
readonly template: "/jogo";
|
|
830
|
+
readonly href: "/jogo";
|
|
831
|
+
readonly acesso?: AcessoPagina;
|
|
858
832
|
};
|
|
833
|
+
readonly linhaDoTempo: PaginaEstatica<"/linha-do-tempo">;
|
|
834
|
+
readonly minhaPagina: PaginaEstatica<"/minha-pagina">;
|
|
859
835
|
readonly minhasPaginas: {
|
|
860
836
|
readonly admin: {
|
|
837
|
+
readonly aventura: PaginaDinamica<"/minhas-paginas/admin/aventura/[id]">;
|
|
838
|
+
readonly aventuras: PaginaEstatica<"/minhas-paginas/admin/aventuras">;
|
|
839
|
+
readonly dashboardWs: PaginaEstatica<"/minhas-paginas/admin/dashboard-ws">;
|
|
840
|
+
readonly sessao: PaginaDinamica<"/minhas-paginas/admin/sessao/[id]">;
|
|
841
|
+
readonly uploads: PaginaEstatica<"/minhas-paginas/admin/uploads">;
|
|
842
|
+
readonly variaveisAmbiente: PaginaEstatica<"/minhas-paginas/admin/variaveis-ambiente">;
|
|
843
|
+
readonly template: "/minhas-paginas/admin";
|
|
861
844
|
readonly href: "/minhas-paginas/admin";
|
|
862
|
-
readonly acesso
|
|
863
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
864
|
-
};
|
|
865
|
-
readonly aventura: {
|
|
866
|
-
readonly href: "/minhas-paginas/admin/aventura/[id]";
|
|
867
|
-
readonly acesso: {
|
|
868
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
869
|
-
};
|
|
870
|
-
};
|
|
871
|
-
readonly aventuras: {
|
|
872
|
-
readonly href: "/minhas-paginas/admin/aventuras";
|
|
873
|
-
readonly acesso: {
|
|
874
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
875
|
-
};
|
|
876
|
-
};
|
|
877
|
-
readonly dashboardWs: {
|
|
878
|
-
readonly href: "/minhas-paginas/admin/dashboard-ws";
|
|
879
|
-
readonly acesso: {
|
|
880
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
881
|
-
};
|
|
882
|
-
};
|
|
883
|
-
readonly sessao: {
|
|
884
|
-
readonly href: "/minhas-paginas/admin/sessao/[id]";
|
|
885
|
-
readonly acesso: {
|
|
886
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
887
|
-
};
|
|
888
|
-
};
|
|
889
|
-
readonly uploads: {
|
|
890
|
-
readonly href: "/minhas-paginas/admin/uploads";
|
|
891
|
-
readonly acesso: {
|
|
892
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
893
|
-
};
|
|
894
|
-
};
|
|
895
|
-
readonly variaveisAmbiente: {
|
|
896
|
-
readonly href: "/minhas-paginas/admin/variaveis-ambiente";
|
|
897
|
-
readonly acesso: {
|
|
898
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
899
|
-
};
|
|
900
|
-
};
|
|
845
|
+
readonly acesso?: AcessoPagina;
|
|
901
846
|
};
|
|
902
847
|
readonly jogador: {
|
|
848
|
+
readonly meusPersonagens: PaginaEstatica<"/minhas-paginas/jogador/meus-personagens">;
|
|
849
|
+
readonly template: "/minhas-paginas/jogador";
|
|
903
850
|
readonly href: "/minhas-paginas/jogador";
|
|
904
|
-
readonly acesso
|
|
905
|
-
readonly autenticado: true;
|
|
906
|
-
};
|
|
907
|
-
readonly meusPersonagens: {
|
|
908
|
-
readonly href: "/minhas-paginas/jogador/meus-personagens";
|
|
909
|
-
readonly acesso: {
|
|
910
|
-
readonly autenticado: true;
|
|
911
|
-
};
|
|
912
|
-
};
|
|
851
|
+
readonly acesso?: AcessoPagina;
|
|
913
852
|
};
|
|
914
853
|
readonly mestre: {
|
|
915
|
-
readonly
|
|
916
|
-
readonly
|
|
917
|
-
|
|
918
|
-
};
|
|
919
|
-
readonly aventura: {
|
|
920
|
-
readonly href: "/minhas-paginas/mestre/aventura/[id]";
|
|
921
|
-
readonly acesso: {
|
|
922
|
-
readonly autenticado: true;
|
|
923
|
-
};
|
|
924
|
-
};
|
|
925
|
-
readonly aventuras: {
|
|
926
|
-
readonly href: "/minhas-paginas/mestre/aventuras";
|
|
927
|
-
readonly acesso: {
|
|
928
|
-
readonly autenticado: true;
|
|
929
|
-
};
|
|
930
|
-
};
|
|
931
|
-
readonly personagens: {
|
|
932
|
-
readonly href: "/minhas-paginas/mestre/personagens";
|
|
933
|
-
readonly acesso: {
|
|
934
|
-
readonly autenticado: true;
|
|
935
|
-
};
|
|
936
|
-
};
|
|
854
|
+
readonly aventura: PaginaDinamica<"/minhas-paginas/mestre/aventura/[id]">;
|
|
855
|
+
readonly aventuras: PaginaEstatica<"/minhas-paginas/mestre/aventuras">;
|
|
856
|
+
readonly personagens: PaginaEstatica<"/minhas-paginas/mestre/personagens">;
|
|
937
857
|
readonly rascunhos: {
|
|
938
|
-
readonly aventuras:
|
|
939
|
-
|
|
940
|
-
readonly acesso: {
|
|
941
|
-
readonly autenticado: true;
|
|
942
|
-
};
|
|
943
|
-
};
|
|
944
|
-
readonly sessoesUnicas: {
|
|
945
|
-
readonly href: "/minhas-paginas/mestre/rascunhos/sessoes-unicas";
|
|
946
|
-
readonly acesso: {
|
|
947
|
-
readonly autenticado: true;
|
|
948
|
-
};
|
|
949
|
-
};
|
|
950
|
-
};
|
|
951
|
-
readonly sessao: {
|
|
952
|
-
readonly href: "/minhas-paginas/mestre/sessao/[id]";
|
|
953
|
-
readonly acesso: {
|
|
954
|
-
readonly autenticado: true;
|
|
955
|
-
};
|
|
956
|
-
};
|
|
957
|
-
};
|
|
958
|
-
readonly minhasDisponibilidades: {
|
|
959
|
-
readonly href: "/minhas-paginas/minhas-disponibilidades";
|
|
960
|
-
readonly acesso: {
|
|
961
|
-
readonly autenticado: true;
|
|
858
|
+
readonly aventuras: PaginaEstatica<"/minhas-paginas/mestre/rascunhos/aventuras">;
|
|
859
|
+
readonly sessoesUnicas: PaginaEstatica<"/minhas-paginas/mestre/rascunhos/sessoes-unicas">;
|
|
962
860
|
};
|
|
861
|
+
readonly sessao: PaginaDinamica<"/minhas-paginas/mestre/sessao/[id]">;
|
|
862
|
+
readonly template: "/minhas-paginas/mestre";
|
|
863
|
+
readonly href: "/minhas-paginas/mestre";
|
|
864
|
+
readonly acesso?: AcessoPagina;
|
|
963
865
|
};
|
|
866
|
+
readonly minhasDisponibilidades: PaginaEstatica<"/minhas-paginas/minhas-disponibilidades">;
|
|
964
867
|
};
|
|
965
|
-
readonly personagens:
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
};
|
|
970
|
-
};
|
|
971
|
-
readonly sessoes: {
|
|
972
|
-
readonly href: "/sessoes";
|
|
973
|
-
readonly acesso: {
|
|
974
|
-
readonly autenticado: true;
|
|
975
|
-
};
|
|
976
|
-
};
|
|
977
|
-
readonly sessaoAovivo: {
|
|
978
|
-
readonly href: "/sessao-aovivo";
|
|
979
|
-
readonly acesso: {
|
|
980
|
-
readonly autenticado: true;
|
|
981
|
-
};
|
|
982
|
-
};
|
|
983
|
-
readonly sessao: {
|
|
984
|
-
readonly href: "/sessao/[id]";
|
|
985
|
-
readonly acesso: {
|
|
986
|
-
readonly autenticado: true;
|
|
987
|
-
};
|
|
988
|
-
};
|
|
989
|
-
};
|
|
990
|
-
type PaginasTree<T> = T extends Record<string, any> ? 'href' extends keyof T ? T extends {
|
|
991
|
-
href: infer H;
|
|
992
|
-
} ? H extends string ? {
|
|
993
|
-
href: H;
|
|
994
|
-
acesso?: AcessoPagina;
|
|
995
|
-
} & {
|
|
996
|
-
[K in Exclude<keyof T, 'href' | 'acesso'>]: PaginasTree<T[K]>;
|
|
997
|
-
} : never : never : {
|
|
998
|
-
acesso?: AcessoPagina;
|
|
999
|
-
} & {
|
|
1000
|
-
[K in Exclude<keyof T, 'acesso'>]: PaginasTree<T[K]>;
|
|
1001
|
-
} : never;
|
|
1002
|
-
type _Check = {
|
|
1003
|
-
[K in keyof typeof PAGINAS]: PaginasTree<(typeof PAGINAS)[K]>;
|
|
1004
|
-
};
|
|
1005
|
-
declare const _check: _Check;
|
|
1006
|
-
type PaginaHref = PaginaDef['href'];
|
|
1007
|
-
type PaginaObjeto<P extends PaginaDef = PaginaAtual> = keyof PaginaParams<P> extends never ? {
|
|
1008
|
-
pagina: P;
|
|
1009
|
-
} : {
|
|
1010
|
-
pagina: P;
|
|
1011
|
-
params: PaginaParams<P>;
|
|
868
|
+
readonly personagens: PaginaEstatica<"/personagens">;
|
|
869
|
+
readonly sessoes: PaginaEstatica<"/sessoes">;
|
|
870
|
+
readonly sessaoAovivo: PaginaEstatica<"/sessao-aovivo">;
|
|
871
|
+
readonly sessao: PaginaDinamica<"/sessao/[id]">;
|
|
1012
872
|
};
|
|
1013
|
-
type PaginaLeafUnion<T> = T extends {
|
|
1014
|
-
href: string;
|
|
1015
|
-
} ? T | PaginaLeafUnionChildren<T> : PaginaLeafUnionChildren<T>;
|
|
1016
|
-
type PaginaLeafUnionChildren<T> = T extends Record<string, any> ? {
|
|
1017
|
-
[K in Exclude<keyof T, 'href' | 'acesso'>]: PaginaLeafUnion<T[K]>;
|
|
1018
|
-
}[Exclude<keyof T, 'href' | 'acesso'>] : never;
|
|
1019
|
-
type PaginaAtual = PaginaLeafUnion<typeof PAGINAS>;
|
|
1020
873
|
interface MensagemChatRecebida {
|
|
1021
874
|
salaId: string;
|
|
1022
875
|
idUsuario: number;
|
|
@@ -1041,7 +894,7 @@ interface MensagemChatPayload {
|
|
|
1041
894
|
}
|
|
1042
895
|
type SOCKET_AcessoUsuario = {
|
|
1043
896
|
usuario: UsuarioDto;
|
|
1044
|
-
paginaAtual?:
|
|
897
|
+
paginaAtual?: PaginaTemplate | null;
|
|
1045
898
|
dataAtualizacao: Date;
|
|
1046
899
|
};
|
|
1047
900
|
type SOCKET_UsuarioExistente = {
|
|
@@ -1569,4 +1422,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1569
1422
|
};
|
|
1570
1423
|
};
|
|
1571
1424
|
};
|
|
1572
|
-
export { CAPACIDADES, IPermissoesEstado, PermissoesEstadoDto, IPermissoesItem, PermissoesItemDto, IPermissoesUsuario, PermissoesUsuarioDto, IPermissoesUsuariosHistorico, PermissoesUsuariosHistoricoDto, 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,
|
|
1425
|
+
export { CAPACIDADES, IPermissoesEstado, PermissoesEstadoDto, IPermissoesItem, PermissoesItemDto, IPermissoesUsuario, PermissoesUsuarioDto, IPermissoesUsuariosHistorico, PermissoesUsuariosHistoricoDto, 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, ExtrairParamsDoTemplate, PaginaParamsDoTemplate, TemplateComParams, PaginaEstatica, PaginaDinamica, Pagina, PaginaParams, Folhas, PaginaFolha, PaginaTemplate, montarHref, pagina, paginaDinamica, PAGINAS, 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, Capacidade, LISTA_CAPACIDADES, PermissaoItemMinimo, ListaCapacidadesNecessarias, AcessoPagina, Gateways, EventoTipoLiteral, FiltraEventosPorTipo, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|
package/dist/classes.js
CHANGED
|
@@ -49,60 +49,90 @@ var SalaDeJogo_TipoParticipante;
|
|
|
49
49
|
SalaDeJogo_TipoParticipante["SALA__NARRADOR"] = "Narrador";
|
|
50
50
|
SalaDeJogo_TipoParticipante["SALA__JOGADOR"] = "Jogador";
|
|
51
51
|
})(SalaDeJogo_TipoParticipante || (SalaDeJogo_TipoParticipante = {}));
|
|
52
|
+
function montarHref(template, params) {
|
|
53
|
+
const out = template.replace(/\[\[\.\.\.([^\]]+)\]\]|\[\.\.\.([^\]]+)\]|\[([^\]]+)\]/g, (_m, optCatchAll, catchAll, single) => {
|
|
54
|
+
const key = (optCatchAll || catchAll || single);
|
|
55
|
+
const value = params[key];
|
|
56
|
+
if (optCatchAll) {
|
|
57
|
+
if (value == null)
|
|
58
|
+
return '';
|
|
59
|
+
if (!Array.isArray(value))
|
|
60
|
+
throw new Error(`PAGINAS.href: "${key}" deve ser string[] (optional catch-all)`);
|
|
61
|
+
return value.map((x) => encodeURIComponent(String(x))).join('/');
|
|
62
|
+
}
|
|
63
|
+
if (catchAll) {
|
|
64
|
+
if (!Array.isArray(value))
|
|
65
|
+
throw new Error(`PAGINAS.href: "${key}" deve ser string[] (catch-all)`);
|
|
66
|
+
return value.map((x) => encodeURIComponent(String(x))).join('/');
|
|
67
|
+
}
|
|
68
|
+
if (value == null)
|
|
69
|
+
throw new Error(`PAGINAS.href: "${key}" é obrigatório`);
|
|
70
|
+
return encodeURIComponent(String(value));
|
|
71
|
+
});
|
|
72
|
+
const cleaned = out.replace(/\/+/g, '/').replace(/\/$/, '');
|
|
73
|
+
return cleaned === '' ? '/' : cleaned;
|
|
74
|
+
}
|
|
75
|
+
function pagina(template, acesso) {
|
|
76
|
+
if (acesso == null)
|
|
77
|
+
return { template, href: template };
|
|
78
|
+
return { template, href: template, acesso };
|
|
79
|
+
}
|
|
80
|
+
function paginaDinamica(template, acesso) {
|
|
81
|
+
const href = (params) => montarHref(template, params);
|
|
82
|
+
if (acesso == null)
|
|
83
|
+
return { template, href };
|
|
84
|
+
return { template, href, acesso };
|
|
85
|
+
}
|
|
86
|
+
// @tipoCompartilhadoFront
|
|
52
87
|
const PAGINAS = {
|
|
53
|
-
home:
|
|
54
|
-
acessar:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
definicoes:
|
|
59
|
-
dicas:
|
|
88
|
+
home: pagina('/'),
|
|
89
|
+
acessar: pagina('/acessar'),
|
|
90
|
+
cadastrar: pagina('/cadastrar'),
|
|
91
|
+
aventura: paginaDinamica('/aventura/[id]'),
|
|
92
|
+
aventuras: pagina('/aventuras'),
|
|
93
|
+
definicoes: paginaDinamica('/definicoes/[[...slug]]'),
|
|
94
|
+
dicas: paginaDinamica('/dicas/[[...slug]]'),
|
|
60
95
|
jogo: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
emJogo: { href: '/jogo/em-jogo', acesso: { autenticado: true } },
|
|
96
|
+
...pagina('/jogo', { autenticado: true }),
|
|
97
|
+
jogador: pagina('/jogo/jogador', { autenticado: true }),
|
|
98
|
+
mestre: { sessoesMestre: pagina('/jogo/mestre/sessoes-mestre', { autenticado: true }) },
|
|
99
|
+
admin: { gerenciarSalas: pagina('/jogo/admin/gerenciar-salas', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }) },
|
|
100
|
+
emJogo: pagina('/jogo/em-jogo', { autenticado: true }),
|
|
67
101
|
},
|
|
68
|
-
linhaDoTempo:
|
|
69
|
-
minhaPagina:
|
|
102
|
+
linhaDoTempo: pagina('/linha-do-tempo'),
|
|
103
|
+
minhaPagina: pagina('/minha-pagina'),
|
|
70
104
|
minhasPaginas: {
|
|
71
105
|
admin: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
variaveisAmbiente: { href: '/minhas-paginas/admin/variaveis-ambiente', acesso: { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] } },
|
|
106
|
+
...pagina('/minhas-paginas/admin', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
107
|
+
aventura: paginaDinamica('/minhas-paginas/admin/aventura/[id]', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
108
|
+
aventuras: pagina('/minhas-paginas/admin/aventuras', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
109
|
+
dashboardWs: pagina('/minhas-paginas/admin/dashboard-ws', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
110
|
+
sessao: paginaDinamica('/minhas-paginas/admin/sessao/[id]', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
111
|
+
uploads: pagina('/minhas-paginas/admin/uploads', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
112
|
+
variaveisAmbiente: pagina('/minhas-paginas/admin/variaveis-ambiente', { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] }),
|
|
80
113
|
},
|
|
81
114
|
jogador: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
meusPersonagens: { href: '/minhas-paginas/jogador/meus-personagens', acesso: { autenticado: true } },
|
|
115
|
+
...pagina('/minhas-paginas/jogador', { autenticado: true }),
|
|
116
|
+
meusPersonagens: pagina('/minhas-paginas/jogador/meus-personagens', { autenticado: true }),
|
|
85
117
|
},
|
|
86
118
|
mestre: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
personagens: { href: '/minhas-paginas/mestre/personagens', acesso: { autenticado: true } },
|
|
119
|
+
...pagina('/minhas-paginas/mestre', { autenticado: true }),
|
|
120
|
+
aventura: paginaDinamica('/minhas-paginas/mestre/aventura/[id]', { autenticado: true }),
|
|
121
|
+
aventuras: pagina('/minhas-paginas/mestre/aventuras', { autenticado: true }),
|
|
122
|
+
personagens: pagina('/minhas-paginas/mestre/personagens', { autenticado: true }),
|
|
92
123
|
rascunhos: {
|
|
93
|
-
aventuras:
|
|
94
|
-
sessoesUnicas:
|
|
124
|
+
aventuras: pagina('/minhas-paginas/mestre/rascunhos/aventuras', { autenticado: true }),
|
|
125
|
+
sessoesUnicas: pagina('/minhas-paginas/mestre/rascunhos/sessoes-unicas', { autenticado: true }),
|
|
95
126
|
},
|
|
96
|
-
sessao:
|
|
127
|
+
sessao: paginaDinamica('/minhas-paginas/mestre/sessao/[id]', { autenticado: true }),
|
|
97
128
|
},
|
|
98
|
-
minhasDisponibilidades:
|
|
129
|
+
minhasDisponibilidades: pagina('/minhas-paginas/minhas-disponibilidades', { autenticado: true }),
|
|
99
130
|
},
|
|
100
|
-
personagens:
|
|
101
|
-
sessoes:
|
|
102
|
-
sessaoAovivo:
|
|
103
|
-
sessao:
|
|
131
|
+
personagens: pagina('/personagens', { autenticado: true }),
|
|
132
|
+
sessoes: pagina('/sessoes', { autenticado: true }),
|
|
133
|
+
sessaoAovivo: pagina('/sessao-aovivo', { autenticado: true }),
|
|
134
|
+
sessao: paginaDinamica('/sessao/[id]', { autenticado: true }),
|
|
104
135
|
};
|
|
105
|
-
const _check = PAGINAS;
|
|
106
136
|
function isWsErrorResponse(payload) { return !!payload && typeof payload === "object" && payload._wsErro === true; }
|
|
107
137
|
function isWsUnauthorizedErrorResponse(payload) { return isWsErrorResponse(payload) && payload.code === "UNAUTHORIZED"; }
|
|
108
138
|
function wsErro(mensagem, extra) { return { _wsErro: true, mensagem, ...(extra ?? {}) }; }
|
|
@@ -311,4 +341,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
311
341
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
312
342
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
313
343
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
314
|
-
export { CAPACIDADES, AuthSession, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante,
|
|
344
|
+
export { CAPACIDADES, AuthSession, SalaDeJogo_Tipo, SalaDeJogo_Estado, SalaDeJogo_TipoMestre, SalaDeJogo_TipoParticipante, montarHref, pagina, paginaDinamica, PAGINAS, isWsErrorResponse, isWsUnauthorizedErrorResponse, wsErro, wsUnauthorized, wsMap, wsChain, createGateway, EventosWebSocket, isRecord, getEmitDelivery, AventuraEstado, EstadoPendenciaPersonagem, EstadoPendenciaAdministrativaPersonagem, EstadoOcupacaoPersonagem, EstadoSessao, DiaDaSemana, obtemDiaDaSemanaPorExtensoPorDDS, CargoExibicaoUsuario, FormatoMomento, EstiloSessao, PathTokenPadrao, LISTA_CAPACIDADES, criarEventosFiltrados, Eventos_Envia, Eventos_Emite, Eventos_EnviaERecebe };
|