7vsdk-pessoas 1.0.6 → 1.0.12
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/clients/base/CrudClientBase.d.ts +13 -0
- package/dist/clients/base/CrudClientBase.js +68 -0
- package/dist/clients/base/index.d.ts +1 -0
- package/dist/clients/base/index.js +17 -0
- package/dist/clients/enderecos/EnderecoBairroClient.d.ts +10 -0
- package/dist/clients/enderecos/EnderecoBairroClient.js +15 -0
- package/dist/clients/enderecos/EnderecoCidadeClient.d.ts +10 -0
- package/dist/clients/enderecos/EnderecoCidadeClient.js +15 -0
- package/dist/clients/enderecos/EnderecoSdk.d.ts +10 -0
- package/dist/clients/enderecos/EnderecoSdk.js +38 -0
- package/dist/clients/enderecos/UfClient.d.ts +5 -0
- package/dist/clients/enderecos/UfClient.js +10 -0
- package/dist/clients/enderecos/index.d.ts +1 -0
- package/dist/clients/enderecos/index.js +17 -0
- package/dist/clients/index.d.ts +3 -0
- package/dist/clients/index.js +19 -0
- package/dist/clients/pessoas/PessoaClient.d.ts +21 -0
- package/dist/clients/pessoas/PessoaClient.js +30 -0
- package/dist/clients/pessoas/PessoaCnpjClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaCnpjClient.js +10 -0
- package/dist/clients/pessoas/PessoaCpfClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaCpfClient.js +10 -0
- package/dist/clients/pessoas/PessoaEmailClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaEmailClient.js +10 -0
- package/dist/clients/pessoas/PessoaEnderecoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaEnderecoClient.js +10 -0
- package/dist/clients/pessoas/PessoaNascimentoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaNascimentoClient.js +10 -0
- package/dist/clients/pessoas/PessoaNecessidadeEspecial.d.ts +7 -0
- package/dist/clients/pessoas/PessoaNecessidadeEspecial.js +10 -0
- package/dist/clients/pessoas/PessoaProcedimentoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaProcedimentoClient.js +10 -0
- package/dist/clients/pessoas/PessoaRelacaoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaRelacaoClient.js +10 -0
- package/dist/clients/pessoas/PessoaRelacaoGrupoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaRelacaoGrupoClient.js +10 -0
- package/dist/clients/pessoas/PessoaRelacaoTipoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaRelacaoTipoClient.js +10 -0
- package/dist/clients/pessoas/PessoaTelefoneClient.d.ts +11 -0
- package/dist/clients/pessoas/PessoaTelefoneClient.js +15 -0
- package/dist/clients/pessoas/PessoaTipoClient.d.ts +7 -0
- package/dist/clients/pessoas/PessoaTipoClient.js +10 -0
- package/dist/clients/pessoas/index.d.ts +12 -0
- package/dist/clients/pessoas/index.js +28 -0
- package/dist/clients/portalContador/ImpostoEstadualSdk.d.ts +11 -0
- package/dist/clients/portalContador/ImpostoEstadualSdk.js +13 -0
- package/dist/clients/portalContador/ImpostoFederalSdk.d.ts +11 -0
- package/dist/clients/portalContador/ImpostoFederalSdk.js +16 -0
- package/dist/clients/portalContador/index.d.ts +1 -0
- package/dist/clients/portalContador/index.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.js +27 -0
- package/package.json +14 -16
- package/src/clients/base/CrudClientBase.ts +23 -3
- package/src/clients/enderecos/EnderecoBairroClient.ts +6 -5
- package/src/clients/enderecos/EnderecoCidadeClient.ts +9 -7
- package/src/clients/enderecos/EnderecoSdk.ts +53 -0
- package/src/clients/enderecos/UfClient.ts +6 -5
- package/src/clients/enderecos/index.ts +1 -5
- package/src/clients/index.ts +1 -2
- package/src/clients/pessoas/PessoaClient.ts +40 -4
- package/src/clients/portalContador/EmpresaSdk.ts +14 -0
- package/src/clients/portalContador/ImpostoEstadualSdk.ts +25 -0
- package/src/clients/portalContador/ImpostoFederalSdk.ts +27 -0
- package/tsconfig.json +5 -6
- package/tsconfig.tsbuildinfo +1 -0
- package/src/clients/enderecos/EnderecoClient.ts +0 -21
- package/src/clients/enderecos/EnderecoTipoClient.ts +0 -20
- package/src/clients/portalContador/empresaClient.ts +0 -37
- package/src/test.ts +0 -61
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare abstract class CrudClientBase<TRequest, TResponse> {
|
|
2
|
+
protected baseUrl: string;
|
|
3
|
+
protected endpointBase: string;
|
|
4
|
+
protected tokenJwt?: string;
|
|
5
|
+
constructor(baseUrl: string, endpoint: string, tokenJwt: string);
|
|
6
|
+
private get headers();
|
|
7
|
+
private handleResponse;
|
|
8
|
+
protected getAsync(id: number): Promise<TResponse>;
|
|
9
|
+
protected getPagedAsync(pageNumber?: number, pageSize?: number): Promise<TResponse[]>;
|
|
10
|
+
protected postAsync(request: TRequest): Promise<TResponse>;
|
|
11
|
+
protected updateAsync(id: number, newObject: TRequest): Promise<TResponse>;
|
|
12
|
+
protected deleteAsync(id: number): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CrudClientBase = void 0;
|
|
4
|
+
// essa classe base pode ser reutilizada para qualquer cliente CRUD
|
|
5
|
+
class CrudClientBase {
|
|
6
|
+
constructor(baseUrl, endpoint, tokenJwt) {
|
|
7
|
+
baseUrl = baseUrl.replace(/\/+$/, ""); // remove todas as barras do final
|
|
8
|
+
endpoint = "/" + endpoint.replace(/^\/+/, ""); // garante só uma barra no começo
|
|
9
|
+
this.baseUrl = baseUrl;
|
|
10
|
+
this.endpointBase = endpoint;
|
|
11
|
+
this.tokenJwt = tokenJwt;
|
|
12
|
+
}
|
|
13
|
+
// cabeçalhos comuns para todas as requisições
|
|
14
|
+
get headers() {
|
|
15
|
+
const h = { "Content-Type": "application/json" };
|
|
16
|
+
if (this.tokenJwt)
|
|
17
|
+
h["Authorization"] = `Bearer ${this.tokenJwt}`;
|
|
18
|
+
return h;
|
|
19
|
+
}
|
|
20
|
+
// método para tratar respostas e erros comuns
|
|
21
|
+
async handleResponse(res) {
|
|
22
|
+
if (!res.ok)
|
|
23
|
+
throw new Error(`HTTP ${res.status}: ${res.statusText}`);
|
|
24
|
+
const envelope = await res.json();
|
|
25
|
+
if (!envelope?.data)
|
|
26
|
+
throw new Error("Resposta inválida do servidor.");
|
|
27
|
+
return envelope.data;
|
|
28
|
+
}
|
|
29
|
+
// métodos CRUD genéricos
|
|
30
|
+
// OBS: perceba que eles são protegidos, ou seja, só podem ser chamados por classes derivadas
|
|
31
|
+
// não deve ser publico justamente porque eles acessam diretamente o endpoint base e são anêmicos
|
|
32
|
+
// as classes derivadas devem implementar métodos mais específicos
|
|
33
|
+
async getAsync(id) {
|
|
34
|
+
const res = await fetch(`${this.baseUrl}${this.endpointBase}/${id}`, { headers: this.headers });
|
|
35
|
+
return this.handleResponse(res);
|
|
36
|
+
}
|
|
37
|
+
async getPagedAsync(pageNumber = 1, pageSize = 25) {
|
|
38
|
+
const res = await fetch(`${this.baseUrl}${this.endpointBase}?pageNumber=${pageNumber}&pageSize=${pageSize}`, { headers: this.headers });
|
|
39
|
+
return this.handleResponse(res);
|
|
40
|
+
}
|
|
41
|
+
async postAsync(request) {
|
|
42
|
+
const res = await fetch(`${this.baseUrl}${this.endpointBase}`, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: this.headers,
|
|
45
|
+
body: JSON.stringify(request),
|
|
46
|
+
});
|
|
47
|
+
console.log("URL chamada:", `${this.baseUrl}${this.endpointBase}`);
|
|
48
|
+
console.log("BODY:", JSON.stringify(request));
|
|
49
|
+
return this.handleResponse(res);
|
|
50
|
+
}
|
|
51
|
+
async updateAsync(id, newObject) {
|
|
52
|
+
const res = await fetch(`${this.baseUrl}${this.endpointBase}/${id}`, {
|
|
53
|
+
method: "PUT",
|
|
54
|
+
headers: this.headers,
|
|
55
|
+
body: JSON.stringify(newObject),
|
|
56
|
+
});
|
|
57
|
+
return this.handleResponse(res);
|
|
58
|
+
}
|
|
59
|
+
async deleteAsync(id) {
|
|
60
|
+
const res = await fetch(`${this.baseUrl}${this.endpointBase}/${id}`, {
|
|
61
|
+
method: "DELETE",
|
|
62
|
+
headers: this.headers,
|
|
63
|
+
});
|
|
64
|
+
if (!res.ok)
|
|
65
|
+
throw new Error(`HTTP ${res.status}: ${res.statusText}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.CrudClientBase = CrudClientBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CrudClientBase";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CrudClientBase"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EnderecoBairroRequest, EnderecoBairroResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase";
|
|
3
|
+
interface IEnderecoBairroClient {
|
|
4
|
+
postarBairro(nome: string, cidadeId: number): Promise<EnderecoBairroResponse>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EnderecoBairroClient extends CrudClientBase<EnderecoBairroRequest, EnderecoBairroResponse> implements IEnderecoBairroClient {
|
|
7
|
+
constructor(Url: string, tokenJwt: string);
|
|
8
|
+
postarBairro(nome: string, cidadeId: number): Promise<EnderecoBairroResponse>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnderecoBairroClient = void 0;
|
|
4
|
+
const CrudClientBase_1 = require("../base/CrudClientBase");
|
|
5
|
+
class EnderecoBairroClient extends CrudClientBase_1.CrudClientBase {
|
|
6
|
+
constructor(Url, tokenJwt) {
|
|
7
|
+
super(Url, "api/endereco/bairro", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
async postarBairro(nome, cidadeId) {
|
|
10
|
+
const _req = { Nome: nome, CidadeId: cidadeId };
|
|
11
|
+
const response = await this.postAsync(_req);
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.EnderecoBairroClient = EnderecoBairroClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EnderecoCidadeRequest, EnderecoCidadeResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase";
|
|
3
|
+
interface IEnderecoCidadeClient {
|
|
4
|
+
postarEndereco(nome: string, codigoIbge: string, ufId: number): Promise<EnderecoCidadeResponse>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EnderecoCidadeClient extends CrudClientBase<EnderecoCidadeRequest, EnderecoCidadeResponse> implements IEnderecoCidadeClient {
|
|
7
|
+
constructor(Url: string, tokenJwt: string);
|
|
8
|
+
postarEndereco(nome: string, codigoIbge: string, ufId: number): Promise<EnderecoCidadeResponse>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnderecoCidadeClient = void 0;
|
|
4
|
+
const CrudClientBase_1 = require("../base/CrudClientBase");
|
|
5
|
+
class EnderecoCidadeClient extends CrudClientBase_1.CrudClientBase {
|
|
6
|
+
constructor(Url, tokenJwt) {
|
|
7
|
+
super(Url, "api/endereco/cidade", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
async postarEndereco(nome, codigoIbge, ufId) {
|
|
10
|
+
const _req = { Nome: nome, CodigoIbge: codigoIbge, UfId: ufId };
|
|
11
|
+
const response = await this.postAsync(_req);
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.EnderecoCidadeClient = EnderecoCidadeClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EnderecoCidadeRequest, EnderecoRequest, EnderecoResponse, EnderecoTipoEnum } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase";
|
|
3
|
+
interface IEnderecoSdk {
|
|
4
|
+
criarEndereco(enderecoCidade: EnderecoCidadeRequest, nomeBairro: string, nomeRua: string, enderecoTipo: EnderecoTipoEnum): Promise<EnderecoResponse>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EnderecoSdk extends CrudClientBase<EnderecoRequest, EnderecoResponse> implements IEnderecoSdk {
|
|
7
|
+
constructor(Url: string, tokenJwt: string);
|
|
8
|
+
criarEndereco(enderecoCidade: EnderecoCidadeRequest, nomeBairro: string, nomeRua: string, enderecoTipo: EnderecoTipoEnum): Promise<EnderecoResponse>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnderecoSdk = void 0;
|
|
4
|
+
const CrudClientBase_1 = require("../base/CrudClientBase");
|
|
5
|
+
const EnderecoBairroClient_1 = require("./EnderecoBairroClient");
|
|
6
|
+
const EnderecoCidadeClient_1 = require("./EnderecoCidadeClient");
|
|
7
|
+
class EnderecoSdk extends CrudClientBase_1.CrudClientBase {
|
|
8
|
+
constructor(Url, tokenJwt) {
|
|
9
|
+
super(Url, "api/endereco/bairro", tokenJwt);
|
|
10
|
+
}
|
|
11
|
+
async criarEndereco(enderecoCidade, nomeBairro, nomeRua, enderecoTipo) {
|
|
12
|
+
const cidade = {
|
|
13
|
+
UfId: enderecoCidade.UfId,
|
|
14
|
+
Nome: enderecoCidade.Nome,
|
|
15
|
+
CodigoIbge: enderecoCidade.CodigoIbge
|
|
16
|
+
};
|
|
17
|
+
const sendCidade = new EnderecoCidadeClient_1.EnderecoCidadeClient(this.baseUrl, this.tokenJwt);
|
|
18
|
+
// isso retornara um EnderecoCidadeResponse, que tem o Id necessario para criar o endereco
|
|
19
|
+
const cidadeResponse = await sendCidade.postarEndereco(cidade.Nome, cidade.CodigoIbge, cidade.UfId);
|
|
20
|
+
const bairro = {
|
|
21
|
+
CidadeId: cidadeResponse.CidadeId,
|
|
22
|
+
Nome: nomeBairro
|
|
23
|
+
};
|
|
24
|
+
console.log("cidadeResponse:", cidadeResponse);
|
|
25
|
+
console.log("keys:", Object.keys(cidadeResponse));
|
|
26
|
+
const sendBairro = new EnderecoBairroClient_1.EnderecoBairroClient(this.baseUrl, this.tokenJwt);
|
|
27
|
+
// isso retornara um EnderecoBairroResponse, que tem o Id necessario para criar o endereco
|
|
28
|
+
const bairroResponse = await sendBairro.postarBairro(bairro.Nome, bairro.CidadeId);
|
|
29
|
+
const endereco = {
|
|
30
|
+
BairroId: bairroResponse.EnderecoBairroId,
|
|
31
|
+
NomeRuaLogradouro: nomeRua,
|
|
32
|
+
};
|
|
33
|
+
// isso retornara um EnderecoResponse, que tem o Id necessario para criar o endereco
|
|
34
|
+
const enderecoResponse = await this.postAsync(endereco);
|
|
35
|
+
return enderecoResponse;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.EnderecoSdk = EnderecoSdk;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UfClient = void 0;
|
|
4
|
+
const _7vsdk_usuarios_1 = require("7vsdk-usuarios");
|
|
5
|
+
class UfClient extends _7vsdk_usuarios_1.CrudClientBase {
|
|
6
|
+
constructor(Url, tokenJwt) {
|
|
7
|
+
super(Url, "api/endereco/uf", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.UfClient = UfClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./EnderecoSdk";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./EnderecoSdk"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base"), exports);
|
|
18
|
+
__exportStar(require("./enderecos"), exports);
|
|
19
|
+
__exportStar(require("./pessoas"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EnderecoRequest, PessoaResponse, PessoaTelefoneRequest } from "7vdomain";
|
|
2
|
+
import { PessoaRequest } from "7vdomain";
|
|
3
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
4
|
+
interface IincluirClientes {
|
|
5
|
+
incluirClientePj(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string): any;
|
|
6
|
+
incluirClientePjCompleto(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string, enderecos: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): any;
|
|
7
|
+
incluirClientePf(cnpjPai: string, cpfFilho: string, nome: string): any;
|
|
8
|
+
incluirClientePfCompleto(cnpjPai: string, cpfFilho: string, nome: string, enderecos: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): any;
|
|
9
|
+
}
|
|
10
|
+
export declare class PessoaClient extends CrudClientBase<PessoaRequest, PessoaResponse> implements IincluirClientes {
|
|
11
|
+
constructor(urlServer: string, tokenJwt: string);
|
|
12
|
+
constructor(server: {
|
|
13
|
+
Url: string;
|
|
14
|
+
}, tokenJwt: string);
|
|
15
|
+
postarPessoa(nome: string, sexo: string): Promise<PessoaResponse>;
|
|
16
|
+
incluirClientePj(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string): Promise<void>;
|
|
17
|
+
incluirClientePjCompleto(cnpjPai: string, cnpjFilho: string, razaoSocialFilho: string, enderecos: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): Promise<void>;
|
|
18
|
+
incluirClientePf(cnpjPai: string, cpfFilho: string, nome: string): Promise<void>;
|
|
19
|
+
incluirClientePfCompleto(cnpjPai: string, cpfFilho: string, nome: string, enderecos: EnderecoRequest[], telefones: PessoaTelefoneRequest[]): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(urlOrServer, tokenJwt) {
|
|
7
|
+
if (typeof urlOrServer === 'string') {
|
|
8
|
+
super(urlOrServer, '/api/pessoa', tokenJwt);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
super(urlOrServer.Url, '/api/pessoa', tokenJwt);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async postarPessoa(nome, sexo) {
|
|
15
|
+
if (sexo !== "H" && sexo !== "M")
|
|
16
|
+
throw new Error("Sexo inválido");
|
|
17
|
+
const req = { Nome: nome, Sexo: sexo };
|
|
18
|
+
const res = await this.postAsync(req);
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
async incluirClientePj(cnpjPai, cnpjFilho, razaoSocialFilho) {
|
|
22
|
+
}
|
|
23
|
+
async incluirClientePjCompleto(cnpjPai, cnpjFilho, razaoSocialFilho, enderecos, telefones) {
|
|
24
|
+
}
|
|
25
|
+
async incluirClientePf(cnpjPai, cpfFilho, nome) {
|
|
26
|
+
}
|
|
27
|
+
async incluirClientePfCompleto(cnpjPai, cpfFilho, nome, enderecos, telefones) {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.PessoaClient = PessoaClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaCnpjRequest, PessoaCnpjResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaCnpjClient extends CrudClientBase<PessoaCnpjResponse, PessoaCnpjRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaCnpjClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaCnpjClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/cnpj", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaCnpjClient = PessoaCnpjClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaCpfRequest, PessoaCpfResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaCpfClient extends CrudClientBase<PessoaCpfResponse, PessoaCpfRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaCpfClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaCpfClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/cpf", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaCpfClient = PessoaCpfClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaEmailRequest, PessoaEmailResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaEmailClient extends CrudClientBase<PessoaEmailResponse, PessoaEmailRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaEmailClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaEmailClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/email", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaEmailClient = PessoaEmailClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaEnderecoRequest, PessoaEnderecoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaEnderecoClient extends CrudClientBase<PessoaEnderecoResponse, PessoaEnderecoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaEnderecoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaEnderecoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/endereco", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaEnderecoClient = PessoaEnderecoClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaNascimentoRequest, PessoaNascimentoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaNascimentoClient extends CrudClientBase<PessoaNascimentoResponse, PessoaNascimentoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaNascimentoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaNascimentoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/nascimento", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaNascimentoClient = PessoaNascimentoClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaNecessidadeEspecialRequest, PessoaNecessidadeEspecialResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaNecessidadeEspecialClient extends CrudClientBase<PessoaNecessidadeEspecialResponse, PessoaNecessidadeEspecialRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaNecessidadeEspecialClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaNecessidadeEspecialClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/necessidade-especial", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaNecessidadeEspecialClient = PessoaNecessidadeEspecialClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaProcedimentoRequest, PessoaProcedimentoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaProcedimentoClient extends CrudClientBase<PessoaProcedimentoResponse, PessoaProcedimentoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaProcedimentoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaProcedimentoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/procedimento", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaProcedimentoClient = PessoaProcedimentoClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaRelacaoRequest, PessoaRelacaoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaRelacaoClient extends CrudClientBase<PessoaRelacaoResponse, PessoaRelacaoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaRelacaoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaRelacaoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/relacao", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaRelacaoClient = PessoaRelacaoClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaRelacaoGrupoRequest, PessoaRelacaoGrupoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaRelacaoGrupoClient extends CrudClientBase<PessoaRelacaoGrupoResponse, PessoaRelacaoGrupoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaRelacaoGrupoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaRelacaoGrupoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/relacao/grupo", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaRelacaoGrupoClient = PessoaRelacaoGrupoClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaRelacaoRequest, PessoaRelacaoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaRelacaoTipoClient extends CrudClientBase<PessoaRelacaoResponse, PessoaRelacaoRequest> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaRelacaoTipoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaRelacaoTipoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "pessoa/relacao/tipo", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaRelacaoTipoClient = PessoaRelacaoTipoClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PessoaTelefoneRequest, PessoaTelefoneResponse } from "7vdomain";
|
|
2
|
+
import { TelefoneTipoEnum } from "7vdomain";
|
|
3
|
+
import { CrudClientBase } from "../base";
|
|
4
|
+
interface IPessoaTelefoneClient {
|
|
5
|
+
postarTelefone(numero: string, pessoaId: number, telefoneTipo: TelefoneTipoEnum): Promise<PessoaTelefoneResponse>;
|
|
6
|
+
}
|
|
7
|
+
export declare class PesosaTelefoneClient extends CrudClientBase<PessoaTelefoneRequest, PessoaTelefoneResponse> implements IPessoaTelefoneClient {
|
|
8
|
+
constructor(url: string, tok: string);
|
|
9
|
+
postarTelefone(numero: string, pessoaId: number, telefoneTipo: TelefoneTipoEnum): Promise<PessoaTelefoneResponse>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PesosaTelefoneClient = void 0;
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
class PesosaTelefoneClient extends base_1.CrudClientBase {
|
|
6
|
+
constructor(url, tok) {
|
|
7
|
+
super(url, "api/pessoa/telefone", tok);
|
|
8
|
+
}
|
|
9
|
+
async postarTelefone(numero, pessoaId, telefoneTipo) {
|
|
10
|
+
const _req = { Numero: numero, PessoaId: pessoaId, TelefoneTipoId: telefoneTipo };
|
|
11
|
+
const _res = await this.postAsync(_req);
|
|
12
|
+
return _res;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.PesosaTelefoneClient = PesosaTelefoneClient;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PessoaTipoRequest, PessoaTipoResponse } from "7vdomain";
|
|
2
|
+
import { CrudClientBase } from "../base/CrudClientBase.js";
|
|
3
|
+
export declare class PessoaTipoClient extends CrudClientBase<PessoaTipoRequest, PessoaTipoResponse> {
|
|
4
|
+
constructor(server: {
|
|
5
|
+
Url: string;
|
|
6
|
+
}, tokenJwt: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PessoaTipoClient = void 0;
|
|
4
|
+
const CrudClientBase_js_1 = require("../base/CrudClientBase.js");
|
|
5
|
+
class PessoaTipoClient extends CrudClientBase_js_1.CrudClientBase {
|
|
6
|
+
constructor(server, tokenJwt) {
|
|
7
|
+
super(server.Url, "api/pessoa/tipo", tokenJwt);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.PessoaTipoClient = PessoaTipoClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./PessoaClient";
|
|
2
|
+
export * from "./PessoaCnpjClient";
|
|
3
|
+
export * from "./PessoaCpfClient";
|
|
4
|
+
export * from "./PessoaEmailClient";
|
|
5
|
+
export * from "./PessoaEnderecoClient";
|
|
6
|
+
export * from "./PessoaNascimentoClient";
|
|
7
|
+
export * from "./PessoaNecessidadeEspecial";
|
|
8
|
+
export * from "./PessoaProcedimentoClient";
|
|
9
|
+
export * from "./PessoaRelacaoClient";
|
|
10
|
+
export * from "./PessoaRelacaoGrupoClient";
|
|
11
|
+
export * from "./PessoaRelacaoTipoClient";
|
|
12
|
+
export * from "./PessoaTipoClient";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PessoaClient"), exports);
|
|
18
|
+
__exportStar(require("./PessoaCnpjClient"), exports);
|
|
19
|
+
__exportStar(require("./PessoaCpfClient"), exports);
|
|
20
|
+
__exportStar(require("./PessoaEmailClient"), exports);
|
|
21
|
+
__exportStar(require("./PessoaEnderecoClient"), exports);
|
|
22
|
+
__exportStar(require("./PessoaNascimentoClient"), exports);
|
|
23
|
+
__exportStar(require("./PessoaNecessidadeEspecial"), exports);
|
|
24
|
+
__exportStar(require("./PessoaProcedimentoClient"), exports);
|
|
25
|
+
__exportStar(require("./PessoaRelacaoClient"), exports);
|
|
26
|
+
__exportStar(require("./PessoaRelacaoGrupoClient"), exports);
|
|
27
|
+
__exportStar(require("./PessoaRelacaoTipoClient"), exports);
|
|
28
|
+
__exportStar(require("./PessoaTipoClient"), exports);
|