sgp-sdk 0.0.0-stage → 1.2.0
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/LICENSE +21 -0
- package/README.md +303 -2
- package/dist/client.d.ts +228 -0
- package/dist/endpoint.d.ts +66 -0
- package/dist/endpoints/crm/address.d.ts +20 -0
- package/dist/endpoints/crm/create-contract.d.ts +109 -0
- package/dist/endpoints/crm/create-customer.d.ts +65 -0
- package/dist/endpoints/crm/update-customer-status.d.ts +43 -0
- package/dist/endpoints/os/list-occurrence-reasons.d.ts +24 -0
- package/dist/endpoints/os/list-occurrence-types.d.ts +25 -0
- package/dist/endpoints/precadastro/list-due-days.d.ts +19 -0
- package/dist/endpoints/precadastro/list-sellers.d.ts +21 -0
- package/dist/endpoints/suporte/add-customer-document.d.ts +24 -0
- package/dist/endpoints/suporte/list-customer-documents.d.ts +25 -0
- package/dist/endpoints/ura/check-coverage.d.ts +46 -0
- package/dist/endpoints/ura/list-annotations.d.ts +32 -0
- package/dist/endpoints/ura/list-clients.d.ts +58 -0
- package/dist/endpoints/ura/list-contracts.d.ts +45 -0
- package/dist/endpoints/ura/list-invoices.d.ts +107 -0
- package/dist/endpoints/ura/list-nas.d.ts +29 -0
- package/dist/endpoints/ura/list-occurrence-methods.d.ts +19 -0
- package/dist/endpoints/ura/list-payment-carriers.d.ts +20 -0
- package/dist/endpoints/ura/list-plans.d.ts +70 -0
- package/dist/endpoints/ura/list-pops.d.ts +19 -0
- package/dist/endpoints/ura/list-service-orders.d.ts +64 -0
- package/dist/endpoints/ura/lookup-customer.d.ts +121 -0
- package/dist/endpoints/ura/open-ticket.d.ts +81 -0
- package/dist/errors.d.ts +59 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +1449 -0
- package/dist/result.d.ts +55 -0
- package/dist/schema/parse.d.ts +19 -0
- package/dist/schema/paths.d.ts +38 -0
- package/dist/sensitivity.d.ts +7 -0
- package/dist/transport.d.ts +65 -0
- package/package.json +34 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
import type { ParamValue } from "../../transport.js";
|
|
4
|
+
import { type SgpAddress } from "./address.js";
|
|
5
|
+
/** SGP's billing methods, by the `forma_cobranca_codigo` it takes. */
|
|
6
|
+
export declare const formaCobrancaCodigo: {
|
|
7
|
+
readonly boleto: 1;
|
|
8
|
+
readonly debitoAutomatico: 2;
|
|
9
|
+
readonly carne: 3;
|
|
10
|
+
readonly cobrancaRecorrente: 4;
|
|
11
|
+
readonly pix: 6;
|
|
12
|
+
};
|
|
13
|
+
/** A valid `forma_cobranca_codigo` of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
14
|
+
export type FormaCobrancaCodigo = (typeof formaCobrancaCodigo)[keyof typeof formaCobrancaCodigo];
|
|
15
|
+
/**
|
|
16
|
+
* SGP's equipment acquisition modes, by the `modoaquisicao` it takes: 0 Próprio and 1 Comodato.
|
|
17
|
+
* SGP rejects any other value (2 included), although its Postman collection lists 1 and 2.
|
|
18
|
+
*/
|
|
19
|
+
export declare const modoAquisicao: {
|
|
20
|
+
readonly proprio: 0;
|
|
21
|
+
readonly comodato: 1;
|
|
22
|
+
};
|
|
23
|
+
/** A valid `modoaquisicao` of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
24
|
+
export type ModoAquisicao = (typeof modoAquisicao)[keyof typeof modoAquisicao];
|
|
25
|
+
/**
|
|
26
|
+
* Success body of `POST /api/crm/cliente/{cliente_id}/contratos/`: the new contract ID, SGP's
|
|
27
|
+
* message and the customer's name.
|
|
28
|
+
*/
|
|
29
|
+
export declare const createContractSchema: z.ZodObject<{
|
|
30
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
clientecontrato: z.ZodNumber;
|
|
32
|
+
cliente: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
/** Key fields of `crm/cliente/{cliente_id}/contratos/`: required and strict; a 2xx without them is not a success. */
|
|
35
|
+
export declare const createContractKeyFields: readonly ["clientecontrato"];
|
|
36
|
+
/** Normalized path of the created contract in the response (the root object). */
|
|
37
|
+
export declare const contractCreatedItemPath = "";
|
|
38
|
+
/** Keys of the response holding secrets (none in `crm/cliente/{cliente_id}/contratos/`). */
|
|
39
|
+
export declare const contractCreatedSecretKeys: readonly [];
|
|
40
|
+
/** Keys of the response holding personal data: `cliente` is the customer's name. */
|
|
41
|
+
export declare const contractCreatedPersonalKeys: readonly ["cliente"];
|
|
42
|
+
/** Parsed response of `POST /api/crm/cliente/{cliente_id}/contratos/`. */
|
|
43
|
+
export type CreateContractResponse = z.output<typeof createContractSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Params of `POST /api/crm/cliente/{cliente_id}/contratos/`; `cliente_id` goes in the path.
|
|
46
|
+
* `login`, `senha`, `central_login`, `central_senha`, the addresses and the network fields
|
|
47
|
+
* (`ip`, `mac`, `mac_dhcp`) are secret or personal data.
|
|
48
|
+
*/
|
|
49
|
+
export interface CreateContractParams {
|
|
50
|
+
pop_id: number;
|
|
51
|
+
plano_id: number;
|
|
52
|
+
/** Payer or financial responsible. */
|
|
53
|
+
portador_id: number;
|
|
54
|
+
forma_cobranca_codigo: FormaCobrancaCodigo;
|
|
55
|
+
/** Due day registered in SGP. */
|
|
56
|
+
vencimento_dia: number;
|
|
57
|
+
/** Sent nested and also as the loose fields (`logradouro`, `numero`, ...) SGP reads. */
|
|
58
|
+
endereco_instalacao: SgpAddress;
|
|
59
|
+
endereco_cobranca: SgpAddress;
|
|
60
|
+
/** PPPoE login and password: SGP requires them for an internet service. */
|
|
61
|
+
login?: string;
|
|
62
|
+
senha?: string;
|
|
63
|
+
modoaquisicao?: ModoAquisicao;
|
|
64
|
+
/** Name of the NAS. */
|
|
65
|
+
nas?: string;
|
|
66
|
+
/** Exempt percentage. */
|
|
67
|
+
isento?: number;
|
|
68
|
+
autocobranca?: boolean;
|
|
69
|
+
servicodesc?: string;
|
|
70
|
+
observacao?: string;
|
|
71
|
+
vendedor_id?: number;
|
|
72
|
+
/** 1 = percentage, 2 = fixed amount. */
|
|
73
|
+
comissao_tipo?: 1 | 2;
|
|
74
|
+
comissao?: number;
|
|
75
|
+
/** Contract group for printing. */
|
|
76
|
+
contrato_id?: number;
|
|
77
|
+
fidelidade_id?: number;
|
|
78
|
+
midia_id?: number;
|
|
79
|
+
central_login?: string;
|
|
80
|
+
central_senha?: string;
|
|
81
|
+
ip?: string;
|
|
82
|
+
ippool_id?: number;
|
|
83
|
+
mac_dhcp?: string;
|
|
84
|
+
mac?: string;
|
|
85
|
+
logins_simult?: number;
|
|
86
|
+
splitter_id?: number;
|
|
87
|
+
splitter_port?: number;
|
|
88
|
+
tipo_equipamento?: string;
|
|
89
|
+
usuarioalt_id?: number;
|
|
90
|
+
/** Opens the installation service order, without a date. */
|
|
91
|
+
os_instalacao?: boolean;
|
|
92
|
+
/** Text of the installation occurrence. */
|
|
93
|
+
conteudo?: string;
|
|
94
|
+
instalacao_quantidade_parcelas?: number;
|
|
95
|
+
instalacao_preco?: number;
|
|
96
|
+
instalacao_desconto?: number;
|
|
97
|
+
instalacao_entrada?: number;
|
|
98
|
+
instalacao_entrada_forma?: number;
|
|
99
|
+
instalacao_parcela_forma?: number;
|
|
100
|
+
instalacao_portador?: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Request body of the contract route: the params, with both addresses nested and the installation
|
|
104
|
+
* one also as loose fields beside them (SGP describes those as "installation and billing").
|
|
105
|
+
* `undefined` address keys are omitted in both formats.
|
|
106
|
+
*/
|
|
107
|
+
export declare const toContractBody: (params: CreateContractParams) => Record<string, ParamValue | undefined>;
|
|
108
|
+
/** Definition of `POST /api/crm/cliente/{cliente_id}/contratos/` (trailing slash required by the token whitelist). */
|
|
109
|
+
export declare const createContractDefinition: WriteEndpointDefinition<typeof createContractSchema>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
import type { ParamValue } from "../../transport.js";
|
|
4
|
+
import { type SgpAddress } from "./address.js";
|
|
5
|
+
/** Success body of `POST /api/crm/cliente/{F|J}`: the new CRM customer ID and SGP's message. */
|
|
6
|
+
export declare const createCustomerSchema: z.ZodObject<{
|
|
7
|
+
cliente_id: z.ZodNumber;
|
|
8
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/** Key fields of `crm/cliente/{F|J}`: required and strict; a 2xx without them is not a success. */
|
|
11
|
+
export declare const createCustomerKeyFields: readonly ["cliente_id"];
|
|
12
|
+
/** Normalized path of the created customer in the response (the root object). */
|
|
13
|
+
export declare const customerCreatedItemPath = "";
|
|
14
|
+
/** Keys of the response holding secrets (none in `crm/cliente/{F|J}`). */
|
|
15
|
+
export declare const customerCreatedSecretKeys: readonly [];
|
|
16
|
+
/** Keys of the response holding personal data: SGP's message carries the name and CPF/CNPJ. */
|
|
17
|
+
export declare const customerCreatedPersonalKeys: readonly ["message"];
|
|
18
|
+
/** Parsed response of `POST /api/crm/cliente/F` and `POST /api/crm/cliente/J`. */
|
|
19
|
+
export type CreateCustomerResponse = z.output<typeof createCustomerSchema>;
|
|
20
|
+
/** Params of `POST /api/crm/cliente/F` (individual). Name, CPF and address are personal data. */
|
|
21
|
+
export interface CreateIndividualCustomerParams {
|
|
22
|
+
nome: string;
|
|
23
|
+
cpfcnpj: string;
|
|
24
|
+
endereco: SgpAddress;
|
|
25
|
+
email?: string;
|
|
26
|
+
celular?: string;
|
|
27
|
+
/** `"DD/MM/AAAA"`. */
|
|
28
|
+
datanasc?: string;
|
|
29
|
+
observacao?: string;
|
|
30
|
+
rg?: string;
|
|
31
|
+
rg_emissor?: string;
|
|
32
|
+
sexo?: "M" | "F";
|
|
33
|
+
/** C = married, S = single, V = widowed, D = divorced. */
|
|
34
|
+
estadocivil?: "C" | "S" | "V" | "D";
|
|
35
|
+
nomemae?: string;
|
|
36
|
+
nomepai?: string;
|
|
37
|
+
profissao?: string;
|
|
38
|
+
nacionalidade?: string;
|
|
39
|
+
naturalidade?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Params of `POST /api/crm/cliente/J` (company). Name, CNPJ and address are personal data. */
|
|
42
|
+
export interface CreateCompanyCustomerParams {
|
|
43
|
+
nome: string;
|
|
44
|
+
cpfcnpj: string;
|
|
45
|
+
endereco: SgpAddress;
|
|
46
|
+
nomefantasia?: string;
|
|
47
|
+
respempresa?: string;
|
|
48
|
+
respcpf?: string;
|
|
49
|
+
insc_estadual?: string;
|
|
50
|
+
insc_municipal?: string;
|
|
51
|
+
email?: string;
|
|
52
|
+
celular?: string;
|
|
53
|
+
/** `"DD/MM/AAAA"`. */
|
|
54
|
+
datafundacao?: string;
|
|
55
|
+
observacao?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Request body of the customer routes: the params, with the address nested (`endereco`) and also
|
|
59
|
+
* as loose fields beside them, as SGP reads both. `undefined` address keys are omitted in both.
|
|
60
|
+
*/
|
|
61
|
+
export declare const toCustomerBody: (params: CreateIndividualCustomerParams | CreateCompanyCustomerParams) => Record<string, ParamValue | undefined>;
|
|
62
|
+
/** Definition of `POST /api/crm/cliente/F` (individual customer). */
|
|
63
|
+
export declare const createIndividualCustomerDefinition: WriteEndpointDefinition<typeof createCustomerSchema>;
|
|
64
|
+
/** Definition of `POST /api/crm/cliente/J` (company customer). */
|
|
65
|
+
export declare const createCompanyCustomerDefinition: WriteEndpointDefinition<typeof createCustomerSchema>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** SGP's CRM statuses, by the `status_id` it takes. */
|
|
4
|
+
export declare const crmStatus: {
|
|
5
|
+
readonly emAnalise: 1;
|
|
6
|
+
readonly aprovado: 2;
|
|
7
|
+
readonly reprovado: 3;
|
|
8
|
+
readonly aguardandoContato: 4;
|
|
9
|
+
readonly tentandoContato: 5;
|
|
10
|
+
readonly contratoRealizadoNoSgp: 6;
|
|
11
|
+
readonly inviabilidadeTecnica: 7;
|
|
12
|
+
readonly contratoEmProspeccao: 8;
|
|
13
|
+
readonly reprovadoSpcSerasa: 9;
|
|
14
|
+
readonly analiseViabilidadeTecnica: 10;
|
|
15
|
+
};
|
|
16
|
+
/** A valid `status_id` of `POST /api/crm/cliente/{cliente_id}/status/`. */
|
|
17
|
+
export type CrmStatusId = (typeof crmStatus)[keyof typeof crmStatus];
|
|
18
|
+
/** Success body of `POST /api/crm/cliente/{cliente_id}/status/`: the customer and the status now set. */
|
|
19
|
+
export declare const updateCustomerStatusSchema: z.ZodObject<{
|
|
20
|
+
cliente_id: z.ZodNumber;
|
|
21
|
+
message: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
+
novo_status: z.ZodObject<{
|
|
23
|
+
codigo: z.ZodNumber;
|
|
24
|
+
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/** Key fields of `crm/cliente/{cliente_id}/status/`: required and strict; a 2xx without them is not a success. */
|
|
28
|
+
export declare const updateCustomerStatusKeyFields: readonly ["cliente_id", "novo_status.codigo"];
|
|
29
|
+
/** Normalized path of the updated customer in the response (the root object). */
|
|
30
|
+
export declare const customerStatusItemPath = "";
|
|
31
|
+
/** Keys of the response holding secrets (none in `crm/cliente/{cliente_id}/status/`). */
|
|
32
|
+
export declare const customerStatusSecretKeys: readonly [];
|
|
33
|
+
/** Keys of the response holding personal data: SGP's message carries the customer's name. */
|
|
34
|
+
export declare const customerStatusPersonalKeys: readonly ["message"];
|
|
35
|
+
/** Parsed response of `POST /api/crm/cliente/{cliente_id}/status/`. */
|
|
36
|
+
export type UpdateCustomerStatusResponse = z.output<typeof updateCustomerStatusSchema>;
|
|
37
|
+
/** Params of `POST /api/crm/cliente/{cliente_id}/status/`; `cliente_id` goes in the path. */
|
|
38
|
+
export interface UpdateCustomerStatusParams {
|
|
39
|
+
status_id: CrmStatusId;
|
|
40
|
+
motivo?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Definition of `POST /api/crm/cliente/{cliente_id}/status/` (trailing slash required by the token whitelist). */
|
|
43
|
+
export declare const updateCustomerStatusDefinition: WriteEndpointDefinition<typeof updateCustomerStatusSchema>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `GET /api/os/ocorrencia/motivo/list/`: a bare array with the occurrence reasons. */
|
|
4
|
+
export declare const listOccurrenceReasonsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
codigo: z.ZodNumber;
|
|
7
|
+
descricao: z.ZodString;
|
|
8
|
+
ativo: z.ZodBoolean;
|
|
9
|
+
classificacoes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
10
|
+
classificacoes_obrigatorio: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
setores: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
/** Key fields of `os/ocorrencia/motivo/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
14
|
+
export declare const listOccurrenceReasonsKeyFields: readonly ["[].id", "[].codigo", "[].descricao", "[].ativo"];
|
|
15
|
+
/** Normalized path of each reason in the `os/ocorrencia/motivo/list` response (the root array). */
|
|
16
|
+
export declare const occurrenceReasonItemPath = "[]";
|
|
17
|
+
/** Keys of an occurrence reason holding secrets (none in `os/ocorrencia/motivo/list`). */
|
|
18
|
+
export declare const occurrenceReasonSecretKeys: readonly [];
|
|
19
|
+
/** Keys of an occurrence reason holding personal data (none in `os/ocorrencia/motivo/list`). */
|
|
20
|
+
export declare const occurrenceReasonPersonalKeys: readonly [];
|
|
21
|
+
/** Parsed response of `GET /api/os/ocorrencia/motivo/list/`. */
|
|
22
|
+
export type ListOccurrenceReasonsResponse = z.output<typeof listOccurrenceReasonsSchema>;
|
|
23
|
+
/** Definition of `GET /api/os/ocorrencia/motivo/list/`. */
|
|
24
|
+
export declare const listOccurrenceReasonsDefinition: EndpointDefinition<typeof listOccurrenceReasonsSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `GET /api/os/ocorrencia/tipo/list/`: a bare array with the occurrence types. */
|
|
4
|
+
export declare const listOccurrenceTypesSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
codigo: z.ZodNumber;
|
|
7
|
+
descricao: z.ZodString;
|
|
8
|
+
ativo: z.ZodBoolean;
|
|
9
|
+
classificacoes: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
10
|
+
classificacoes_obrigatorio: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
setores: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
12
|
+
classificacoes_obrigatorio_encerramento: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
/** Key fields of `os/ocorrencia/tipo/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
15
|
+
export declare const listOccurrenceTypesKeyFields: readonly ["[].id", "[].codigo", "[].descricao", "[].ativo"];
|
|
16
|
+
/** Normalized path of each type in the `os/ocorrencia/tipo/list` response (the root array). */
|
|
17
|
+
export declare const occurrenceTypeItemPath = "[]";
|
|
18
|
+
/** Keys of an occurrence type holding secrets (none in `os/ocorrencia/tipo/list`). */
|
|
19
|
+
export declare const occurrenceTypeSecretKeys: readonly [];
|
|
20
|
+
/** Keys of an occurrence type holding personal data (none in `os/ocorrencia/tipo/list`). */
|
|
21
|
+
export declare const occurrenceTypePersonalKeys: readonly [];
|
|
22
|
+
/** Parsed response of `GET /api/os/ocorrencia/tipo/list/`. */
|
|
23
|
+
export type ListOccurrenceTypesResponse = z.output<typeof listOccurrenceTypesSchema>;
|
|
24
|
+
/** Definition of `GET /api/os/ocorrencia/tipo/list/`. */
|
|
25
|
+
export declare const listOccurrenceTypesDefinition: EndpointDefinition<typeof listOccurrenceTypesSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `POST /api/precadastro/vencimento/list`: a bare array with the due days. */
|
|
4
|
+
export declare const listDueDaysSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
dia: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
/** Key fields of `precadastro/vencimento/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
9
|
+
export declare const listDueDaysKeyFields: readonly ["[].id", "[].dia"];
|
|
10
|
+
/** Normalized path of each due day in the `precadastro/vencimento/list` response (the root array). */
|
|
11
|
+
export declare const dueDayItemPath = "[]";
|
|
12
|
+
/** Keys of a due day holding secrets (none in `precadastro/vencimento/list`). */
|
|
13
|
+
export declare const dueDaySecretKeys: readonly [];
|
|
14
|
+
/** Keys of a due day holding personal data (none in `precadastro/vencimento/list`). */
|
|
15
|
+
export declare const dueDayPersonalKeys: readonly [];
|
|
16
|
+
/** Parsed response of `POST /api/precadastro/vencimento/list`. */
|
|
17
|
+
export type ListDueDaysResponse = z.output<typeof listDueDaysSchema>;
|
|
18
|
+
/** Definition of `POST /api/precadastro/vencimento/list` (no trailing slash). */
|
|
19
|
+
export declare const listDueDaysDefinition: EndpointDefinition<typeof listDueDaysSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `POST /api/precadastro/vendedor/list`: a bare array with the sellers. */
|
|
4
|
+
export declare const listSellersSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
nome: z.ZodString;
|
|
7
|
+
cpf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
/** Key fields of `precadastro/vendedor/list`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
11
|
+
export declare const listSellersKeyFields: readonly ["[].id", "[].nome"];
|
|
12
|
+
/** Normalized path of each seller in the `precadastro/vendedor/list` response (the root array). */
|
|
13
|
+
export declare const sellerItemPath = "[]";
|
|
14
|
+
/** Keys of a seller holding secrets (none in `precadastro/vendedor/list`). */
|
|
15
|
+
export declare const sellerSecretKeys: readonly [];
|
|
16
|
+
/** Keys of a seller holding personal data: sellers are employees, so name, CPF and e-mail are personal. */
|
|
17
|
+
export declare const sellerPersonalKeys: readonly ["nome", "cpf", "email"];
|
|
18
|
+
/** Parsed response of `POST /api/precadastro/vendedor/list`. */
|
|
19
|
+
export type ListSellersResponse = z.output<typeof listSellersSchema>;
|
|
20
|
+
/** Definition of `POST /api/precadastro/vendedor/list` (no trailing slash). */
|
|
21
|
+
export declare const listSellersDefinition: EndpointDefinition<typeof listSellersSchema>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { WriteEndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/**
|
|
4
|
+
* Success body of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`: none. SGP answers 200 with
|
|
5
|
+
* an empty body, which the transport yields as `null`; anything else is not a confirmed success.
|
|
6
|
+
*/
|
|
7
|
+
export declare const addCustomerDocumentSchema: z.ZodNull;
|
|
8
|
+
/** Key fields of `suporte/cliente/{cliente_id}/documento/add/`: none, the success body is empty. */
|
|
9
|
+
export declare const addCustomerDocumentKeyFields: readonly [];
|
|
10
|
+
/** Normalized path of the success body in the response (the root: it is empty). */
|
|
11
|
+
export declare const customerDocumentAddedItemPath = "";
|
|
12
|
+
/** Keys of the response holding secrets (none: the response is empty). */
|
|
13
|
+
export declare const customerDocumentAddedSecretKeys: readonly [];
|
|
14
|
+
/** Keys of the response holding personal data (none: the response is empty). */
|
|
15
|
+
export declare const customerDocumentAddedPersonalKeys: readonly [];
|
|
16
|
+
/** Parsed response of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`: always `null`. */
|
|
17
|
+
export type AddCustomerDocumentResponse = z.output<typeof addCustomerDocumentSchema>;
|
|
18
|
+
/** Params of `PUT /api/suporte/cliente/{cliente_id}/documento/add/`; `cliente_id` goes in the path. */
|
|
19
|
+
export interface AddCustomerDocumentParams {
|
|
20
|
+
/** Description of the document; personal data when it names the customer. */
|
|
21
|
+
descricao?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Definition of `PUT /api/suporte/cliente/{cliente_id}/documento/add/` (trailing slash required by the token whitelist). */
|
|
24
|
+
export declare const addCustomerDocumentDefinition: WriteEndpointDefinition<typeof addCustomerDocumentSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `GET /api/suporte/cliente/{cliente_id}/documento/list/`: a bare array with the customer's documents. */
|
|
4
|
+
export declare const listCustomerDocumentsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
cliente_id: z.ZodNumber;
|
|
7
|
+
arquivo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
descricao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
usuario: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
/** Key fields of `suporte/cliente/{cliente_id}/documento/list/`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
12
|
+
export declare const listCustomerDocumentsKeyFields: readonly ["[].id", "[].cliente_id"];
|
|
13
|
+
/** Normalized path of each document in the response (the root array). */
|
|
14
|
+
export declare const customerDocumentItemPath = "[]";
|
|
15
|
+
/** Keys of a document holding secrets (none in `suporte/cliente/{cliente_id}/documento/list/`). */
|
|
16
|
+
export declare const customerDocumentSecretKeys: readonly [];
|
|
17
|
+
/** Keys of a document holding personal data: the file (a customer's document), its description and the operator. */
|
|
18
|
+
export declare const customerDocumentPersonalKeys: readonly ["arquivo", "descricao", "usuario"];
|
|
19
|
+
/** Parsed response of `GET /api/suporte/cliente/{cliente_id}/documento/list/`. */
|
|
20
|
+
export type ListCustomerDocumentsResponse = z.output<typeof listCustomerDocumentsSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Definition of `GET /api/suporte/cliente/{cliente_id}/documento/list/` (trailing slash required by
|
|
23
|
+
* the token whitelist). Not in the `endpointRegistry`: the route needs a customer ID in its path.
|
|
24
|
+
*/
|
|
25
|
+
export declare const listCustomerDocumentsDefinition: EndpointDefinition<typeof listCustomerDocumentsSchema>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/**
|
|
4
|
+
* Response of `GET /api/ura/viabilidadeinstalacao`: an array whose object is keyed by the
|
|
5
|
+
* gateway's `descricao` (data-defined: `"SGPMaps"`, `"Geogrid"`), holding either the CTOs within
|
|
6
|
+
* the radius (`lat`, `lng`, `distancia` in meters, `nome`, and `id` on Geogrid) or the message
|
|
7
|
+
* `"Localização inviável"` when there are none.
|
|
8
|
+
*
|
|
9
|
+
* `lat`, `lng` and `distancia` are always numbers: Geogrid sends them as numeric strings and the
|
|
10
|
+
* schema converts them, so both gateways look the same to the consumer. `id` is always a string:
|
|
11
|
+
* a numeric id is converted.
|
|
12
|
+
*
|
|
13
|
+
* A gateway entry that is neither CTOs nor a message (for example a CTO with a non-numeric `lat`)
|
|
14
|
+
* is a malformed answer: the result is `SCHEMA_MISMATCH`, never a success without that entry.
|
|
15
|
+
*/
|
|
16
|
+
export declare const checkCoverageSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
17
|
+
lat: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
18
|
+
lng: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
19
|
+
distancia: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>>;
|
|
20
|
+
id: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodNumber, z.ZodTransform<string, number>>]>>>;
|
|
21
|
+
nome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>>, z.ZodString]>>>;
|
|
23
|
+
/**
|
|
24
|
+
* Key fields of `ura/viabilidadeinstalacao`: every gateway entry (`*` is its data-defined name),
|
|
25
|
+
* so a malformed gateway answer is `SCHEMA_MISMATCH`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const checkCoverageKeyFields: readonly ["[].*"];
|
|
28
|
+
/** Normalized path of each gateway answer in the `ura/viabilidadeinstalacao` response (the root array). */
|
|
29
|
+
export declare const coverageItemPath = "[]";
|
|
30
|
+
/** Keys of a gateway answer holding secrets (none in `ura/viabilidadeinstalacao`). */
|
|
31
|
+
export declare const coverageSecretKeys: readonly [];
|
|
32
|
+
/** Keys of a gateway answer holding personal data (none in `ura/viabilidadeinstalacao`). */
|
|
33
|
+
export declare const coveragePersonalKeys: readonly [];
|
|
34
|
+
/** Query parameters of `GET /api/ura/viabilidadeinstalacao` (besides credentials); all required. */
|
|
35
|
+
export interface CheckCoverageParams {
|
|
36
|
+
/** ID of the map gateway, from `/api/ura/listgatewaymapa`. */
|
|
37
|
+
gateway: number;
|
|
38
|
+
/** Search radius in meters. */
|
|
39
|
+
raio: number;
|
|
40
|
+
/** Coordinate to check, `"lat,lng"`, e.g. `"-23.55,-46.63"`. */
|
|
41
|
+
coordenada: string;
|
|
42
|
+
}
|
|
43
|
+
/** Parsed response of `GET /api/ura/viabilidadeinstalacao`. */
|
|
44
|
+
export type CheckCoverageResponse = z.output<typeof checkCoverageSchema>;
|
|
45
|
+
/** Definition of `GET /api/ura/viabilidadeinstalacao`. */
|
|
46
|
+
export declare const checkCoverageDefinition: EndpointDefinition<typeof checkCoverageSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { SgpResult } from "../../result.js";
|
|
3
|
+
import { type SgpClientConfig } from "../../transport.js";
|
|
4
|
+
/** Parsed, locally selected annotations; unknown fields are stripped. */
|
|
5
|
+
export declare const listAnnotationsSchema: z.ZodArray<z.ZodObject<{
|
|
6
|
+
id: z.ZodNumber;
|
|
7
|
+
cliente: z.ZodNumber;
|
|
8
|
+
clientecontrato: z.ZodNullable<z.ZodNumber>;
|
|
9
|
+
anotacao: z.ZodString;
|
|
10
|
+
usuario: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
tipo: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
alerta_modo: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
13
|
+
data_cadastro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
data_alteracao: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
/** Required strict fields of each selected annotation. */
|
|
17
|
+
export declare const listAnnotationsKeyFields: readonly ["[].id", "[].cliente", "[].clientecontrato", "[].anotacao"];
|
|
18
|
+
/** Normalized path of each annotation in the root array. */
|
|
19
|
+
export declare const annotationItemPath = "[]";
|
|
20
|
+
/** No declared credential fields; free text can still contain sensitive content. */
|
|
21
|
+
export declare const annotationSecretKeys: readonly [];
|
|
22
|
+
/** Free text and staff identity must be omitted before logging or forwarding. */
|
|
23
|
+
export declare const annotationPersonalKeys: readonly ["anotacao", "usuario"];
|
|
24
|
+
/** At least one positive safe-integer filter is required; both filters mean AND. */
|
|
25
|
+
export interface ListAnnotationsParams {
|
|
26
|
+
cliente_id?: number;
|
|
27
|
+
contrato_id?: number;
|
|
28
|
+
}
|
|
29
|
+
/** Selected notes present in one SGP response, not a guarantee of source completeness. */
|
|
30
|
+
export type ListAnnotationsResponse = z.output<typeof listAnnotationsSchema>;
|
|
31
|
+
/** Special read: never add to the generic filterless probe registry. */
|
|
32
|
+
export declare const listAnnotations: (config: SgpClientConfig, params: ListAnnotationsParams) => Promise<SgpResult<ListAnnotationsResponse>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `POST /api/ura/clientes/`: one page of clients with their address and contacts. */
|
|
4
|
+
export declare const listClientsSchema: z.ZodObject<{
|
|
5
|
+
paginacao: z.ZodObject<{
|
|
6
|
+
offset: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
parcial: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
+
total: z.ZodNumber;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
clientes: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
nome: z.ZodString;
|
|
14
|
+
tipo: z.ZodString;
|
|
15
|
+
cpfcnpj: z.ZodString;
|
|
16
|
+
sexo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
dataCadastro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
endereco: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
19
|
+
logradouro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
numero: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
21
|
+
bairro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
22
|
+
cidade: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
uf: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
24
|
+
cep: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
25
|
+
complemento: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
latitude: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
longitude: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>>>;
|
|
29
|
+
contratos: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
30
|
+
titulos: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, z.core.$strip>>>>;
|
|
31
|
+
contatos: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
32
|
+
telefones: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
33
|
+
celulares: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
34
|
+
emails: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
35
|
+
outros: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
/** Key fields of `ura/clientes`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
40
|
+
export declare const listClientsKeyFields: readonly ["paginacao.total", "clientes", "clientes[].id", "clientes[].nome", "clientes[].cpfcnpj", "clientes[].tipo"];
|
|
41
|
+
/** Normalized path of each client item in the `ura/clientes` response. */
|
|
42
|
+
export declare const clientItemPath = "clientes[]";
|
|
43
|
+
/** Keys of a client item holding secrets (none in `ura/clientes`). */
|
|
44
|
+
export declare const clientSecretKeys: readonly [];
|
|
45
|
+
/** Keys of a client item holding personal data. */
|
|
46
|
+
export declare const clientPersonalKeys: readonly ["nome", "cpfcnpj", "sexo", "endereco", "contatos"];
|
|
47
|
+
/** Body parameters of `POST /api/ura/clientes/` (besides credentials); all optional filters and paging. */
|
|
48
|
+
export interface ListClientsParams {
|
|
49
|
+
offset?: number;
|
|
50
|
+
limit?: number;
|
|
51
|
+
cliente_id?: number;
|
|
52
|
+
cpfcnpj?: string;
|
|
53
|
+
cliente_nome?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Parsed response of `POST /api/ura/clientes/`. */
|
|
56
|
+
export type ListClientsResponse = z.output<typeof listClientsSchema>;
|
|
57
|
+
/** Definition of `POST /api/ura/clientes/`. */
|
|
58
|
+
export declare const listClientsDefinition: EndpointDefinition<typeof listClientsSchema>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { EndpointDefinition } from "../../endpoint.js";
|
|
3
|
+
/** Response of `POST /api/ura/listacontrato/`: a bare array with one summary per contract. */
|
|
4
|
+
export declare const listContractsSchema: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id_contrato: z.ZodNumber;
|
|
6
|
+
id_cliente: z.ZodNumber;
|
|
7
|
+
status: z.ZodString;
|
|
8
|
+
pop_id: z.ZodNumber;
|
|
9
|
+
nome: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
cpfcnpj: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
11
|
+
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
telefone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
data_status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
data_cadastro: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
motivo_status: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
/** Key fields of `ura/listacontrato`: required and strict; any mismatch is `SCHEMA_MISMATCH`. */
|
|
18
|
+
export declare const listContractsKeyFields: readonly ["[].id_contrato", "[].id_cliente", "[].status", "[].pop_id"];
|
|
19
|
+
/** Normalized path of each contract item in the `ura/listacontrato` response (the root array). */
|
|
20
|
+
export declare const contractSummaryItemPath = "[]";
|
|
21
|
+
/** Keys of a contract summary holding secrets (none in `ura/listacontrato`). */
|
|
22
|
+
export declare const contractSummarySecretKeys: readonly [];
|
|
23
|
+
/** Keys of a contract summary holding personal data. */
|
|
24
|
+
export declare const contractSummaryPersonalKeys: readonly ["nome", "cpfcnpj", "email", "telefone", "motivo_status"];
|
|
25
|
+
/**
|
|
26
|
+
* Body parameters of `POST /api/ura/listacontrato/` (besides credentials); all optional filters.
|
|
27
|
+
*
|
|
28
|
+
* Without any filter the response may carry the whole contract base.
|
|
29
|
+
*/
|
|
30
|
+
export interface ListContractsParams {
|
|
31
|
+
/** Contract ID. */
|
|
32
|
+
contrato?: number;
|
|
33
|
+
/** ID of the plan linked to the contract. */
|
|
34
|
+
plano?: number;
|
|
35
|
+
/** Person type (see the public SGP documentation for the values). */
|
|
36
|
+
tipo?: string;
|
|
37
|
+
/** Contract status ID (see the public SGP documentation for the values). */
|
|
38
|
+
status?: number;
|
|
39
|
+
/** Ask SGP to include the address; address fields are not transcribed yet, so the schema drops them. */
|
|
40
|
+
exibir_endereco?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Parsed response of `POST /api/ura/listacontrato/`. */
|
|
43
|
+
export type ListContractsResponse = z.output<typeof listContractsSchema>;
|
|
44
|
+
/** Definition of `POST /api/ura/listacontrato/`. */
|
|
45
|
+
export declare const listContractsDefinition: EndpointDefinition<typeof listContractsSchema>;
|