types-nora-api 0.0.208 → 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 +75 -226
- package/dist/classes.js +71 -36
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -776,252 +776,100 @@ type SalaDeJogoDto = {
|
|
|
776
776
|
mestre: SalaDeJogo_Mestre;
|
|
777
777
|
participantes: readonly SalaDeJogo_Participante[];
|
|
778
778
|
};
|
|
779
|
-
type
|
|
780
|
-
href: string;
|
|
781
|
-
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
|
-
|
|
796
|
-
};
|
|
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;
|
|
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
|
-
|
|
802
|
-
readonly
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
};
|
|
806
|
-
readonly cadastrar: {
|
|
807
|
-
readonly href: "/cadastrar";
|
|
808
|
-
readonly acesso: {};
|
|
809
|
-
};
|
|
810
|
-
readonly aventuras: {
|
|
811
|
-
readonly href: "/aventuras";
|
|
812
|
-
readonly acesso: {
|
|
813
|
-
readonly autenticado: true;
|
|
814
|
-
};
|
|
815
|
-
};
|
|
816
|
-
readonly aventura: {
|
|
817
|
-
readonly id: {
|
|
818
|
-
readonly href: "/aventura/[id]";
|
|
819
|
-
readonly acesso: {
|
|
820
|
-
readonly autenticado: true;
|
|
821
|
-
};
|
|
822
|
-
};
|
|
823
|
-
};
|
|
824
|
-
readonly sessoes: {
|
|
825
|
-
readonly href: "/sessoes";
|
|
826
|
-
readonly acesso: {
|
|
827
|
-
readonly autenticado: true;
|
|
828
|
-
};
|
|
829
|
-
};
|
|
830
|
-
readonly sessao: {
|
|
831
|
-
readonly id: {
|
|
832
|
-
readonly href: "/sessao/[id]";
|
|
833
|
-
readonly acesso: {
|
|
834
|
-
readonly autenticado: true;
|
|
835
|
-
};
|
|
836
|
-
};
|
|
837
|
-
};
|
|
838
|
-
readonly definicoes: {
|
|
839
|
-
readonly slug: {
|
|
840
|
-
readonly href: "/definicoes/[[...slug]]";
|
|
841
|
-
readonly acesso: {
|
|
842
|
-
readonly autenticado: true;
|
|
843
|
-
};
|
|
844
|
-
};
|
|
845
|
-
};
|
|
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]]">;
|
|
846
820
|
readonly jogo: {
|
|
847
|
-
readonly
|
|
848
|
-
readonly acesso: {
|
|
849
|
-
readonly autenticado: true;
|
|
850
|
-
};
|
|
851
|
-
readonly emJogo: {
|
|
852
|
-
readonly href: "/jogo/em-jogo";
|
|
853
|
-
readonly acesso: {
|
|
854
|
-
readonly autenticado: true;
|
|
855
|
-
};
|
|
856
|
-
};
|
|
857
|
-
readonly jogador: {
|
|
858
|
-
readonly href: "/jogo/jogador";
|
|
859
|
-
readonly acesso: {
|
|
860
|
-
readonly autenticado: true;
|
|
861
|
-
};
|
|
862
|
-
};
|
|
821
|
+
readonly jogador: PaginaEstatica<"/jogo/jogador">;
|
|
863
822
|
readonly mestre: {
|
|
864
|
-
readonly sessoesMestre:
|
|
865
|
-
readonly href: "/jogo/mestre/sessoes-mestre";
|
|
866
|
-
readonly acesso: {
|
|
867
|
-
readonly autenticado: true;
|
|
868
|
-
};
|
|
869
|
-
};
|
|
823
|
+
readonly sessoesMestre: PaginaEstatica<"/jogo/mestre/sessoes-mestre">;
|
|
870
824
|
};
|
|
871
825
|
readonly admin: {
|
|
872
|
-
readonly gerenciarSalas:
|
|
873
|
-
readonly href: "/jogo/admin/gerenciar-salas";
|
|
874
|
-
readonly acesso: {
|
|
875
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
876
|
-
};
|
|
877
|
-
};
|
|
826
|
+
readonly gerenciarSalas: PaginaEstatica<"/jogo/admin/gerenciar-salas">;
|
|
878
827
|
};
|
|
828
|
+
readonly emJogo: PaginaEstatica<"/jogo/em-jogo">;
|
|
829
|
+
readonly template: "/jogo";
|
|
830
|
+
readonly href: "/jogo";
|
|
831
|
+
readonly acesso?: AcessoPagina;
|
|
879
832
|
};
|
|
833
|
+
readonly linhaDoTempo: PaginaEstatica<"/linha-do-tempo">;
|
|
834
|
+
readonly minhaPagina: PaginaEstatica<"/minha-pagina">;
|
|
880
835
|
readonly minhasPaginas: {
|
|
881
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";
|
|
882
844
|
readonly href: "/minhas-paginas/admin";
|
|
883
|
-
readonly acesso
|
|
884
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
885
|
-
};
|
|
886
|
-
readonly uploads: {
|
|
887
|
-
readonly href: "/minhas-paginas/admin/uploads";
|
|
888
|
-
readonly acesso: {
|
|
889
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
890
|
-
};
|
|
891
|
-
};
|
|
892
|
-
readonly variaveisAmbiente: {
|
|
893
|
-
readonly href: "/minhas-paginas/admin/variaveis-ambiente";
|
|
894
|
-
readonly acesso: {
|
|
895
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
896
|
-
};
|
|
897
|
-
};
|
|
898
|
-
readonly dashboardWs: {
|
|
899
|
-
readonly href: "/minhas-paginas/admin/dashboard-ws";
|
|
900
|
-
readonly acesso: {
|
|
901
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
902
|
-
};
|
|
903
|
-
};
|
|
904
|
-
readonly sessao: {
|
|
905
|
-
readonly id: {
|
|
906
|
-
readonly href: "/minhas-paginas/admin/sessao/[id]";
|
|
907
|
-
readonly acesso: {
|
|
908
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
909
|
-
};
|
|
910
|
-
};
|
|
911
|
-
};
|
|
912
|
-
readonly aventura: {
|
|
913
|
-
readonly id: {
|
|
914
|
-
readonly href: "/minhas-paginas/admin/aventura/[id]";
|
|
915
|
-
readonly acesso: {
|
|
916
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
917
|
-
};
|
|
918
|
-
};
|
|
919
|
-
};
|
|
920
|
-
readonly aventuras: {
|
|
921
|
-
readonly href: "/minhas-paginas/admin/aventuras";
|
|
922
|
-
readonly acesso: {
|
|
923
|
-
readonly listaDeCapacidadesNecessarias: readonly ["ADMINISTRADOR.SUDO.BURLAR_CAPACIDADES"];
|
|
924
|
-
};
|
|
925
|
-
};
|
|
845
|
+
readonly acesso?: AcessoPagina;
|
|
926
846
|
};
|
|
927
847
|
readonly jogador: {
|
|
848
|
+
readonly meusPersonagens: PaginaEstatica<"/minhas-paginas/jogador/meus-personagens">;
|
|
849
|
+
readonly template: "/minhas-paginas/jogador";
|
|
928
850
|
readonly href: "/minhas-paginas/jogador";
|
|
929
|
-
readonly acesso
|
|
930
|
-
readonly autenticado: true;
|
|
931
|
-
};
|
|
932
|
-
readonly meusPersonagens: {
|
|
933
|
-
readonly href: "/minhas-paginas/jogador/meus-personagens";
|
|
934
|
-
readonly acesso: {
|
|
935
|
-
readonly autenticado: true;
|
|
936
|
-
};
|
|
937
|
-
};
|
|
851
|
+
readonly acesso?: AcessoPagina;
|
|
938
852
|
};
|
|
939
853
|
readonly mestre: {
|
|
940
|
-
readonly
|
|
941
|
-
readonly
|
|
942
|
-
|
|
943
|
-
};
|
|
944
|
-
readonly aventuras: {
|
|
945
|
-
readonly href: "/minhas-paginas/mestre/aventuras";
|
|
946
|
-
readonly acesso: {
|
|
947
|
-
readonly autenticado: true;
|
|
948
|
-
};
|
|
949
|
-
};
|
|
950
|
-
readonly personagens: {
|
|
951
|
-
readonly href: "/minhas-paginas/mestre/personagens";
|
|
952
|
-
readonly acesso: {
|
|
953
|
-
readonly autenticado: true;
|
|
954
|
-
};
|
|
955
|
-
};
|
|
956
|
-
readonly aventura: {
|
|
957
|
-
readonly id: {
|
|
958
|
-
readonly href: "/minhas-paginas/mestre/aventura/[id]";
|
|
959
|
-
readonly acesso: {
|
|
960
|
-
readonly autenticado: true;
|
|
961
|
-
};
|
|
962
|
-
};
|
|
963
|
-
};
|
|
964
|
-
readonly sessao: {
|
|
965
|
-
readonly id: {
|
|
966
|
-
readonly href: "/minhas-paginas/mestre/sessao/[id]";
|
|
967
|
-
readonly acesso: {
|
|
968
|
-
readonly autenticado: true;
|
|
969
|
-
};
|
|
970
|
-
};
|
|
971
|
-
};
|
|
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">;
|
|
972
857
|
readonly rascunhos: {
|
|
973
|
-
readonly aventuras:
|
|
974
|
-
|
|
975
|
-
readonly acesso: {
|
|
976
|
-
readonly autenticado: true;
|
|
977
|
-
};
|
|
978
|
-
};
|
|
979
|
-
readonly sessoesUnicas: {
|
|
980
|
-
readonly href: "/minhas-paginas/mestre/rascunhos/sessoes-unicas";
|
|
981
|
-
readonly acesso: {
|
|
982
|
-
readonly autenticado: true;
|
|
983
|
-
};
|
|
984
|
-
};
|
|
985
|
-
};
|
|
986
|
-
};
|
|
987
|
-
readonly minhasDisponibilidades: {
|
|
988
|
-
readonly href: "/minhas-paginas/minhas-disponibilidades";
|
|
989
|
-
readonly acesso: {
|
|
990
|
-
readonly autenticado: true;
|
|
858
|
+
readonly aventuras: PaginaEstatica<"/minhas-paginas/mestre/rascunhos/aventuras">;
|
|
859
|
+
readonly sessoesUnicas: PaginaEstatica<"/minhas-paginas/mestre/rascunhos/sessoes-unicas">;
|
|
991
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;
|
|
992
865
|
};
|
|
866
|
+
readonly minhasDisponibilidades: PaginaEstatica<"/minhas-paginas/minhas-disponibilidades">;
|
|
993
867
|
};
|
|
868
|
+
readonly personagens: PaginaEstatica<"/personagens">;
|
|
869
|
+
readonly sessoes: PaginaEstatica<"/sessoes">;
|
|
870
|
+
readonly sessaoAovivo: PaginaEstatica<"/sessao-aovivo">;
|
|
871
|
+
readonly sessao: PaginaDinamica<"/sessao/[id]">;
|
|
994
872
|
};
|
|
995
|
-
type PaginasTree<T> = T extends Record<string, any> ? 'href' extends keyof T ? T extends {
|
|
996
|
-
href: infer H;
|
|
997
|
-
} ? H extends string ? {
|
|
998
|
-
href: H;
|
|
999
|
-
acesso?: AcessoPagina;
|
|
1000
|
-
} & {
|
|
1001
|
-
[K in Exclude<keyof T, 'href' | 'acesso'>]: PaginasTree<T[K]>;
|
|
1002
|
-
} : never : never : {
|
|
1003
|
-
acesso?: AcessoPagina;
|
|
1004
|
-
} & {
|
|
1005
|
-
[K in Exclude<keyof T, 'acesso'>]: PaginasTree<T[K]>;
|
|
1006
|
-
} : never;
|
|
1007
|
-
type _Check = {
|
|
1008
|
-
[K in keyof typeof PAGINAS]: PaginasTree<(typeof PAGINAS)[K]>;
|
|
1009
|
-
};
|
|
1010
|
-
declare const _check: _Check;
|
|
1011
|
-
type PaginaHref = PaginaDef['href'];
|
|
1012
|
-
type PaginaObjeto<P extends PaginaDef = PaginaAtual> = keyof PaginaParams<P> extends never ? {
|
|
1013
|
-
pagina: P;
|
|
1014
|
-
} : {
|
|
1015
|
-
pagina: P;
|
|
1016
|
-
params: PaginaParams<P>;
|
|
1017
|
-
};
|
|
1018
|
-
type PaginaLeafUnion<T> = T extends {
|
|
1019
|
-
href: string;
|
|
1020
|
-
} ? T | PaginaLeafUnionChildren<T> : PaginaLeafUnionChildren<T>;
|
|
1021
|
-
type PaginaLeafUnionChildren<T> = T extends Record<string, any> ? {
|
|
1022
|
-
[K in Exclude<keyof T, 'href' | 'acesso'>]: PaginaLeafUnion<T[K]>;
|
|
1023
|
-
}[Exclude<keyof T, 'href' | 'acesso'>] : never;
|
|
1024
|
-
type PaginaAtual = PaginaLeafUnion<typeof PAGINAS>;
|
|
1025
873
|
interface MensagemChatRecebida {
|
|
1026
874
|
salaId: string;
|
|
1027
875
|
idUsuario: number;
|
|
@@ -1046,7 +894,7 @@ interface MensagemChatPayload {
|
|
|
1046
894
|
}
|
|
1047
895
|
type SOCKET_AcessoUsuario = {
|
|
1048
896
|
usuario: UsuarioDto;
|
|
1049
|
-
paginaAtual?:
|
|
897
|
+
paginaAtual?: PaginaTemplate | null;
|
|
1050
898
|
dataAtualizacao: Date;
|
|
1051
899
|
};
|
|
1052
900
|
type SOCKET_UsuarioExistente = {
|
|
@@ -1395,12 +1243,13 @@ type PermissaoItemMinimo = {
|
|
|
1395
1243
|
id: number;
|
|
1396
1244
|
} | null;
|
|
1397
1245
|
};
|
|
1398
|
-
type
|
|
1246
|
+
type ListaCapacidadesNecessarias = readonly [Capacidade, ...Capacidade[]];
|
|
1247
|
+
type AcessoPagina = {
|
|
1399
1248
|
autenticado: true;
|
|
1400
1249
|
listaDeCapacidadesNecessarias?: never;
|
|
1401
1250
|
} | {
|
|
1402
1251
|
autenticado?: never;
|
|
1403
|
-
listaDeCapacidadesNecessarias:
|
|
1252
|
+
listaDeCapacidadesNecessarias: ListaCapacidadesNecessarias;
|
|
1404
1253
|
};
|
|
1405
1254
|
type Gateways = typeof EventosWebSocket.gateways;
|
|
1406
1255
|
type EventoTipoLiteral = EventoTipo;
|
|
@@ -1573,4 +1422,4 @@ declare const Eventos_EnviaERecebe: {
|
|
|
1573
1422
|
};
|
|
1574
1423
|
};
|
|
1575
1424
|
};
|
|
1576
|
-
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,55 +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
|
-
cadastrar:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
definicoes: { slug: { href: '/definicoes/[[...slug]]', acesso: { autenticado: true } } },
|
|
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]]'),
|
|
61
95
|
jogo: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
admin: { gerenciarSalas: { href: '/jogo/admin/gerenciar-salas', acesso: { listaDeCapacidadesNecessarias: [CAPACIDADES.ADMINISTRADOR__SUDO__BURLAR_CAPACIDADES] } } },
|
|
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 }),
|
|
68
101
|
},
|
|
102
|
+
linhaDoTempo: pagina('/linha-do-tempo'),
|
|
103
|
+
minhaPagina: pagina('/minha-pagina'),
|
|
69
104
|
minhasPaginas: {
|
|
70
105
|
admin: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
aventuras: { href: '/minhas-paginas/admin/aventuras', 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] }),
|
|
79
113
|
},
|
|
80
114
|
jogador: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
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 }),
|
|
84
117
|
},
|
|
85
118
|
mestre: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
aventuras:
|
|
89
|
-
personagens:
|
|
90
|
-
aventura: { id: { href: '/minhas-paginas/mestre/aventura/[id]', acesso: { autenticado: true } } },
|
|
91
|
-
sessao: { id: { href: '/minhas-paginas/mestre/sessao/[id]', 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
|
},
|
|
127
|
+
sessao: paginaDinamica('/minhas-paginas/mestre/sessao/[id]', { autenticado: true }),
|
|
96
128
|
},
|
|
97
|
-
minhasDisponibilidades:
|
|
129
|
+
minhasDisponibilidades: pagina('/minhas-paginas/minhas-disponibilidades', { autenticado: true }),
|
|
98
130
|
},
|
|
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 }),
|
|
99
135
|
};
|
|
100
|
-
const _check = PAGINAS;
|
|
101
136
|
function isWsErrorResponse(payload) { return !!payload && typeof payload === "object" && payload._wsErro === true; }
|
|
102
137
|
function isWsUnauthorizedErrorResponse(payload) { return isWsErrorResponse(payload) && payload.code === "UNAUTHORIZED"; }
|
|
103
138
|
function wsErro(mensagem, extra) { return { _wsErro: true, mensagem, ...(extra ?? {}) }; }
|
|
@@ -306,4 +341,4 @@ function criarEventosFiltrados(tipo) {
|
|
|
306
341
|
const Eventos_Envia = criarEventosFiltrados('envia');
|
|
307
342
|
const Eventos_Emite = criarEventosFiltrados('emite');
|
|
308
343
|
const Eventos_EnviaERecebe = criarEventosFiltrados('envia-e-recebe');
|
|
309
|
-
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 };
|