types-nora-api 0.0.473 → 0.0.475

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.
@@ -1 +1,5 @@
1
- export {};
1
+ declare class TesteGraphqlSessaoDto {
2
+ id: number;
3
+ tituloSessao: string;
4
+ }
5
+ export { TesteGraphqlSessaoDto };
@@ -1,3 +1,7 @@
1
1
  // AUTO-GENERATED FILE - DO NOT EDIT
2
2
  // Contratos GraphQL
3
- export {};
3
+ class TesteGraphqlSessaoDto {
4
+ id;
5
+ tituloSessao;
6
+ }
7
+ export { TesteGraphqlSessaoDto };
@@ -1 +1,78 @@
1
- export {};
1
+ declare enum ApiTransporte {
2
+ GRAPHQL = "GRAPHQL",
3
+ REST = "REST"
4
+ }
5
+ declare enum ApiTipoRequisicao {
6
+ GET = "GET",
7
+ POST = "POST",
8
+ PATCH = "PATCH",
9
+ DELETE = "DELETE"
10
+ }
11
+ declare enum ApiMetodoHttp {
12
+ GET = "GET",
13
+ POST = "POST",
14
+ PATCH = "PATCH",
15
+ DELETE = "DELETE"
16
+ }
17
+ type ApiErroGraphql = {
18
+ message: string;
19
+ };
20
+ type ApiRespostaGraphql<TResposta extends object> = {
21
+ data?: TResposta;
22
+ errors?: ApiErroGraphql[];
23
+ };
24
+ type ApiOperacaoGraphqlGet<TParametros extends object, TVariaveis extends object, TResposta extends object> = {
25
+ readonly transporte: ApiTransporte.GRAPHQL;
26
+ readonly tipoRequisicao: ApiTipoRequisicao.GET;
27
+ readonly metodoHttp: ApiMetodoHttp.POST;
28
+ readonly nome: string;
29
+ readonly endpoint: '/graphql';
30
+ readonly nomeOperacaoGraphql: string;
31
+ readonly query: string;
32
+ readonly montaVariaveis: (parametros: TParametros) => TVariaveis;
33
+ };
34
+ type ApiOperacaoRestGet<TParametros extends object, TResposta extends object> = {
35
+ readonly transporte: ApiTransporte.REST;
36
+ readonly tipoRequisicao: ApiTipoRequisicao.GET;
37
+ readonly metodoHttp: ApiMetodoHttp.GET;
38
+ readonly nome: string;
39
+ readonly endpoint: string;
40
+ readonly montaQueryString: (parametros: TParametros) => string;
41
+ };
42
+ type ApiParametros<TOperacao> = TOperacao extends ApiOperacaoGraphqlGet<infer TParametros, infer _TVariaveis, infer _TResposta> ? TParametros : TOperacao extends ApiOperacaoRestGet<infer TParametros, infer _TResposta> ? TParametros : never;
43
+ type ApiResposta<TOperacao> = TOperacao extends ApiOperacaoGraphqlGet<infer _TParametros, infer _TVariaveis, infer TResposta> ? TResposta : TOperacao extends ApiOperacaoRestGet<infer _TParametros, infer TResposta> ? TResposta : never;
44
+ declare function createApiGraphqlGet<TParametros extends object, TVariaveis extends object, TResposta extends object>(definicao: ApiOperacaoGraphqlGet<TParametros, TVariaveis, TResposta>): ApiOperacaoGraphqlGet<TParametros, TVariaveis, TResposta>;
45
+ declare function createApiRestGet<TParametros extends object, TResposta extends object>(definicao: ApiOperacaoRestGet<TParametros, TResposta>): ApiOperacaoRestGet<TParametros, TResposta>;
46
+ type TesteGraphqlParametros = Record<string, never>;
47
+ type TesteGraphqlVariaveis = Record<string, never>;
48
+ type TesteGraphqlResposta = {
49
+ testeGraphql: string;
50
+ };
51
+ type TesteGraphqlSessaoParametros = {
52
+ idSessao: number;
53
+ };
54
+ type TesteGraphqlSessaoVariaveis = {
55
+ idSessao: number;
56
+ };
57
+ type TesteGraphqlSessaoResposta = {
58
+ testeGraphqlSessao: {
59
+ id: number;
60
+ tituloSessao: string;
61
+ };
62
+ };
63
+ type TesteRestParametros = Record<string, never>;
64
+ type TesteRestResposta = {
65
+ testeRest: string;
66
+ };
67
+ declare namespace EventosApi {
68
+ const GET: {
69
+ readonly Graphql: {
70
+ readonly testeGraphql: ApiOperacaoGraphqlGet<TesteGraphqlParametros, TesteGraphqlVariaveis, TesteGraphqlResposta>;
71
+ readonly testeGraphqlSessao: ApiOperacaoGraphqlGet<TesteGraphqlSessaoParametros, TesteGraphqlSessaoVariaveis, TesteGraphqlSessaoResposta>;
72
+ };
73
+ readonly Rest: {
74
+ readonly testeRest: ApiOperacaoRestGet<TesteRestParametros, TesteRestResposta>;
75
+ };
76
+ };
77
+ }
78
+ export { ApiErroGraphql, ApiMetodoHttp, ApiOperacaoGraphqlGet, ApiOperacaoRestGet, ApiParametros, ApiResposta, ApiRespostaGraphql, ApiTipoRequisicao, ApiTransporte, EventosApi, TesteGraphqlParametros, TesteGraphqlResposta, TesteGraphqlSessaoParametros, TesteGraphqlSessaoResposta, TesteGraphqlSessaoVariaveis, TesteGraphqlVariaveis, TesteRestParametros, TesteRestResposta, createApiGraphqlGet, createApiRestGet };
@@ -1,3 +1,71 @@
1
1
  // AUTO-GENERATED FILE - DO NOT EDIT
2
2
  // Contratos REST
3
- export {};
3
+ var ApiTransporte;
4
+ (function (ApiTransporte) {
5
+ ApiTransporte["GRAPHQL"] = "GRAPHQL";
6
+ ApiTransporte["REST"] = "REST";
7
+ })(ApiTransporte || (ApiTransporte = {}));
8
+ var ApiTipoRequisicao;
9
+ (function (ApiTipoRequisicao) {
10
+ ApiTipoRequisicao["GET"] = "GET";
11
+ ApiTipoRequisicao["POST"] = "POST";
12
+ ApiTipoRequisicao["PATCH"] = "PATCH";
13
+ ApiTipoRequisicao["DELETE"] = "DELETE";
14
+ })(ApiTipoRequisicao || (ApiTipoRequisicao = {}));
15
+ var ApiMetodoHttp;
16
+ (function (ApiMetodoHttp) {
17
+ ApiMetodoHttp["GET"] = "GET";
18
+ ApiMetodoHttp["POST"] = "POST";
19
+ ApiMetodoHttp["PATCH"] = "PATCH";
20
+ ApiMetodoHttp["DELETE"] = "DELETE";
21
+ })(ApiMetodoHttp || (ApiMetodoHttp = {}));
22
+ function createApiGraphqlGet(definicao) { return definicao; }
23
+ function createApiRestGet(definicao) { return definicao; }
24
+ var EventosApi;
25
+ (function (EventosApi) {
26
+ const Graphql = {
27
+ testeGraphql: createApiGraphqlGet({
28
+ transporte: ApiTransporte.GRAPHQL,
29
+ tipoRequisicao: ApiTipoRequisicao.GET,
30
+ metodoHttp: ApiMetodoHttp.POST,
31
+ nome: 'testeGraphql',
32
+ endpoint: '/graphql',
33
+ nomeOperacaoGraphql: 'TesteGraphql',
34
+ query: `
35
+ query TesteGraphql {
36
+ testeGraphql
37
+ }
38
+ `,
39
+ montaVariaveis: () => ({}),
40
+ }),
41
+ testeGraphqlSessao: createApiGraphqlGet({
42
+ transporte: ApiTransporte.GRAPHQL,
43
+ tipoRequisicao: ApiTipoRequisicao.GET,
44
+ metodoHttp: ApiMetodoHttp.POST,
45
+ nome: 'testeGraphqlSessao',
46
+ endpoint: '/graphql',
47
+ nomeOperacaoGraphql: 'TesteGraphqlSessao',
48
+ query: `
49
+ query TesteGraphqlSessao($idSessao: Int!) {
50
+ testeGraphqlSessao(idSessao: $idSessao) {
51
+ id
52
+ tituloSessao
53
+ }
54
+ }
55
+ `,
56
+ montaVariaveis: parametros => ({ idSessao: parametros.idSessao }),
57
+ }),
58
+ };
59
+ const Rest = {
60
+ testeRest: createApiRestGet({
61
+ transporte: ApiTransporte.REST,
62
+ tipoRequisicao: ApiTipoRequisicao.GET,
63
+ metodoHttp: ApiMetodoHttp.GET,
64
+ nome: 'testeRest',
65
+ endpoint: '/api/teste/rest',
66
+ montaQueryString: () => '',
67
+ }),
68
+ };
69
+ EventosApi.GET = { Graphql, Rest };
70
+ })(EventosApi || (EventosApi = {}));
71
+ export { ApiMetodoHttp, ApiTipoRequisicao, ApiTransporte, EventosApi, createApiGraphqlGet, createApiRestGet };